diff --git a/sdk/compute/azure-mgmt-compute/CHANGELOG.md b/sdk/compute/azure-mgmt-compute/CHANGELOG.md index 7d88e242e6f1..f9d6ddd10d72 100644 --- a/sdk/compute/azure-mgmt-compute/CHANGELOG.md +++ b/sdk/compute/azure-mgmt-compute/CHANGELOG.md @@ -1,5 +1,35 @@ # Release History +## 23.0.0 (2021-09-02) + +**Features** + + - Model HardwareProfile has a new parameter vm_size_properties + - Model VirtualMachineScaleSetVMProfile has a new parameter application_profile + - Model AdditionalCapabilities has a new parameter hibernation_enabled + - Model VirtualMachine has a new parameter application_profile + - Model VirtualMachineScaleSetVMExtensionUpdate has a new parameter suppress_failures + - Model Gallery has a new parameter soft_delete_policy + - Model ScaleInPolicy has a new parameter force_deletion + - Model VirtualMachineScaleSetExtensionUpdate has a new parameter suppress_failures + - Model GalleryArtifactPublishingProfileBase has a new parameter replication_mode + - Model GalleryImageVersionPublishingProfile has a new parameter replication_mode + - Model GalleryApplicationVersionPublishingProfile has a new parameter replication_mode + - Model ImageReference has a new parameter shared_gallery_image_id + - Model VirtualMachineUpdate has a new parameter application_profile + - Model VirtualMachineScaleSetVMExtension has a new parameter suppress_failures + - Model ResourceSkuLocationInfo has a new parameter type + - Model ResourceSkuLocationInfo has a new parameter extended_locations + - Model VirtualMachineScaleSetExtension has a new parameter suppress_failures + - Model VirtualMachineExtension has a new parameter suppress_failures + - Model VirtualMachineExtensionUpdate has a new parameter suppress_failures + - Model GalleryUpdate has a new parameter soft_delete_policy + +**Breaking changes** + + - Operation ResourceSkusOperations.list has a new signature + - Operation VirtualMachinesOperations.begin_deallocate has a new signature + ## 22.1.0 (2021-07-22) **Features** diff --git a/sdk/compute/azure-mgmt-compute/_meta.json b/sdk/compute/azure-mgmt-compute/_meta.json index 5b4e2528ba0c..73259758dfb6 100644 --- a/sdk/compute/azure-mgmt-compute/_meta.json +++ b/sdk/compute/azure-mgmt-compute/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "48796aff62fdca25b201bfcbe587729a40a6b851", + "commit": "d5ad9431bbc19c34090d97209eb497167db32879", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/compute/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/compute/resource-manager/readme.md" 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 97869118126b..fd2951c84dfd 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 @@ -56,7 +56,7 @@ 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 = '2021-04-01' + DEFAULT_API_VERSION = '2021-07-01' _PROFILE_TAG = "azure.mgmt.compute.ComputeManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -70,16 +70,6 @@ class ComputeManagementClient(MultiApiClientMixin, _SDKClient): 'disk_encryption_sets': '2020-12-01', 'disk_restore_point': '2020-12-01', 'disks': '2020-12-01', - 'galleries': '2020-09-30', - 'gallery_application_versions': '2020-09-30', - 'gallery_applications': '2020-09-30', - 'gallery_image_versions': '2020-09-30', - 'gallery_images': '2020-09-30', - 'gallery_sharing_profile': '2020-09-30', - 'resource_skus': '2019-04-01', - 'shared_galleries': '2020-09-30', - 'shared_gallery_image_versions': '2020-09-30', - 'shared_gallery_images': '2020-09-30', 'snapshots': '2020-12-01', }}, _PROFILE_TAG + " latest" @@ -134,6 +124,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2020-12-01: :mod:`v2020_12_01.models` * 2021-03-01: :mod:`v2021_03_01.models` * 2021-04-01: :mod:`v2021_04_01.models` + * 2021-07-01: :mod:`v2021_07_01.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -204,6 +195,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-04-01': from .v2021_04_01 import models return models + elif api_version == '2021-07-01': + from .v2021_07_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -225,6 +219,7 @@ def availability_sets(self): * 2020-12-01: :class:`AvailabilitySetsOperations` * 2021-03-01: :class:`AvailabilitySetsOperations` * 2021-04-01: :class:`AvailabilitySetsOperations` + * 2021-07-01: :class:`AvailabilitySetsOperations` """ api_version = self._get_api_version('availability_sets') if api_version == '2015-06-15': @@ -257,6 +252,8 @@ def availability_sets(self): from .v2021_03_01.operations import AvailabilitySetsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -266,10 +263,13 @@ def capacity_reservation_groups(self): """Instance depends on the API version: * 2021-04-01: :class:`CapacityReservationGroupsOperations` + * 2021-07-01: :class:`CapacityReservationGroupsOperations` """ api_version = self._get_api_version('capacity_reservation_groups') if api_version == '2021-04-01': from .v2021_04_01.operations import CapacityReservationGroupsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.operations import CapacityReservationGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'capacity_reservation_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -279,10 +279,13 @@ def capacity_reservations(self): """Instance depends on the API version: * 2021-04-01: :class:`CapacityReservationsOperations` + * 2021-07-01: :class:`CapacityReservationsOperations` """ api_version = self._get_api_version('capacity_reservations') if api_version == '2021-04-01': from .v2021_04_01.operations import CapacityReservationsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.operations import CapacityReservationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'capacity_reservations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -375,6 +378,7 @@ def dedicated_host_groups(self): * 2020-12-01: :class:`DedicatedHostGroupsOperations` * 2021-03-01: :class:`DedicatedHostGroupsOperations` * 2021-04-01: :class:`DedicatedHostGroupsOperations` + * 2021-07-01: :class:`DedicatedHostGroupsOperations` """ api_version = self._get_api_version('dedicated_host_groups') if api_version == '2019-03-01': @@ -391,6 +395,8 @@ def dedicated_host_groups(self): from .v2021_03_01.operations import DedicatedHostGroupsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import DedicatedHostGroupsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -406,6 +412,7 @@ def dedicated_hosts(self): * 2020-12-01: :class:`DedicatedHostsOperations` * 2021-03-01: :class:`DedicatedHostsOperations` * 2021-04-01: :class:`DedicatedHostsOperations` + * 2021-07-01: :class:`DedicatedHostsOperations` """ api_version = self._get_api_version('dedicated_hosts') if api_version == '2019-03-01': @@ -422,6 +429,8 @@ def dedicated_hosts(self): from .v2021_03_01.operations import DedicatedHostsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import DedicatedHostsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_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))) @@ -547,6 +556,7 @@ def galleries(self): * 2019-07-01: :class:`GalleriesOperations` * 2019-12-01: :class:`GalleriesOperations` * 2020-09-30: :class:`GalleriesOperations` + * 2021-07-01: :class:`GalleriesOperations` """ api_version = self._get_api_version('galleries') if api_version == '2018-06-01': @@ -559,6 +569,8 @@ def galleries(self): from .v2019_12_01.operations import GalleriesOperations as OperationClass elif api_version == '2020-09-30': from .v2020_09_30.operations import GalleriesOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -571,6 +583,7 @@ def gallery_application_versions(self): * 2019-07-01: :class:`GalleryApplicationVersionsOperations` * 2019-12-01: :class:`GalleryApplicationVersionsOperations` * 2020-09-30: :class:`GalleryApplicationVersionsOperations` + * 2021-07-01: :class:`GalleryApplicationVersionsOperations` """ api_version = self._get_api_version('gallery_application_versions') if api_version == '2019-03-01': @@ -581,6 +594,8 @@ def gallery_application_versions(self): from .v2019_12_01.operations import GalleryApplicationVersionsOperations as OperationClass elif api_version == '2020-09-30': from .v2020_09_30.operations import GalleryApplicationVersionsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -593,6 +608,7 @@ def gallery_applications(self): * 2019-07-01: :class:`GalleryApplicationsOperations` * 2019-12-01: :class:`GalleryApplicationsOperations` * 2020-09-30: :class:`GalleryApplicationsOperations` + * 2021-07-01: :class:`GalleryApplicationsOperations` """ api_version = self._get_api_version('gallery_applications') if api_version == '2019-03-01': @@ -603,6 +619,8 @@ def gallery_applications(self): from .v2019_12_01.operations import GalleryApplicationsOperations as OperationClass elif api_version == '2020-09-30': from .v2020_09_30.operations import GalleryApplicationsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -616,6 +634,7 @@ def gallery_image_versions(self): * 2019-07-01: :class:`GalleryImageVersionsOperations` * 2019-12-01: :class:`GalleryImageVersionsOperations` * 2020-09-30: :class:`GalleryImageVersionsOperations` + * 2021-07-01: :class:`GalleryImageVersionsOperations` """ api_version = self._get_api_version('gallery_image_versions') if api_version == '2018-06-01': @@ -628,6 +647,8 @@ def gallery_image_versions(self): from .v2019_12_01.operations import GalleryImageVersionsOperations as OperationClass elif api_version == '2020-09-30': from .v2020_09_30.operations import GalleryImageVersionsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -641,6 +662,7 @@ def gallery_images(self): * 2019-07-01: :class:`GalleryImagesOperations` * 2019-12-01: :class:`GalleryImagesOperations` * 2020-09-30: :class:`GalleryImagesOperations` + * 2021-07-01: :class:`GalleryImagesOperations` """ api_version = self._get_api_version('gallery_images') if api_version == '2018-06-01': @@ -653,6 +675,8 @@ def gallery_images(self): from .v2019_12_01.operations import GalleryImagesOperations as OperationClass elif api_version == '2020-09-30': from .v2020_09_30.operations import GalleryImagesOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -662,10 +686,13 @@ def gallery_sharing_profile(self): """Instance depends on the API version: * 2020-09-30: :class:`GallerySharingProfileOperations` + * 2021-07-01: :class:`GallerySharingProfileOperations` """ api_version = self._get_api_version('gallery_sharing_profile') if api_version == '2020-09-30': from .v2020_09_30.operations import GallerySharingProfileOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.operations import GallerySharingProfileOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gallery_sharing_profile'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -687,6 +714,7 @@ def images(self): * 2020-12-01: :class:`ImagesOperations` * 2021-03-01: :class:`ImagesOperations` * 2021-04-01: :class:`ImagesOperations` + * 2021-07-01: :class:`ImagesOperations` """ api_version = self._get_api_version('images') if api_version == '2016-04-30-preview': @@ -715,6 +743,8 @@ def images(self): from .v2021_03_01.operations import ImagesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import ImagesOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -734,6 +764,7 @@ def log_analytics(self): * 2020-12-01: :class:`LogAnalyticsOperations` * 2021-03-01: :class:`LogAnalyticsOperations` * 2021-04-01: :class:`LogAnalyticsOperations` + * 2021-07-01: :class:`LogAnalyticsOperations` """ api_version = self._get_api_version('log_analytics') if api_version == '2017-12-01': @@ -758,6 +789,8 @@ def log_analytics(self): from .v2021_03_01.operations import LogAnalyticsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import LogAnalyticsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -777,6 +810,7 @@ def operations(self): * 2020-12-01: :class:`Operations` * 2021-03-01: :class:`Operations` * 2021-04-01: :class:`Operations` + * 2021-07-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-12-01': @@ -801,6 +835,8 @@ def operations(self): from .v2021_03_01.operations import Operations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import Operations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -819,6 +855,7 @@ def proximity_placement_groups(self): * 2020-12-01: :class:`ProximityPlacementGroupsOperations` * 2021-03-01: :class:`ProximityPlacementGroupsOperations` * 2021-04-01: :class:`ProximityPlacementGroupsOperations` + * 2021-07-01: :class:`ProximityPlacementGroupsOperations` """ api_version = self._get_api_version('proximity_placement_groups') if api_version == '2018-04-01': @@ -841,6 +878,8 @@ def proximity_placement_groups(self): from .v2021_03_01.operations import ProximityPlacementGroupsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import ProximityPlacementGroupsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -852,6 +891,7 @@ def resource_skus(self): * 2017-03-30: :class:`ResourceSkusOperations` * 2017-09-01: :class:`ResourceSkusOperations` * 2019-04-01: :class:`ResourceSkusOperations` + * 2021-07-01: :class:`ResourceSkusOperations` """ api_version = self._get_api_version('resource_skus') if api_version == '2017-03-30': @@ -860,6 +900,8 @@ def resource_skus(self): from .v2017_09_01.operations import ResourceSkusOperations as OperationClass elif api_version == '2019-04-01': from .v2019_04_01.operations import ResourceSkusOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -870,12 +912,15 @@ def restore_point_collections(self): * 2021-03-01: :class:`RestorePointCollectionsOperations` * 2021-04-01: :class:`RestorePointCollectionsOperations` + * 2021-07-01: :class:`RestorePointCollectionsOperations` """ api_version = self._get_api_version('restore_point_collections') if api_version == '2021-03-01': from .v2021_03_01.operations import RestorePointCollectionsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import RestorePointCollectionsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.operations import RestorePointCollectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'restore_point_collections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -886,12 +931,15 @@ def restore_points(self): * 2021-03-01: :class:`RestorePointsOperations` * 2021-04-01: :class:`RestorePointsOperations` + * 2021-07-01: :class:`RestorePointsOperations` """ api_version = self._get_api_version('restore_points') if api_version == '2021-03-01': from .v2021_03_01.operations import RestorePointsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import RestorePointsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.operations import RestorePointsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'restore_points'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -901,10 +949,13 @@ def shared_galleries(self): """Instance depends on the API version: * 2020-09-30: :class:`SharedGalleriesOperations` + * 2021-07-01: :class:`SharedGalleriesOperations` """ api_version = self._get_api_version('shared_galleries') if api_version == '2020-09-30': from .v2020_09_30.operations import SharedGalleriesOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.operations import SharedGalleriesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'shared_galleries'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -914,10 +965,13 @@ def shared_gallery_image_versions(self): """Instance depends on the API version: * 2020-09-30: :class:`SharedGalleryImageVersionsOperations` + * 2021-07-01: :class:`SharedGalleryImageVersionsOperations` """ api_version = self._get_api_version('shared_gallery_image_versions') if api_version == '2020-09-30': from .v2020_09_30.operations import SharedGalleryImageVersionsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.operations import SharedGalleryImageVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'shared_gallery_image_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -927,10 +981,13 @@ def shared_gallery_images(self): """Instance depends on the API version: * 2020-09-30: :class:`SharedGalleryImagesOperations` + * 2021-07-01: :class:`SharedGalleryImagesOperations` """ api_version = self._get_api_version('shared_gallery_images') if api_version == '2020-09-30': from .v2020_09_30.operations import SharedGalleryImagesOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.operations import SharedGalleryImagesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'shared_gallery_images'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -990,6 +1047,7 @@ def ssh_public_keys(self): * 2020-12-01: :class:`SshPublicKeysOperations` * 2021-03-01: :class:`SshPublicKeysOperations` * 2021-04-01: :class:`SshPublicKeysOperations` + * 2021-07-01: :class:`SshPublicKeysOperations` """ api_version = self._get_api_version('ssh_public_keys') if api_version == '2019-12-01': @@ -1002,6 +1060,8 @@ def ssh_public_keys(self): from .v2021_03_01.operations import SshPublicKeysOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import SshPublicKeysOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -1025,6 +1085,7 @@ def usage(self): * 2020-12-01: :class:`UsageOperations` * 2021-03-01: :class:`UsageOperations` * 2021-04-01: :class:`UsageOperations` + * 2021-07-01: :class:`UsageOperations` """ api_version = self._get_api_version('usage') if api_version == '2015-06-15': @@ -1057,6 +1118,8 @@ def usage(self): from .v2021_03_01.operations import UsageOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import UsageOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -1080,6 +1143,7 @@ def virtual_machine_extension_images(self): * 2020-12-01: :class:`VirtualMachineExtensionImagesOperations` * 2021-03-01: :class:`VirtualMachineExtensionImagesOperations` * 2021-04-01: :class:`VirtualMachineExtensionImagesOperations` + * 2021-07-01: :class:`VirtualMachineExtensionImagesOperations` """ api_version = self._get_api_version('virtual_machine_extension_images') if api_version == '2015-06-15': @@ -1112,6 +1176,8 @@ def virtual_machine_extension_images(self): from .v2021_03_01.operations import VirtualMachineExtensionImagesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -1135,6 +1201,7 @@ def virtual_machine_extensions(self): * 2020-12-01: :class:`VirtualMachineExtensionsOperations` * 2021-03-01: :class:`VirtualMachineExtensionsOperations` * 2021-04-01: :class:`VirtualMachineExtensionsOperations` + * 2021-07-01: :class:`VirtualMachineExtensionsOperations` """ api_version = self._get_api_version('virtual_machine_extensions') if api_version == '2015-06-15': @@ -1167,6 +1234,8 @@ def virtual_machine_extensions(self): from .v2021_03_01.operations import VirtualMachineExtensionsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -1190,6 +1259,7 @@ def virtual_machine_images(self): * 2020-12-01: :class:`VirtualMachineImagesOperations` * 2021-03-01: :class:`VirtualMachineImagesOperations` * 2021-04-01: :class:`VirtualMachineImagesOperations` + * 2021-07-01: :class:`VirtualMachineImagesOperations` """ api_version = self._get_api_version('virtual_machine_images') if api_version == '2015-06-15': @@ -1222,6 +1292,8 @@ def virtual_machine_images(self): from .v2021_03_01.operations import VirtualMachineImagesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -1233,6 +1305,7 @@ def virtual_machine_images_edge_zone(self): * 2020-12-01: :class:`VirtualMachineImagesEdgeZoneOperations` * 2021-03-01: :class:`VirtualMachineImagesEdgeZoneOperations` * 2021-04-01: :class:`VirtualMachineImagesEdgeZoneOperations` + * 2021-07-01: :class:`VirtualMachineImagesEdgeZoneOperations` """ api_version = self._get_api_version('virtual_machine_images_edge_zone') if api_version == '2020-12-01': @@ -1241,6 +1314,8 @@ def virtual_machine_images_edge_zone(self): from .v2021_03_01.operations import VirtualMachineImagesEdgeZoneOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import VirtualMachineImagesEdgeZoneOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.operations import VirtualMachineImagesEdgeZoneOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_machine_images_edge_zone'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1261,6 +1336,7 @@ def virtual_machine_run_commands(self): * 2020-12-01: :class:`VirtualMachineRunCommandsOperations` * 2021-03-01: :class:`VirtualMachineRunCommandsOperations` * 2021-04-01: :class:`VirtualMachineRunCommandsOperations` + * 2021-07-01: :class:`VirtualMachineRunCommandsOperations` """ api_version = self._get_api_version('virtual_machine_run_commands') if api_version == '2017-03-30': @@ -1287,6 +1363,8 @@ def virtual_machine_run_commands(self): from .v2021_03_01.operations import VirtualMachineRunCommandsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import VirtualMachineRunCommandsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -1307,6 +1385,7 @@ def virtual_machine_scale_set_extensions(self): * 2020-12-01: :class:`VirtualMachineScaleSetExtensionsOperations` * 2021-03-01: :class:`VirtualMachineScaleSetExtensionsOperations` * 2021-04-01: :class:`VirtualMachineScaleSetExtensionsOperations` + * 2021-07-01: :class:`VirtualMachineScaleSetExtensionsOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_extensions') if api_version == '2017-03-30': @@ -1333,6 +1412,8 @@ def virtual_machine_scale_set_extensions(self): from .v2021_03_01.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -1353,6 +1434,7 @@ def virtual_machine_scale_set_rolling_upgrades(self): * 2020-12-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` * 2021-03-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` * 2021-04-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` + * 2021-07-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_rolling_upgrades') if api_version == '2017-03-30': @@ -1379,6 +1461,8 @@ def virtual_machine_scale_set_rolling_upgrades(self): from .v2021_03_01.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -1393,6 +1477,7 @@ def virtual_machine_scale_set_vm_extensions(self): * 2020-12-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` * 2021-03-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` * 2021-04-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` + * 2021-07-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_vm_extensions') if api_version == '2019-07-01': @@ -1407,6 +1492,8 @@ def virtual_machine_scale_set_vm_extensions(self): from .v2021_03_01.operations import VirtualMachineScaleSetVMExtensionsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import VirtualMachineScaleSetVMExtensionsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -1419,6 +1506,7 @@ def virtual_machine_scale_set_vm_run_commands(self): * 2020-12-01: :class:`VirtualMachineScaleSetVMRunCommandsOperations` * 2021-03-01: :class:`VirtualMachineScaleSetVMRunCommandsOperations` * 2021-04-01: :class:`VirtualMachineScaleSetVMRunCommandsOperations` + * 2021-07-01: :class:`VirtualMachineScaleSetVMRunCommandsOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_vm_run_commands') if api_version == '2020-06-01': @@ -1429,6 +1517,8 @@ def virtual_machine_scale_set_vm_run_commands(self): from .v2021_03_01.operations import VirtualMachineScaleSetVMRunCommandsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import VirtualMachineScaleSetVMRunCommandsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.operations import VirtualMachineScaleSetVMRunCommandsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_vm_run_commands'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1452,6 +1542,7 @@ def virtual_machine_scale_set_vms(self): * 2020-12-01: :class:`VirtualMachineScaleSetVMsOperations` * 2021-03-01: :class:`VirtualMachineScaleSetVMsOperations` * 2021-04-01: :class:`VirtualMachineScaleSetVMsOperations` + * 2021-07-01: :class:`VirtualMachineScaleSetVMsOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_vms') if api_version == '2015-06-15': @@ -1484,6 +1575,8 @@ def virtual_machine_scale_set_vms(self): from .v2021_03_01.operations import VirtualMachineScaleSetVMsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -1507,6 +1600,7 @@ def virtual_machine_scale_sets(self): * 2020-12-01: :class:`VirtualMachineScaleSetsOperations` * 2021-03-01: :class:`VirtualMachineScaleSetsOperations` * 2021-04-01: :class:`VirtualMachineScaleSetsOperations` + * 2021-07-01: :class:`VirtualMachineScaleSetsOperations` """ api_version = self._get_api_version('virtual_machine_scale_sets') if api_version == '2015-06-15': @@ -1539,6 +1633,8 @@ def virtual_machine_scale_sets(self): from .v2021_03_01.operations import VirtualMachineScaleSetsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -1562,6 +1658,7 @@ def virtual_machine_sizes(self): * 2020-12-01: :class:`VirtualMachineSizesOperations` * 2021-03-01: :class:`VirtualMachineSizesOperations` * 2021-04-01: :class:`VirtualMachineSizesOperations` + * 2021-07-01: :class:`VirtualMachineSizesOperations` """ api_version = self._get_api_version('virtual_machine_sizes') if api_version == '2015-06-15': @@ -1594,6 +1691,8 @@ def virtual_machine_sizes(self): from .v2021_03_01.operations import VirtualMachineSizesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -1617,6 +1716,7 @@ def virtual_machines(self): * 2020-12-01: :class:`VirtualMachinesOperations` * 2021-03-01: :class:`VirtualMachinesOperations` * 2021-04-01: :class:`VirtualMachinesOperations` + * 2021-07-01: :class:`VirtualMachinesOperations` """ api_version = self._get_api_version('virtual_machines') if api_version == '2015-06-15': @@ -1649,6 +1749,8 @@ def virtual_machines(self): from .v2021_03_01.operations import VirtualMachinesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) 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 2c98c3eec5cc..d4fc54da5083 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 = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py index 5e1fe486b6e7..63f7966007f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py @@ -54,7 +54,7 @@ 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 = '2021-04-01' + DEFAULT_API_VERSION = '2021-07-01' _PROFILE_TAG = "azure.mgmt.compute.ComputeManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -68,16 +68,6 @@ class ComputeManagementClient(MultiApiClientMixin, _SDKClient): 'disk_encryption_sets': '2020-12-01', 'disk_restore_point': '2020-12-01', 'disks': '2020-12-01', - 'galleries': '2020-09-30', - 'gallery_application_versions': '2020-09-30', - 'gallery_applications': '2020-09-30', - 'gallery_image_versions': '2020-09-30', - 'gallery_images': '2020-09-30', - 'gallery_sharing_profile': '2020-09-30', - 'resource_skus': '2019-04-01', - 'shared_galleries': '2020-09-30', - 'shared_gallery_image_versions': '2020-09-30', - 'shared_gallery_images': '2020-09-30', 'snapshots': '2020-12-01', }}, _PROFILE_TAG + " latest" @@ -132,6 +122,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2020-12-01: :mod:`v2020_12_01.models` * 2021-03-01: :mod:`v2021_03_01.models` * 2021-04-01: :mod:`v2021_04_01.models` + * 2021-07-01: :mod:`v2021_07_01.models` """ if api_version == '2015-06-15': from ..v2015_06_15 import models @@ -202,6 +193,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-04-01': from ..v2021_04_01 import models return models + elif api_version == '2021-07-01': + from ..v2021_07_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -223,6 +217,7 @@ def availability_sets(self): * 2020-12-01: :class:`AvailabilitySetsOperations` * 2021-03-01: :class:`AvailabilitySetsOperations` * 2021-04-01: :class:`AvailabilitySetsOperations` + * 2021-07-01: :class:`AvailabilitySetsOperations` """ api_version = self._get_api_version('availability_sets') if api_version == '2015-06-15': @@ -255,6 +250,8 @@ def availability_sets(self): from ..v2021_03_01.aio.operations import AvailabilitySetsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import AvailabilitySetsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -264,10 +261,13 @@ def capacity_reservation_groups(self): """Instance depends on the API version: * 2021-04-01: :class:`CapacityReservationGroupsOperations` + * 2021-07-01: :class:`CapacityReservationGroupsOperations` """ api_version = self._get_api_version('capacity_reservation_groups') if api_version == '2021-04-01': from ..v2021_04_01.aio.operations import CapacityReservationGroupsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.operations import CapacityReservationGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'capacity_reservation_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -277,10 +277,13 @@ def capacity_reservations(self): """Instance depends on the API version: * 2021-04-01: :class:`CapacityReservationsOperations` + * 2021-07-01: :class:`CapacityReservationsOperations` """ api_version = self._get_api_version('capacity_reservations') if api_version == '2021-04-01': from ..v2021_04_01.aio.operations import CapacityReservationsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.operations import CapacityReservationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'capacity_reservations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -373,6 +376,7 @@ def dedicated_host_groups(self): * 2020-12-01: :class:`DedicatedHostGroupsOperations` * 2021-03-01: :class:`DedicatedHostGroupsOperations` * 2021-04-01: :class:`DedicatedHostGroupsOperations` + * 2021-07-01: :class:`DedicatedHostGroupsOperations` """ api_version = self._get_api_version('dedicated_host_groups') if api_version == '2019-03-01': @@ -389,6 +393,8 @@ def dedicated_host_groups(self): from ..v2021_03_01.aio.operations import DedicatedHostGroupsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import DedicatedHostGroupsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -404,6 +410,7 @@ def dedicated_hosts(self): * 2020-12-01: :class:`DedicatedHostsOperations` * 2021-03-01: :class:`DedicatedHostsOperations` * 2021-04-01: :class:`DedicatedHostsOperations` + * 2021-07-01: :class:`DedicatedHostsOperations` """ api_version = self._get_api_version('dedicated_hosts') if api_version == '2019-03-01': @@ -420,6 +427,8 @@ def dedicated_hosts(self): from ..v2021_03_01.aio.operations import DedicatedHostsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import DedicatedHostsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -545,6 +554,7 @@ def galleries(self): * 2019-07-01: :class:`GalleriesOperations` * 2019-12-01: :class:`GalleriesOperations` * 2020-09-30: :class:`GalleriesOperations` + * 2021-07-01: :class:`GalleriesOperations` """ api_version = self._get_api_version('galleries') if api_version == '2018-06-01': @@ -557,6 +567,8 @@ def galleries(self): from ..v2019_12_01.aio.operations import GalleriesOperations as OperationClass elif api_version == '2020-09-30': from ..v2020_09_30.aio.operations import GalleriesOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -569,6 +581,7 @@ def gallery_application_versions(self): * 2019-07-01: :class:`GalleryApplicationVersionsOperations` * 2019-12-01: :class:`GalleryApplicationVersionsOperations` * 2020-09-30: :class:`GalleryApplicationVersionsOperations` + * 2021-07-01: :class:`GalleryApplicationVersionsOperations` """ api_version = self._get_api_version('gallery_application_versions') if api_version == '2019-03-01': @@ -579,6 +592,8 @@ def gallery_application_versions(self): from ..v2019_12_01.aio.operations import GalleryApplicationVersionsOperations as OperationClass elif api_version == '2020-09-30': from ..v2020_09_30.aio.operations import GalleryApplicationVersionsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -591,6 +606,7 @@ def gallery_applications(self): * 2019-07-01: :class:`GalleryApplicationsOperations` * 2019-12-01: :class:`GalleryApplicationsOperations` * 2020-09-30: :class:`GalleryApplicationsOperations` + * 2021-07-01: :class:`GalleryApplicationsOperations` """ api_version = self._get_api_version('gallery_applications') if api_version == '2019-03-01': @@ -601,6 +617,8 @@ def gallery_applications(self): from ..v2019_12_01.aio.operations import GalleryApplicationsOperations as OperationClass elif api_version == '2020-09-30': from ..v2020_09_30.aio.operations import GalleryApplicationsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -614,6 +632,7 @@ def gallery_image_versions(self): * 2019-07-01: :class:`GalleryImageVersionsOperations` * 2019-12-01: :class:`GalleryImageVersionsOperations` * 2020-09-30: :class:`GalleryImageVersionsOperations` + * 2021-07-01: :class:`GalleryImageVersionsOperations` """ api_version = self._get_api_version('gallery_image_versions') if api_version == '2018-06-01': @@ -626,6 +645,8 @@ def gallery_image_versions(self): from ..v2019_12_01.aio.operations import GalleryImageVersionsOperations as OperationClass elif api_version == '2020-09-30': from ..v2020_09_30.aio.operations import GalleryImageVersionsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -639,6 +660,7 @@ def gallery_images(self): * 2019-07-01: :class:`GalleryImagesOperations` * 2019-12-01: :class:`GalleryImagesOperations` * 2020-09-30: :class:`GalleryImagesOperations` + * 2021-07-01: :class:`GalleryImagesOperations` """ api_version = self._get_api_version('gallery_images') if api_version == '2018-06-01': @@ -651,6 +673,8 @@ def gallery_images(self): from ..v2019_12_01.aio.operations import GalleryImagesOperations as OperationClass elif api_version == '2020-09-30': from ..v2020_09_30.aio.operations import GalleryImagesOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -660,10 +684,13 @@ def gallery_sharing_profile(self): """Instance depends on the API version: * 2020-09-30: :class:`GallerySharingProfileOperations` + * 2021-07-01: :class:`GallerySharingProfileOperations` """ api_version = self._get_api_version('gallery_sharing_profile') if api_version == '2020-09-30': from ..v2020_09_30.aio.operations import GallerySharingProfileOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.operations import GallerySharingProfileOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gallery_sharing_profile'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -685,6 +712,7 @@ def images(self): * 2020-12-01: :class:`ImagesOperations` * 2021-03-01: :class:`ImagesOperations` * 2021-04-01: :class:`ImagesOperations` + * 2021-07-01: :class:`ImagesOperations` """ api_version = self._get_api_version('images') if api_version == '2016-04-30-preview': @@ -713,6 +741,8 @@ def images(self): from ..v2021_03_01.aio.operations import ImagesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import ImagesOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -732,6 +762,7 @@ def log_analytics(self): * 2020-12-01: :class:`LogAnalyticsOperations` * 2021-03-01: :class:`LogAnalyticsOperations` * 2021-04-01: :class:`LogAnalyticsOperations` + * 2021-07-01: :class:`LogAnalyticsOperations` """ api_version = self._get_api_version('log_analytics') if api_version == '2017-12-01': @@ -756,6 +787,8 @@ def log_analytics(self): from ..v2021_03_01.aio.operations import LogAnalyticsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import LogAnalyticsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -775,6 +808,7 @@ def operations(self): * 2020-12-01: :class:`Operations` * 2021-03-01: :class:`Operations` * 2021-04-01: :class:`Operations` + * 2021-07-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-12-01': @@ -799,6 +833,8 @@ def operations(self): from ..v2021_03_01.aio.operations import Operations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import Operations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -817,6 +853,7 @@ def proximity_placement_groups(self): * 2020-12-01: :class:`ProximityPlacementGroupsOperations` * 2021-03-01: :class:`ProximityPlacementGroupsOperations` * 2021-04-01: :class:`ProximityPlacementGroupsOperations` + * 2021-07-01: :class:`ProximityPlacementGroupsOperations` """ api_version = self._get_api_version('proximity_placement_groups') if api_version == '2018-04-01': @@ -839,6 +876,8 @@ def proximity_placement_groups(self): from ..v2021_03_01.aio.operations import ProximityPlacementGroupsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import ProximityPlacementGroupsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -850,6 +889,7 @@ def resource_skus(self): * 2017-03-30: :class:`ResourceSkusOperations` * 2017-09-01: :class:`ResourceSkusOperations` * 2019-04-01: :class:`ResourceSkusOperations` + * 2021-07-01: :class:`ResourceSkusOperations` """ api_version = self._get_api_version('resource_skus') if api_version == '2017-03-30': @@ -858,6 +898,8 @@ def resource_skus(self): 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 + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -868,12 +910,15 @@ def restore_point_collections(self): * 2021-03-01: :class:`RestorePointCollectionsOperations` * 2021-04-01: :class:`RestorePointCollectionsOperations` + * 2021-07-01: :class:`RestorePointCollectionsOperations` """ api_version = self._get_api_version('restore_point_collections') if api_version == '2021-03-01': from ..v2021_03_01.aio.operations import RestorePointCollectionsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import RestorePointCollectionsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.operations import RestorePointCollectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'restore_point_collections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -884,12 +929,15 @@ def restore_points(self): * 2021-03-01: :class:`RestorePointsOperations` * 2021-04-01: :class:`RestorePointsOperations` + * 2021-07-01: :class:`RestorePointsOperations` """ api_version = self._get_api_version('restore_points') if api_version == '2021-03-01': from ..v2021_03_01.aio.operations import RestorePointsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import RestorePointsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.operations import RestorePointsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'restore_points'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -899,10 +947,13 @@ def shared_galleries(self): """Instance depends on the API version: * 2020-09-30: :class:`SharedGalleriesOperations` + * 2021-07-01: :class:`SharedGalleriesOperations` """ api_version = self._get_api_version('shared_galleries') if api_version == '2020-09-30': from ..v2020_09_30.aio.operations import SharedGalleriesOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.operations import SharedGalleriesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'shared_galleries'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -912,10 +963,13 @@ def shared_gallery_image_versions(self): """Instance depends on the API version: * 2020-09-30: :class:`SharedGalleryImageVersionsOperations` + * 2021-07-01: :class:`SharedGalleryImageVersionsOperations` """ api_version = self._get_api_version('shared_gallery_image_versions') if api_version == '2020-09-30': from ..v2020_09_30.aio.operations import SharedGalleryImageVersionsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.operations import SharedGalleryImageVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'shared_gallery_image_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -925,10 +979,13 @@ def shared_gallery_images(self): """Instance depends on the API version: * 2020-09-30: :class:`SharedGalleryImagesOperations` + * 2021-07-01: :class:`SharedGalleryImagesOperations` """ api_version = self._get_api_version('shared_gallery_images') if api_version == '2020-09-30': from ..v2020_09_30.aio.operations import SharedGalleryImagesOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.operations import SharedGalleryImagesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'shared_gallery_images'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -988,6 +1045,7 @@ def ssh_public_keys(self): * 2020-12-01: :class:`SshPublicKeysOperations` * 2021-03-01: :class:`SshPublicKeysOperations` * 2021-04-01: :class:`SshPublicKeysOperations` + * 2021-07-01: :class:`SshPublicKeysOperations` """ api_version = self._get_api_version('ssh_public_keys') if api_version == '2019-12-01': @@ -1000,6 +1058,8 @@ def ssh_public_keys(self): from ..v2021_03_01.aio.operations import SshPublicKeysOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import SshPublicKeysOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -1023,6 +1083,7 @@ def usage(self): * 2020-12-01: :class:`UsageOperations` * 2021-03-01: :class:`UsageOperations` * 2021-04-01: :class:`UsageOperations` + * 2021-07-01: :class:`UsageOperations` """ api_version = self._get_api_version('usage') if api_version == '2015-06-15': @@ -1055,6 +1116,8 @@ def usage(self): from ..v2021_03_01.aio.operations import UsageOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import UsageOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -1078,6 +1141,7 @@ def virtual_machine_extension_images(self): * 2020-12-01: :class:`VirtualMachineExtensionImagesOperations` * 2021-03-01: :class:`VirtualMachineExtensionImagesOperations` * 2021-04-01: :class:`VirtualMachineExtensionImagesOperations` + * 2021-07-01: :class:`VirtualMachineExtensionImagesOperations` """ api_version = self._get_api_version('virtual_machine_extension_images') if api_version == '2015-06-15': @@ -1110,6 +1174,8 @@ def virtual_machine_extension_images(self): from ..v2021_03_01.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import VirtualMachineExtensionImagesOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -1133,6 +1199,7 @@ def virtual_machine_extensions(self): * 2020-12-01: :class:`VirtualMachineExtensionsOperations` * 2021-03-01: :class:`VirtualMachineExtensionsOperations` * 2021-04-01: :class:`VirtualMachineExtensionsOperations` + * 2021-07-01: :class:`VirtualMachineExtensionsOperations` """ api_version = self._get_api_version('virtual_machine_extensions') if api_version == '2015-06-15': @@ -1165,6 +1232,8 @@ def virtual_machine_extensions(self): from ..v2021_03_01.aio.operations import VirtualMachineExtensionsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import VirtualMachineExtensionsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -1188,6 +1257,7 @@ def virtual_machine_images(self): * 2020-12-01: :class:`VirtualMachineImagesOperations` * 2021-03-01: :class:`VirtualMachineImagesOperations` * 2021-04-01: :class:`VirtualMachineImagesOperations` + * 2021-07-01: :class:`VirtualMachineImagesOperations` """ api_version = self._get_api_version('virtual_machine_images') if api_version == '2015-06-15': @@ -1220,6 +1290,8 @@ def virtual_machine_images(self): from ..v2021_03_01.aio.operations import VirtualMachineImagesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import VirtualMachineImagesOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -1231,6 +1303,7 @@ def virtual_machine_images_edge_zone(self): * 2020-12-01: :class:`VirtualMachineImagesEdgeZoneOperations` * 2021-03-01: :class:`VirtualMachineImagesEdgeZoneOperations` * 2021-04-01: :class:`VirtualMachineImagesEdgeZoneOperations` + * 2021-07-01: :class:`VirtualMachineImagesEdgeZoneOperations` """ api_version = self._get_api_version('virtual_machine_images_edge_zone') if api_version == '2020-12-01': @@ -1239,6 +1312,8 @@ def virtual_machine_images_edge_zone(self): from ..v2021_03_01.aio.operations import VirtualMachineImagesEdgeZoneOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import VirtualMachineImagesEdgeZoneOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.operations import VirtualMachineImagesEdgeZoneOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_machine_images_edge_zone'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1259,6 +1334,7 @@ def virtual_machine_run_commands(self): * 2020-12-01: :class:`VirtualMachineRunCommandsOperations` * 2021-03-01: :class:`VirtualMachineRunCommandsOperations` * 2021-04-01: :class:`VirtualMachineRunCommandsOperations` + * 2021-07-01: :class:`VirtualMachineRunCommandsOperations` """ api_version = self._get_api_version('virtual_machine_run_commands') if api_version == '2017-03-30': @@ -1285,6 +1361,8 @@ def virtual_machine_run_commands(self): from ..v2021_03_01.aio.operations import VirtualMachineRunCommandsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import VirtualMachineRunCommandsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -1305,6 +1383,7 @@ def virtual_machine_scale_set_extensions(self): * 2020-12-01: :class:`VirtualMachineScaleSetExtensionsOperations` * 2021-03-01: :class:`VirtualMachineScaleSetExtensionsOperations` * 2021-04-01: :class:`VirtualMachineScaleSetExtensionsOperations` + * 2021-07-01: :class:`VirtualMachineScaleSetExtensionsOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_extensions') if api_version == '2017-03-30': @@ -1331,6 +1410,8 @@ def virtual_machine_scale_set_extensions(self): from ..v2021_03_01.aio.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import VirtualMachineScaleSetExtensionsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -1351,6 +1432,7 @@ def virtual_machine_scale_set_rolling_upgrades(self): * 2020-12-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` * 2021-03-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` * 2021-04-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` + * 2021-07-01: :class:`VirtualMachineScaleSetRollingUpgradesOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_rolling_upgrades') if api_version == '2017-03-30': @@ -1377,6 +1459,8 @@ def virtual_machine_scale_set_rolling_upgrades(self): from ..v2021_03_01.aio.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import VirtualMachineScaleSetRollingUpgradesOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -1391,6 +1475,7 @@ def virtual_machine_scale_set_vm_extensions(self): * 2020-12-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` * 2021-03-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` * 2021-04-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` + * 2021-07-01: :class:`VirtualMachineScaleSetVMExtensionsOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_vm_extensions') if api_version == '2019-07-01': @@ -1405,6 +1490,8 @@ def virtual_machine_scale_set_vm_extensions(self): from ..v2021_03_01.aio.operations import VirtualMachineScaleSetVMExtensionsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import VirtualMachineScaleSetVMExtensionsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -1417,6 +1504,7 @@ def virtual_machine_scale_set_vm_run_commands(self): * 2020-12-01: :class:`VirtualMachineScaleSetVMRunCommandsOperations` * 2021-03-01: :class:`VirtualMachineScaleSetVMRunCommandsOperations` * 2021-04-01: :class:`VirtualMachineScaleSetVMRunCommandsOperations` + * 2021-07-01: :class:`VirtualMachineScaleSetVMRunCommandsOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_vm_run_commands') if api_version == '2020-06-01': @@ -1427,6 +1515,8 @@ def virtual_machine_scale_set_vm_run_commands(self): from ..v2021_03_01.aio.operations import VirtualMachineScaleSetVMRunCommandsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import VirtualMachineScaleSetVMRunCommandsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.operations import VirtualMachineScaleSetVMRunCommandsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_vm_run_commands'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1450,6 +1540,7 @@ def virtual_machine_scale_set_vms(self): * 2020-12-01: :class:`VirtualMachineScaleSetVMsOperations` * 2021-03-01: :class:`VirtualMachineScaleSetVMsOperations` * 2021-04-01: :class:`VirtualMachineScaleSetVMsOperations` + * 2021-07-01: :class:`VirtualMachineScaleSetVMsOperations` """ api_version = self._get_api_version('virtual_machine_scale_set_vms') if api_version == '2015-06-15': @@ -1482,6 +1573,8 @@ def virtual_machine_scale_set_vms(self): from ..v2021_03_01.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import VirtualMachineScaleSetVMsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -1505,6 +1598,7 @@ def virtual_machine_scale_sets(self): * 2020-12-01: :class:`VirtualMachineScaleSetsOperations` * 2021-03-01: :class:`VirtualMachineScaleSetsOperations` * 2021-04-01: :class:`VirtualMachineScaleSetsOperations` + * 2021-07-01: :class:`VirtualMachineScaleSetsOperations` """ api_version = self._get_api_version('virtual_machine_scale_sets') if api_version == '2015-06-15': @@ -1537,6 +1631,8 @@ def virtual_machine_scale_sets(self): from ..v2021_03_01.aio.operations import VirtualMachineScaleSetsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import VirtualMachineScaleSetsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -1560,6 +1656,7 @@ def virtual_machine_sizes(self): * 2020-12-01: :class:`VirtualMachineSizesOperations` * 2021-03-01: :class:`VirtualMachineSizesOperations` * 2021-04-01: :class:`VirtualMachineSizesOperations` + * 2021-07-01: :class:`VirtualMachineSizesOperations` """ api_version = self._get_api_version('virtual_machine_sizes') if api_version == '2015-06-15': @@ -1592,6 +1689,8 @@ def virtual_machine_sizes(self): from ..v2021_03_01.aio.operations import VirtualMachineSizesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import VirtualMachineSizesOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) @@ -1615,6 +1714,7 @@ def virtual_machines(self): * 2020-12-01: :class:`VirtualMachinesOperations` * 2021-03-01: :class:`VirtualMachinesOperations` * 2021-04-01: :class:`VirtualMachinesOperations` + * 2021-07-01: :class:`VirtualMachinesOperations` """ api_version = self._get_api_version('virtual_machines') if api_version == '2015-06-15': @@ -1647,6 +1747,8 @@ def virtual_machines(self): from ..v2021_03_01.aio.operations import VirtualMachinesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import VirtualMachinesOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_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))) 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 566bdc9653bf..df5a5a23991b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py @@ -4,8 +4,6 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from .v2019_04_01.models import * -from .v2020_09_30.models import * from .v2020_12_01.models import * from .v2021_03_01.models import * -from .v2021_04_01.models import * +from .v2021_07_01.models import * diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models.py index becc646c7cc3..7aaf0d22ba00 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models.py @@ -3709,7 +3709,11 @@ class OSProfile(msrest.serialization.Model): `_. :type linux_configuration: ~azure.mgmt.compute.v2021_03_01.models.LinuxConfiguration :param secrets: Specifies set of certificates that should be installed onto the virtual - machine. + machine. To install certificates on a virtual machine it is recommended to use the `Azure Key + Vault virtual machine extension for Linux + `_ or the `Azure + Key Vault virtual machine extension for Windows + `_. :type secrets: list[~azure.mgmt.compute.v2021_03_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 @@ -6354,8 +6358,12 @@ class VaultCertificate(msrest.serialization.Model): `_. 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:`
`}. + "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` + "password":":code:``":code:`
`} :code:`
` To install certificates on a + virtual machine it is recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ or the + `Azure Key Vault virtual machine extension for Windows + `_. :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 @@ -9232,7 +9240,11 @@ class VirtualMachineScaleSetOSProfile(msrest.serialization.Model): `_. :type linux_configuration: ~azure.mgmt.compute.v2021_03_01.models.LinuxConfiguration :param secrets: Specifies set of certificates that should be installed onto the virtual - machines in the scale set. + machines in the scale set. To install certificates on a virtual machine it is recommended to + use the `Azure Key Vault virtual machine extension for Linux + `_ or the `Azure + Key Vault virtual machine extension for Windows + `_. :type secrets: list[~azure.mgmt.compute.v2021_03_01.models.VaultSecretGroup] """ @@ -11097,8 +11109,12 @@ class WinRMListener(msrest.serialization.Model): `_. 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:`
`}. + "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` + "password":":code:``":code:`
`} :code:`
` To install certificates on a + virtual machine it is recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ or the + `Azure Key Vault virtual machine extension for Windows + `_. :type certificate_url: str """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models_py3.py index f126881ef2a5..4263e8291154 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models_py3.py @@ -4061,7 +4061,11 @@ class OSProfile(msrest.serialization.Model): `_. :type linux_configuration: ~azure.mgmt.compute.v2021_03_01.models.LinuxConfiguration :param secrets: Specifies set of certificates that should be installed onto the virtual - machine. + machine. To install certificates on a virtual machine it is recommended to use the `Azure Key + Vault virtual machine extension for Linux + `_ or the `Azure + Key Vault virtual machine extension for Windows + `_. :type secrets: list[~azure.mgmt.compute.v2021_03_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 @@ -6924,8 +6928,12 @@ class VaultCertificate(msrest.serialization.Model): `_. 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:`
`}. + "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` + "password":":code:``":code:`
`} :code:`
` To install certificates on a + virtual machine it is recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ or the + `Azure Key Vault virtual machine extension for Windows + `_. :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 @@ -10138,7 +10146,11 @@ class VirtualMachineScaleSetOSProfile(msrest.serialization.Model): `_. :type linux_configuration: ~azure.mgmt.compute.v2021_03_01.models.LinuxConfiguration :param secrets: Specifies set of certificates that should be installed onto the virtual - machines in the scale set. + machines in the scale set. To install certificates on a virtual machine it is recommended to + use the `Azure Key Vault virtual machine extension for Linux + `_ or the `Azure + Key Vault virtual machine extension for Windows + `_. :type secrets: list[~azure.mgmt.compute.v2021_03_01.models.VaultSecretGroup] """ @@ -12227,8 +12239,12 @@ class WinRMListener(msrest.serialization.Model): `_. 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:`
`}. + "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` + "password":":code:``":code:`
`} :code:`
` To install certificates on a + virtual machine it is recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ or the + `Azure Key Vault virtual machine extension for Windows + `_. :type certificate_url: str """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py index 749f47dd19fd..ef35ba89b90b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "22.1.0" +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models.py index 4ffb9693e668..a5df883fa67a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models.py @@ -3229,7 +3229,11 @@ class OSProfile(msrest.serialization.Model): `_. :type linux_configuration: ~azure.mgmt.compute.v2021_04_01.models.LinuxConfiguration :param secrets: Specifies set of certificates that should be installed onto the virtual - machine. + machine. To install certificates on a virtual machine it is recommended to use the `Azure Key + Vault virtual machine extension for Linux + `_ or the `Azure + Key Vault virtual machine extension for Windows + `_. :type secrets: list[~azure.mgmt.compute.v2021_04_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 @@ -5405,7 +5409,11 @@ class VaultCertificate(msrest.serialization.Model): 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:`
`}. + "password":":code:``":code:`
`} :code:`
` To install certificates on a + virtual machine it is recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ or the + `Azure Key Vault virtual machine extension for Windows + `_. :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 @@ -7277,7 +7285,9 @@ class VirtualMachineScaleSet(Resource): 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. + in case there is zone outage. zoneBalance property can only be set if the zones property of the + scale set contains more than one zone. If there are no zones or only one zone specified, then + zoneBalance property should not be set. :type zone_balance: bool :param platform_fault_domain_count: Fault Domain count for each placement group. :type platform_fault_domain_count: int @@ -8292,7 +8302,11 @@ class VirtualMachineScaleSetOSProfile(msrest.serialization.Model): `_. :type linux_configuration: ~azure.mgmt.compute.v2021_04_01.models.LinuxConfiguration :param secrets: Specifies set of certificates that should be installed onto the virtual - machines in the scale set. + machines in the scale set. To install certificates on a virtual machine it is recommended to + use the `Azure Key Vault virtual machine extension for Linux + `_ or the `Azure + Key Vault virtual machine extension for Windows + `_. :type secrets: list[~azure.mgmt.compute.v2021_04_01.models.VaultSecretGroup] """ @@ -10168,7 +10182,11 @@ class WinRMListener(msrest.serialization.Model): 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:`
`}. + "password":":code:``":code:`
`} :code:`
` To install certificates on a + virtual machine it is recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ or the + `Azure Key Vault virtual machine extension for Windows + `_. :type certificate_url: str """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models_py3.py index 318c29e245dc..2f30e361a8af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models_py3.py @@ -3526,7 +3526,11 @@ class OSProfile(msrest.serialization.Model): `_. :type linux_configuration: ~azure.mgmt.compute.v2021_04_01.models.LinuxConfiguration :param secrets: Specifies set of certificates that should be installed onto the virtual - machine. + machine. To install certificates on a virtual machine it is recommended to use the `Azure Key + Vault virtual machine extension for Linux + `_ or the `Azure + Key Vault virtual machine extension for Windows + `_. :type secrets: list[~azure.mgmt.compute.v2021_04_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 @@ -5902,7 +5906,11 @@ class VaultCertificate(msrest.serialization.Model): 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:`
`}. + "password":":code:``":code:`
`} :code:`
` To install certificates on a + virtual machine it is recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ or the + `Azure Key Vault virtual machine extension for Windows + `_. :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 @@ -7991,7 +7999,9 @@ class VirtualMachineScaleSet(Resource): 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. + in case there is zone outage. zoneBalance property can only be set if the zones property of the + scale set contains more than one zone. If there are no zones or only one zone specified, then + zoneBalance property should not be set. :type zone_balance: bool :param platform_fault_domain_count: Fault Domain count for each placement group. :type platform_fault_domain_count: int @@ -9127,7 +9137,11 @@ class VirtualMachineScaleSetOSProfile(msrest.serialization.Model): `_. :type linux_configuration: ~azure.mgmt.compute.v2021_04_01.models.LinuxConfiguration :param secrets: Specifies set of certificates that should be installed onto the virtual - machines in the scale set. + machines in the scale set. To install certificates on a virtual machine it is recommended to + use the `Azure Key Vault virtual machine extension for Linux + `_ or the `Azure + Key Vault virtual machine extension for Windows + `_. :type secrets: list[~azure.mgmt.compute.v2021_04_01.models.VaultSecretGroup] """ @@ -11229,7 +11243,11 @@ class WinRMListener(msrest.serialization.Model): 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:`
`}. + "password":":code:``":code:`
`} :code:`
` To install certificates on a + virtual machine it is recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ or the + `Azure Key Vault virtual machine extension for Windows + `_. :type certificate_url: str """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/__init__.py new file mode 100644 index 000000000000..da8181c02bd2 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/__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 ._compute_management_client import ComputeManagementClient +from ._version import VERSION + +__version__ = VERSION +__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/v2021_07_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_compute_management_client.py new file mode 100644 index 000000000000..898fdd411115 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_compute_management_client.py @@ -0,0 +1,264 @@ +# 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 azure.core.pipeline.transport import HttpRequest, HttpResponse + +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 VirtualMachineImagesEdgeZoneOperations +from .operations import UsageOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineSizesOperations +from .operations import ImagesOperations +from .operations import RestorePointCollectionsOperations +from .operations import RestorePointsOperations +from .operations import CapacityReservationGroupsOperations +from .operations import CapacityReservationsOperations +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 VirtualMachineScaleSetVMRunCommandsOperations +from .operations import ResourceSkusOperations +from .operations import GalleriesOperations +from .operations import GalleryImagesOperations +from .operations import GalleryImageVersionsOperations +from .operations import GalleryApplicationsOperations +from .operations import GalleryApplicationVersionsOperations +from .operations import GallerySharingProfileOperations +from .operations import SharedGalleriesOperations +from .operations import SharedGalleryImagesOperations +from .operations import SharedGalleryImageVersionsOperations +from . import models + + +class ComputeManagementClient(object): + """Compute Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.compute.v2021_07_01.operations.Operations + :ivar availability_sets: AvailabilitySetsOperations operations + :vartype availability_sets: azure.mgmt.compute.v2021_07_01.operations.AvailabilitySetsOperations + :ivar proximity_placement_groups: ProximityPlacementGroupsOperations operations + :vartype proximity_placement_groups: azure.mgmt.compute.v2021_07_01.operations.ProximityPlacementGroupsOperations + :ivar dedicated_host_groups: DedicatedHostGroupsOperations operations + :vartype dedicated_host_groups: azure.mgmt.compute.v2021_07_01.operations.DedicatedHostGroupsOperations + :ivar dedicated_hosts: DedicatedHostsOperations operations + :vartype dedicated_hosts: azure.mgmt.compute.v2021_07_01.operations.DedicatedHostsOperations + :ivar ssh_public_keys: SshPublicKeysOperations operations + :vartype ssh_public_keys: azure.mgmt.compute.v2021_07_01.operations.SshPublicKeysOperations + :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2021_07_01.operations.VirtualMachineExtensionImagesOperations + :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2021_07_01.operations.VirtualMachineExtensionsOperations + :ivar virtual_machine_images: VirtualMachineImagesOperations operations + :vartype virtual_machine_images: azure.mgmt.compute.v2021_07_01.operations.VirtualMachineImagesOperations + :ivar virtual_machine_images_edge_zone: VirtualMachineImagesEdgeZoneOperations operations + :vartype virtual_machine_images_edge_zone: azure.mgmt.compute.v2021_07_01.operations.VirtualMachineImagesEdgeZoneOperations + :ivar usage: UsageOperations operations + :vartype usage: azure.mgmt.compute.v2021_07_01.operations.UsageOperations + :ivar virtual_machines: VirtualMachinesOperations operations + :vartype virtual_machines: azure.mgmt.compute.v2021_07_01.operations.VirtualMachinesOperations + :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2021_07_01.operations.VirtualMachineScaleSetsOperations + :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2021_07_01.operations.VirtualMachineSizesOperations + :ivar images: ImagesOperations operations + :vartype images: azure.mgmt.compute.v2021_07_01.operations.ImagesOperations + :ivar restore_point_collections: RestorePointCollectionsOperations operations + :vartype restore_point_collections: azure.mgmt.compute.v2021_07_01.operations.RestorePointCollectionsOperations + :ivar restore_points: RestorePointsOperations operations + :vartype restore_points: azure.mgmt.compute.v2021_07_01.operations.RestorePointsOperations + :ivar capacity_reservation_groups: CapacityReservationGroupsOperations operations + :vartype capacity_reservation_groups: azure.mgmt.compute.v2021_07_01.operations.CapacityReservationGroupsOperations + :ivar capacity_reservations: CapacityReservationsOperations operations + :vartype capacity_reservations: azure.mgmt.compute.v2021_07_01.operations.CapacityReservationsOperations + :ivar virtual_machine_scale_set_extensions: VirtualMachineScaleSetExtensionsOperations operations + :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2021_07_01.operations.VirtualMachineScaleSetExtensionsOperations + :ivar virtual_machine_scale_set_rolling_upgrades: VirtualMachineScaleSetRollingUpgradesOperations operations + :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2021_07_01.operations.VirtualMachineScaleSetRollingUpgradesOperations + :ivar virtual_machine_scale_set_vm_extensions: VirtualMachineScaleSetVMExtensionsOperations operations + :vartype virtual_machine_scale_set_vm_extensions: azure.mgmt.compute.v2021_07_01.operations.VirtualMachineScaleSetVMExtensionsOperations + :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2021_07_01.operations.VirtualMachineScaleSetVMsOperations + :ivar log_analytics: LogAnalyticsOperations operations + :vartype log_analytics: azure.mgmt.compute.v2021_07_01.operations.LogAnalyticsOperations + :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations + :vartype virtual_machine_run_commands: azure.mgmt.compute.v2021_07_01.operations.VirtualMachineRunCommandsOperations + :ivar virtual_machine_scale_set_vm_run_commands: VirtualMachineScaleSetVMRunCommandsOperations operations + :vartype virtual_machine_scale_set_vm_run_commands: azure.mgmt.compute.v2021_07_01.operations.VirtualMachineScaleSetVMRunCommandsOperations + :ivar resource_skus: ResourceSkusOperations operations + :vartype resource_skus: azure.mgmt.compute.v2021_07_01.operations.ResourceSkusOperations + :ivar galleries: GalleriesOperations operations + :vartype galleries: azure.mgmt.compute.v2021_07_01.operations.GalleriesOperations + :ivar gallery_images: GalleryImagesOperations operations + :vartype gallery_images: azure.mgmt.compute.v2021_07_01.operations.GalleryImagesOperations + :ivar gallery_image_versions: GalleryImageVersionsOperations operations + :vartype gallery_image_versions: azure.mgmt.compute.v2021_07_01.operations.GalleryImageVersionsOperations + :ivar gallery_applications: GalleryApplicationsOperations operations + :vartype gallery_applications: azure.mgmt.compute.v2021_07_01.operations.GalleryApplicationsOperations + :ivar gallery_application_versions: GalleryApplicationVersionsOperations operations + :vartype gallery_application_versions: azure.mgmt.compute.v2021_07_01.operations.GalleryApplicationVersionsOperations + :ivar gallery_sharing_profile: GallerySharingProfileOperations operations + :vartype gallery_sharing_profile: azure.mgmt.compute.v2021_07_01.operations.GallerySharingProfileOperations + :ivar shared_galleries: SharedGalleriesOperations operations + :vartype shared_galleries: azure.mgmt.compute.v2021_07_01.operations.SharedGalleriesOperations + :ivar shared_gallery_images: SharedGalleryImagesOperations operations + :vartype shared_gallery_images: azure.mgmt.compute.v2021_07_01.operations.SharedGalleryImagesOperations + :ivar shared_gallery_image_versions: SharedGalleryImageVersionsOperations operations + :vartype shared_gallery_image_versions: azure.mgmt.compute.v2021_07_01.operations.SharedGalleryImageVersionsOperations + :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.virtual_machine_images_edge_zone = VirtualMachineImagesEdgeZoneOperations( + 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_scale_sets = VirtualMachineScaleSetsOperations( + 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.restore_point_collections = RestorePointCollectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.restore_points = RestorePointsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.capacity_reservation_groups = CapacityReservationGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.capacity_reservations = CapacityReservationsOperations( + 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) + self.virtual_machine_scale_set_vm_run_commands = VirtualMachineScaleSetVMRunCommandsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_skus = ResourceSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.galleries = GalleriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_images = GalleryImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_image_versions = GalleryImageVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_applications = GalleryApplicationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_application_versions = GalleryApplicationVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_sharing_profile = GallerySharingProfileOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shared_galleries = SharedGalleriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shared_gallery_images = SharedGalleryImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shared_gallery_image_versions = SharedGalleryImageVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + 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/v2021_07_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_configuration.py new file mode 100644 index 000000000000..52e39da71b59 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_configuration.py @@ -0,0 +1,71 @@ +# 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 + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +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 = "2021-07-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/v2021_07_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json new file mode 100644 index 000000000000..4924069df4a9 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json @@ -0,0 +1,138 @@ +{ + "chosen_version": "2021-07-01", + "total_api_version_list": ["2021-07-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, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ComputeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ComputeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "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": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: 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", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "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, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "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", + "virtual_machine_images_edge_zone": "VirtualMachineImagesEdgeZoneOperations", + "usage": "UsageOperations", + "virtual_machines": "VirtualMachinesOperations", + "virtual_machine_scale_sets": "VirtualMachineScaleSetsOperations", + "virtual_machine_sizes": "VirtualMachineSizesOperations", + "images": "ImagesOperations", + "restore_point_collections": "RestorePointCollectionsOperations", + "restore_points": "RestorePointsOperations", + "capacity_reservation_groups": "CapacityReservationGroupsOperations", + "capacity_reservations": "CapacityReservationsOperations", + "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", + "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations", + "resource_skus": "ResourceSkusOperations", + "galleries": "GalleriesOperations", + "gallery_images": "GalleryImagesOperations", + "gallery_image_versions": "GalleryImageVersionsOperations", + "gallery_applications": "GalleryApplicationsOperations", + "gallery_application_versions": "GalleryApplicationVersionsOperations", + "gallery_sharing_profile": "GallerySharingProfileOperations", + "shared_galleries": "SharedGalleriesOperations", + "shared_gallery_images": "SharedGalleryImagesOperations", + "shared_gallery_image_versions": "SharedGalleryImageVersionsOperations" + } +} \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py new file mode 100644 index 000000000000..ef35ba89b90b --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "23.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/__init__.py new file mode 100644 index 000000000000..9e9459635989 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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/v2021_07_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_compute_management_client.py new file mode 100644 index 000000000000..dec712c9afd2 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_compute_management_client.py @@ -0,0 +1,257 @@ +# 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.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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 VirtualMachineImagesEdgeZoneOperations +from .operations import UsageOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineScaleSetsOperations +from .operations import VirtualMachineSizesOperations +from .operations import ImagesOperations +from .operations import RestorePointCollectionsOperations +from .operations import RestorePointsOperations +from .operations import CapacityReservationGroupsOperations +from .operations import CapacityReservationsOperations +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 VirtualMachineScaleSetVMRunCommandsOperations +from .operations import ResourceSkusOperations +from .operations import GalleriesOperations +from .operations import GalleryImagesOperations +from .operations import GalleryImageVersionsOperations +from .operations import GalleryApplicationsOperations +from .operations import GalleryApplicationVersionsOperations +from .operations import GallerySharingProfileOperations +from .operations import SharedGalleriesOperations +from .operations import SharedGalleryImagesOperations +from .operations import SharedGalleryImageVersionsOperations +from .. import models + + +class ComputeManagementClient(object): + """Compute Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.compute.v2021_07_01.aio.operations.Operations + :ivar availability_sets: AvailabilitySetsOperations operations + :vartype availability_sets: azure.mgmt.compute.v2021_07_01.aio.operations.AvailabilitySetsOperations + :ivar proximity_placement_groups: ProximityPlacementGroupsOperations operations + :vartype proximity_placement_groups: azure.mgmt.compute.v2021_07_01.aio.operations.ProximityPlacementGroupsOperations + :ivar dedicated_host_groups: DedicatedHostGroupsOperations operations + :vartype dedicated_host_groups: azure.mgmt.compute.v2021_07_01.aio.operations.DedicatedHostGroupsOperations + :ivar dedicated_hosts: DedicatedHostsOperations operations + :vartype dedicated_hosts: azure.mgmt.compute.v2021_07_01.aio.operations.DedicatedHostsOperations + :ivar ssh_public_keys: SshPublicKeysOperations operations + :vartype ssh_public_keys: azure.mgmt.compute.v2021_07_01.aio.operations.SshPublicKeysOperations + :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2021_07_01.aio.operations.VirtualMachineExtensionImagesOperations + :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations + :vartype virtual_machine_extensions: azure.mgmt.compute.v2021_07_01.aio.operations.VirtualMachineExtensionsOperations + :ivar virtual_machine_images: VirtualMachineImagesOperations operations + :vartype virtual_machine_images: azure.mgmt.compute.v2021_07_01.aio.operations.VirtualMachineImagesOperations + :ivar virtual_machine_images_edge_zone: VirtualMachineImagesEdgeZoneOperations operations + :vartype virtual_machine_images_edge_zone: azure.mgmt.compute.v2021_07_01.aio.operations.VirtualMachineImagesEdgeZoneOperations + :ivar usage: UsageOperations operations + :vartype usage: azure.mgmt.compute.v2021_07_01.aio.operations.UsageOperations + :ivar virtual_machines: VirtualMachinesOperations operations + :vartype virtual_machines: azure.mgmt.compute.v2021_07_01.aio.operations.VirtualMachinesOperations + :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2021_07_01.aio.operations.VirtualMachineScaleSetsOperations + :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations + :vartype virtual_machine_sizes: azure.mgmt.compute.v2021_07_01.aio.operations.VirtualMachineSizesOperations + :ivar images: ImagesOperations operations + :vartype images: azure.mgmt.compute.v2021_07_01.aio.operations.ImagesOperations + :ivar restore_point_collections: RestorePointCollectionsOperations operations + :vartype restore_point_collections: azure.mgmt.compute.v2021_07_01.aio.operations.RestorePointCollectionsOperations + :ivar restore_points: RestorePointsOperations operations + :vartype restore_points: azure.mgmt.compute.v2021_07_01.aio.operations.RestorePointsOperations + :ivar capacity_reservation_groups: CapacityReservationGroupsOperations operations + :vartype capacity_reservation_groups: azure.mgmt.compute.v2021_07_01.aio.operations.CapacityReservationGroupsOperations + :ivar capacity_reservations: CapacityReservationsOperations operations + :vartype capacity_reservations: azure.mgmt.compute.v2021_07_01.aio.operations.CapacityReservationsOperations + :ivar virtual_machine_scale_set_extensions: VirtualMachineScaleSetExtensionsOperations operations + :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2021_07_01.aio.operations.VirtualMachineScaleSetExtensionsOperations + :ivar virtual_machine_scale_set_rolling_upgrades: VirtualMachineScaleSetRollingUpgradesOperations operations + :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2021_07_01.aio.operations.VirtualMachineScaleSetRollingUpgradesOperations + :ivar virtual_machine_scale_set_vm_extensions: VirtualMachineScaleSetVMExtensionsOperations operations + :vartype virtual_machine_scale_set_vm_extensions: azure.mgmt.compute.v2021_07_01.aio.operations.VirtualMachineScaleSetVMExtensionsOperations + :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2021_07_01.aio.operations.VirtualMachineScaleSetVMsOperations + :ivar log_analytics: LogAnalyticsOperations operations + :vartype log_analytics: azure.mgmt.compute.v2021_07_01.aio.operations.LogAnalyticsOperations + :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations + :vartype virtual_machine_run_commands: azure.mgmt.compute.v2021_07_01.aio.operations.VirtualMachineRunCommandsOperations + :ivar virtual_machine_scale_set_vm_run_commands: VirtualMachineScaleSetVMRunCommandsOperations operations + :vartype virtual_machine_scale_set_vm_run_commands: azure.mgmt.compute.v2021_07_01.aio.operations.VirtualMachineScaleSetVMRunCommandsOperations + :ivar resource_skus: ResourceSkusOperations operations + :vartype resource_skus: azure.mgmt.compute.v2021_07_01.aio.operations.ResourceSkusOperations + :ivar galleries: GalleriesOperations operations + :vartype galleries: azure.mgmt.compute.v2021_07_01.aio.operations.GalleriesOperations + :ivar gallery_images: GalleryImagesOperations operations + :vartype gallery_images: azure.mgmt.compute.v2021_07_01.aio.operations.GalleryImagesOperations + :ivar gallery_image_versions: GalleryImageVersionsOperations operations + :vartype gallery_image_versions: azure.mgmt.compute.v2021_07_01.aio.operations.GalleryImageVersionsOperations + :ivar gallery_applications: GalleryApplicationsOperations operations + :vartype gallery_applications: azure.mgmt.compute.v2021_07_01.aio.operations.GalleryApplicationsOperations + :ivar gallery_application_versions: GalleryApplicationVersionsOperations operations + :vartype gallery_application_versions: azure.mgmt.compute.v2021_07_01.aio.operations.GalleryApplicationVersionsOperations + :ivar gallery_sharing_profile: GallerySharingProfileOperations operations + :vartype gallery_sharing_profile: azure.mgmt.compute.v2021_07_01.aio.operations.GallerySharingProfileOperations + :ivar shared_galleries: SharedGalleriesOperations operations + :vartype shared_galleries: azure.mgmt.compute.v2021_07_01.aio.operations.SharedGalleriesOperations + :ivar shared_gallery_images: SharedGalleryImagesOperations operations + :vartype shared_gallery_images: azure.mgmt.compute.v2021_07_01.aio.operations.SharedGalleryImagesOperations + :ivar shared_gallery_image_versions: SharedGalleryImageVersionsOperations operations + :vartype shared_gallery_image_versions: azure.mgmt.compute.v2021_07_01.aio.operations.SharedGalleryImageVersionsOperations + :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.virtual_machine_images_edge_zone = VirtualMachineImagesEdgeZoneOperations( + 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_scale_sets = VirtualMachineScaleSetsOperations( + 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.restore_point_collections = RestorePointCollectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.restore_points = RestorePointsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.capacity_reservation_groups = CapacityReservationGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.capacity_reservations = CapacityReservationsOperations( + 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) + self.virtual_machine_scale_set_vm_run_commands = VirtualMachineScaleSetVMRunCommandsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_skus = ResourceSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.galleries = GalleriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_images = GalleryImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_image_versions = GalleryImageVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_applications = GalleryApplicationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_application_versions = GalleryApplicationVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_sharing_profile = GallerySharingProfileOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shared_galleries = SharedGalleriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shared_gallery_images = SharedGalleryImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shared_gallery_image_versions = SharedGalleryImageVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + 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/v2021_07_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_configuration.py new file mode 100644 index 000000000000..cbb34c44a751 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_configuration.py @@ -0,0 +1,67 @@ +# 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 + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +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 = "2021-07-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/v2021_07_01/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/__init__.py new file mode 100644 index 000000000000..af63734f01ef --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/__init__.py @@ -0,0 +1,83 @@ +# 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 ._virtual_machine_images_edge_zone_operations import VirtualMachineImagesEdgeZoneOperations +from ._usage_operations import UsageOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._images_operations import ImagesOperations +from ._restore_point_collections_operations import RestorePointCollectionsOperations +from ._restore_points_operations import RestorePointsOperations +from ._capacity_reservation_groups_operations import CapacityReservationGroupsOperations +from ._capacity_reservations_operations import CapacityReservationsOperations +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 ._virtual_machine_scale_set_vm_run_commands_operations import VirtualMachineScaleSetVMRunCommandsOperations +from ._resource_skus_operations import ResourceSkusOperations +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 ._gallery_sharing_profile_operations import GallerySharingProfileOperations +from ._shared_galleries_operations import SharedGalleriesOperations +from ._shared_gallery_images_operations import SharedGalleryImagesOperations +from ._shared_gallery_image_versions_operations import SharedGalleryImageVersionsOperations + +__all__ = [ + 'Operations', + 'AvailabilitySetsOperations', + 'ProximityPlacementGroupsOperations', + 'DedicatedHostGroupsOperations', + 'DedicatedHostsOperations', + 'SshPublicKeysOperations', + 'VirtualMachineExtensionImagesOperations', + 'VirtualMachineExtensionsOperations', + 'VirtualMachineImagesOperations', + 'VirtualMachineImagesEdgeZoneOperations', + 'UsageOperations', + 'VirtualMachinesOperations', + 'VirtualMachineScaleSetsOperations', + 'VirtualMachineSizesOperations', + 'ImagesOperations', + 'RestorePointCollectionsOperations', + 'RestorePointsOperations', + 'CapacityReservationGroupsOperations', + 'CapacityReservationsOperations', + 'VirtualMachineScaleSetExtensionsOperations', + 'VirtualMachineScaleSetRollingUpgradesOperations', + 'VirtualMachineScaleSetVMExtensionsOperations', + 'VirtualMachineScaleSetVMsOperations', + 'LogAnalyticsOperations', + 'VirtualMachineRunCommandsOperations', + 'VirtualMachineScaleSetVMRunCommandsOperations', + 'ResourceSkusOperations', + 'GalleriesOperations', + 'GalleryImagesOperations', + 'GalleryImageVersionsOperations', + 'GalleryApplicationsOperations', + 'GalleryApplicationVersionsOperations', + 'GallerySharingProfileOperations', + 'SharedGalleriesOperations', + 'SharedGalleryImagesOperations', + 'SharedGalleryImageVersionsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_availability_sets_operations.py new file mode 100644 index 000000000000..c27ba7dcb282 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _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.v2021_07_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: Any + ) -> "_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.v2021_07_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.v2021_07_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 = "2021-07-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: Any + ) -> "_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.v2021_07_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.v2021_07_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 = "2021-07-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: Any + ) -> 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 = "2021-07-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: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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/v2021_07_01/aio/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservation_groups_operations.py new file mode 100644 index 000000000000..77098cdfd6a6 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservation_groups_operations.py @@ -0,0 +1,457 @@ +# 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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CapacityReservationGroupsOperations: + """CapacityReservationGroupsOperations 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.v2021_07_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, + capacity_reservation_group_name: str, + parameters: "_models.CapacityReservationGroup", + **kwargs: Any + ) -> "_models.CapacityReservationGroup": + """The operation to create or update a capacity reservation group. When updating a capacity + reservation group, only tags may be modified. Please refer to + https://aka.ms/CapacityReservation for more details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param parameters: Parameters supplied to the Create capacity reservation Group. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CapacityReservationGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_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, 'CapacityReservationGroup') + 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('CapacityReservationGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + capacity_reservation_group_name: str, + parameters: "_models.CapacityReservationGroupUpdate", + **kwargs: Any + ) -> "_models.CapacityReservationGroup": + """The operation to update a capacity reservation group. When updating a capacity reservation + group, only tags may be modified. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param parameters: Parameters supplied to the Update capacity reservation Group operation. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroupUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CapacityReservationGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_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, 'CapacityReservationGroupUpdate') + 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('CapacityReservationGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + capacity_reservation_group_name: str, + **kwargs: Any + ) -> None: + """The operation to delete a capacity reservation group. This operation is allowed only if all the + associated resources are disassociated from the reservation group and all capacity reservations + under the reservation group have also been deleted. Please refer to + https://aka.ms/CapacityReservation for more details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_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 = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_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['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, 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/capacityReservationGroups/{capacityReservationGroupName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + capacity_reservation_group_name: str, + expand: Optional[Union[str, "_models.CapacityReservationGroupInstanceViewTypes"]] = None, + **kwargs: Any + ) -> "_models.CapacityReservationGroup": + """The operation that retrieves information about a capacity reservation group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param expand: The expand expression to apply on the operation. 'InstanceView' will retrieve + the list of instance views of the capacity reservations under the capacity reservation group + which is a snapshot of the runtime properties of a capacity reservation that is managed by the + platform and can change outside of control plane operations. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroupInstanceViewTypes + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CapacityReservationGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_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('CapacityReservationGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + expand: Optional[Union[str, "_models.ExpandTypesForGetCapacityReservationGroups"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.CapacityReservationGroupListResult"]: + """Lists all of the capacity reservation groups in the specified resource group. Use the nextLink + property in the response to get the next page of capacity reservation groups. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param expand: The expand expression to apply on the operation. Based on the expand param(s) + specified we return Virtual Machine or ScaleSet VM Instance or both resource Ids which are + associated to capacity reservation group in the response. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.ExpandTypesForGetCapacityReservationGroups + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CapacityReservationGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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') + 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('CapacityReservationGroupListResult', 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/capacityReservationGroups'} # type: ignore + + def list_by_subscription( + self, + expand: Optional[Union[str, "_models.ExpandTypesForGetCapacityReservationGroups"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.CapacityReservationGroupListResult"]: + """Lists all of the capacity reservation groups in the subscription. Use the nextLink property in + the response to get the next page of capacity reservation groups. + + :param expand: The expand expression to apply on the operation. Based on the expand param(s) + specified we return Virtual Machine or ScaleSet VM Instance or both resource Ids which are + associated to capacity reservation group in the response. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.ExpandTypesForGetCapacityReservationGroups + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CapacityReservationGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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('CapacityReservationGroupListResult', 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/capacityReservationGroups'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservations_operations.py new file mode 100644 index 000000000000..e98cfe291c0f --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservations_operations.py @@ -0,0 +1,575 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CapacityReservationsOperations: + """CapacityReservationsOperations 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.v2021_07_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, + capacity_reservation_group_name: str, + capacity_reservation_name: str, + parameters: "_models.CapacityReservation", + **kwargs: Any + ) -> "_models.CapacityReservation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_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, 'CapacityReservation') + 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('CapacityReservation', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CapacityReservation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + capacity_reservation_group_name: str, + capacity_reservation_name: str, + parameters: "_models.CapacityReservation", + **kwargs: Any + ) -> AsyncLROPoller["_models.CapacityReservation"]: + """The operation to create or update a capacity reservation. Please note some properties can be + set only during capacity reservation creation. Please refer to + https://aka.ms/CapacityReservation for more details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param capacity_reservation_name: The name of the capacity reservation. + :type capacity_reservation_name: str + :param parameters: Parameters supplied to the Create capacity reservation. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservation + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 CapacityReservation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.CapacityReservation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservation"] + 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, + capacity_reservation_group_name=capacity_reservation_group_name, + capacity_reservation_name=capacity_reservation_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('CapacityReservation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + capacity_reservation_group_name: str, + capacity_reservation_name: str, + parameters: "_models.CapacityReservationUpdate", + **kwargs: Any + ) -> Optional["_models.CapacityReservation"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CapacityReservation"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_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, 'CapacityReservationUpdate') + 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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CapacityReservation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + capacity_reservation_group_name: str, + capacity_reservation_name: str, + parameters: "_models.CapacityReservationUpdate", + **kwargs: Any + ) -> AsyncLROPoller["_models.CapacityReservation"]: + """The operation to update a capacity reservation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param capacity_reservation_name: The name of the capacity reservation. + :type capacity_reservation_name: str + :param parameters: Parameters supplied to the Update capacity reservation operation. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 CapacityReservation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.CapacityReservation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservation"] + 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, + capacity_reservation_group_name=capacity_reservation_group_name, + capacity_reservation_name=capacity_reservation_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('CapacityReservation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + capacity_reservation_group_name: str, + capacity_reservation_name: str, + **kwargs: Any + ) -> 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 = "2021-07-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'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_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/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + capacity_reservation_group_name: str, + capacity_reservation_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """The operation to delete a capacity reservation. This operation is allowed only when all the + associated resources are disassociated from the capacity reservation. Please refer to + https://aka.ms/CapacityReservation for more details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param capacity_reservation_name: The name of the capacity reservation. + :type capacity_reservation_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + capacity_reservation_group_name=capacity_reservation_group_name, + capacity_reservation_name=capacity_reservation_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + capacity_reservation_group_name: str, + capacity_reservation_name: str, + expand: Optional[Union[str, "_models.CapacityReservationInstanceViewTypes"]] = None, + **kwargs: Any + ) -> "_models.CapacityReservation": + """The operation that retrieves information about the capacity reservation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param capacity_reservation_name: The name of the capacity reservation. + :type capacity_reservation_name: str + :param expand: The expand expression to apply on the operation. 'InstanceView' retrieves a + snapshot of the runtime properties of the capacity reservation that is managed by the platform + and can change outside of control plane operations. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationInstanceViewTypes + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CapacityReservation, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_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('CapacityReservation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + def list_by_capacity_reservation_group( + self, + resource_group_name: str, + capacity_reservation_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.CapacityReservationListResult"]: + """Lists all of the capacity reservations in the specified capacity reservation group. Use the + nextLink property in the response to get the next page of capacity reservations. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_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 CapacityReservationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.CapacityReservationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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_capacity_reservation_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_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('CapacityReservationListResult', 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_capacity_reservation_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_host_groups_operations.py new file mode 100644 index 000000000000..94b85750b031 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_host_groups_operations.py @@ -0,0 +1,436 @@ +# 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 as _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.v2021_07_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: Any + ) -> "_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.v2021_07_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.v2021_07_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 = "2021-07-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: Any + ) -> "_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.v2021_07_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.v2021_07_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 = "2021-07-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: Any + ) -> 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 = "2021-07-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[Union[str, "_models.InstanceViewTypes"]] = None, + **kwargs: Any + ) -> "_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. 'InstanceView' will retrieve + the list of instance views of the dedicated hosts under the dedicated host group. 'UserData' is + not supported for dedicated host group. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.InstanceViewTypes + :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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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/v2021_07_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_hosts_operations.py new file mode 100644 index 000000000000..57290ff28276 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_hosts_operations.py @@ -0,0 +1,567 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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: Any + ) -> "_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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: Any + ) -> "_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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + host_group_name: str, + host_name: str, + **kwargs: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + host_group_name: str, + host_name: str, + expand: Optional[Union[str, "_models.InstanceViewTypes"]] = None, + **kwargs: Any + ) -> "_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. 'InstanceView' will retrieve + the list of instance views of the dedicated host. 'UserData' is not supported for dedicated + host. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.InstanceViewTypes + :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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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/v2021_07_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_galleries_operations.py new file mode 100644 index 000000000000..ae2de09d8440 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_galleries_operations.py @@ -0,0 +1,608 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GalleriesOperations: + """GalleriesOperations 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.v2021_07_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, + gallery_name: str, + gallery: "_models.Gallery", + **kwargs: Any + ) -> "_models.Gallery": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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(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 + + if response.status_code not in [200, 201, 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('Gallery', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Gallery', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + gallery_name: str, + gallery: "_models.Gallery", + **kwargs: Any + ) -> 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. + :type gallery_name: str + :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. + :type gallery: ~azure.mgmt.compute.v2021_07_01.models.Gallery + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 Gallery or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.Gallery] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + 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, + gallery_name=gallery_name, + gallery=gallery, + 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('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery: "_models.GalleryUpdate", + **kwargs: Any + ) -> "_models.Gallery": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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(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 + + 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('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + gallery_name: str, + gallery: "_models.GalleryUpdate", + **kwargs: Any + ) -> 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. + :type gallery_name: str + :param gallery: Parameters supplied to the update Shared Image Gallery operation. + :type gallery: ~azure.mgmt.compute.v2021_07_01.models.GalleryUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 Gallery or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.Gallery] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + 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, + gallery_name=gallery_name, + gallery=gallery, + 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('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + gallery_name: str, + select: Optional[Union[str, "_models.SelectPermissions"]] = None, + **kwargs: Any + ) -> "_models.Gallery": + """Retrieves information about 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. + :type gallery_name: str + :param select: The select expression to apply on the operation. + :type select: str or ~azure.mgmt.compute.v2021_07_01.models.SelectPermissions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Gallery, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.Gallery + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, '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('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + gallery_name: str, + **kwargs: Any + ) -> 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 = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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/galleries/{galleryName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + gallery_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete 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 to be deleted. + :type gallery_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + gallery_name=gallery_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.GalleryList"]: + """List galleries 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 GalleryList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.GalleryList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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('GalleryList', 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/galleries'} # type: ignore + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.GalleryList"]: + """List galleries 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 GalleryList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.GalleryList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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('GalleryList', 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/galleries'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_application_versions_operations.py new file mode 100644 index 000000000000..e824f5c989fd --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_application_versions_operations.py @@ -0,0 +1,618 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GalleryApplicationVersionsOperations: + """GalleryApplicationVersionsOperations 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.v2021_07_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, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_name: str, + gallery_application_version: "_models.GalleryApplicationVersion", + **kwargs: Any + ) -> "_models.GalleryApplicationVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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(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 + + if response.status_code not in [200, 201, 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('GalleryApplicationVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_name: str, + gallery_application_version: "_models.GalleryApplicationVersion", + **kwargs: Any + ) -> 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. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + 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:``. + :type gallery_application_version_name: str + :param gallery_application_version: Parameters supplied to the create or update gallery + Application Version operation. + :type gallery_application_version: ~azure.mgmt.compute.v2021_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. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 GalleryApplicationVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_name, + gallery_application_version=gallery_application_version, + 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('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_name: str, + gallery_application_version: "_models.GalleryApplicationVersionUpdate", + **kwargs: Any + ) -> "_models.GalleryApplicationVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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(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 + + 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('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_name: str, + gallery_application_version: "_models.GalleryApplicationVersionUpdate", + **kwargs: Any + ) -> 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. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + 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:``. + :type gallery_application_version_name: str + :param gallery_application_version: Parameters supplied to the update gallery Application + Version operation. + :type gallery_application_version: ~azure.mgmt.compute.v2021_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. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 GalleryApplicationVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_name, + gallery_application_version=gallery_application_version, + 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('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_name: str, + expand: Optional[Union[str, "_models.ReplicationStatusTypes"]] = None, + **kwargs: Any + ) -> "_models.GalleryApplicationVersion": + """Retrieves information about 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. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + Application Version resides. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery Application Version to be + retrieved. + :type gallery_application_version_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str or ~azure.mgmt.compute.v2021_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.v2021_07_01.models.GalleryApplicationVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_name, '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('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_name: str, + **kwargs: Any + ) -> 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 = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_name: str, + **kwargs: Any + ) -> 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. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + Application Version resides. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery Application Version to be + 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. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def list_by_gallery_application( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.GalleryApplicationVersionList"]: + """List gallery Application Versions in 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 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. + :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) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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('GalleryApplicationVersionList', 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_gallery_application.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_applications_operations.py new file mode 100644 index 000000000000..ffb0811189df --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_applications_operations.py @@ -0,0 +1,575 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GalleryApplicationsOperations: + """GalleryApplicationsOperations 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.v2021_07_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, + gallery_name: str, + gallery_application_name: str, + gallery_application: "_models.GalleryApplication", + **kwargs: Any + ) -> "_models.GalleryApplication": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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(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 + + if response.status_code not in [200, 201, 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('GalleryApplication', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application: "_models.GalleryApplication", + **kwargs: Any + ) -> 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. + :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. + :type gallery_application_name: str + :param gallery_application: Parameters supplied to the create or update gallery Application + operation. + :type gallery_application: ~azure.mgmt.compute.v2021_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. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 GalleryApplication or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application=gallery_application, + 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('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application: "_models.GalleryApplicationUpdate", + **kwargs: Any + ) -> "_models.GalleryApplication": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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(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 + + 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('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application: "_models.GalleryApplicationUpdate", + **kwargs: Any + ) -> 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. + :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. + :type gallery_application_name: str + :param gallery_application: Parameters supplied to the update gallery Application operation. + :type gallery_application: ~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 GalleryApplication or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application=gallery_application, + 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('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + **kwargs: Any + ) -> "_models.GalleryApplication": + """Retrieves information about 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 from which the Application + Definitions are to be retrieved. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition to be + retrieved. + :type gallery_application_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GalleryApplication, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.GalleryApplication + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + **kwargs: Any + ) -> 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 = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + **kwargs: Any + ) -> 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. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition to be deleted. + :type gallery_application_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def list_by_gallery( + self, + resource_group_name: str, + gallery_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.GalleryApplicationList"]: + """List gallery Application Definitions in a 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. + :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) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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('GalleryApplicationList', 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_gallery.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_image_versions_operations.py new file mode 100644 index 000000000000..f71f1ba39c37 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_image_versions_operations.py @@ -0,0 +1,616 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GalleryImageVersionsOperations: + """GalleryImageVersionsOperations 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.v2021_07_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, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + gallery_image_version: "_models.GalleryImageVersion", + **kwargs: Any + ) -> "_models.GalleryImageVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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(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 + + if response.status_code not in [200, 201, 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('GalleryImageVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + gallery_image_version: "_models.GalleryImageVersion", + **kwargs: Any + ) -> 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. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + 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:``. + :type gallery_image_version_name: str + :param gallery_image_version: Parameters supplied to the create or update gallery image version + operation. + :type gallery_image_version: ~azure.mgmt.compute.v2021_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. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image_version_name=gallery_image_version_name, + gallery_image_version=gallery_image_version, + 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('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + gallery_image_version: "_models.GalleryImageVersionUpdate", + **kwargs: Any + ) -> "_models.GalleryImageVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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(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 + + 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('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + gallery_image_version: "_models.GalleryImageVersionUpdate", + **kwargs: Any + ) -> 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. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + 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:``. + :type gallery_image_version_name: str + :param gallery_image_version: Parameters supplied to the update gallery image version + operation. + :type gallery_image_version: ~azure.mgmt.compute.v2021_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. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image_version_name=gallery_image_version_name, + gallery_image_version=gallery_image_version, + 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('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + expand: Optional[Union[str, "_models.ReplicationStatusTypes"]] = None, + **kwargs: Any + ) -> "_models.GalleryImageVersion": + """Retrieves information about 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. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + resides. + :type gallery_image_name: str + :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 or ~azure.mgmt.compute.v2021_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.v2021_07_01.models.GalleryImageVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_name, '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('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + **kwargs: Any + ) -> 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 = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + **kwargs: Any + ) -> 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. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + 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 + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image_version_name=gallery_image_version_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def list_by_gallery_image( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.GalleryImageVersionList"]: + """List gallery image versions in 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 + 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. + :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) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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('GalleryImageVersionList', 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_gallery_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_images_operations.py new file mode 100644 index 000000000000..e2dd6cce2b52 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_images_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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GalleryImagesOperations: + """GalleryImagesOperations 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.v2021_07_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, + gallery_name: str, + gallery_image_name: str, + gallery_image: "_models.GalleryImage", + **kwargs: Any + ) -> "_models.GalleryImage": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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(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 + + if response.status_code not in [200, 201, 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('GalleryImage', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image: "_models.GalleryImage", + **kwargs: Any + ) -> 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. + :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. + :type gallery_image_name: str + :param gallery_image: Parameters supplied to the create or update gallery image operation. + :type gallery_image: ~azure.mgmt.compute.v2021_07_01.models.GalleryImage + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryImage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image=gallery_image, + 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('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image: "_models.GalleryImageUpdate", + **kwargs: Any + ) -> "_models.GalleryImage": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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(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 + + 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('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image: "_models.GalleryImageUpdate", + **kwargs: Any + ) -> 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. + :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. + :type gallery_image_name: str + :param gallery_image: Parameters supplied to the update gallery image operation. + :type gallery_image: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryImage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image=gallery_image, + 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('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + **kwargs: Any + ) -> "_models.GalleryImage": + """Retrieves information about 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 from which the Image Definitions are + to be retrieved. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition to be retrieved. + :type gallery_image_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GalleryImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.GalleryImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + **kwargs: Any + ) -> 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 = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + **kwargs: Any + ) -> 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. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition to be deleted. + :type gallery_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + gallery_name=gallery_name, + gallery_image_name=gallery_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, {}) + + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def list_by_gallery( + self, + resource_group_name: str, + gallery_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.GalleryImageList"]: + """List gallery image definitions in a 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. + :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) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.GalleryImageList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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('GalleryImageList', 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_gallery.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_sharing_profile_operations.py new file mode 100644 index 000000000000..9d1f2793bd35 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_sharing_profile_operations.py @@ -0,0 +1,171 @@ +# 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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GallerySharingProfileOperations: + """GallerySharingProfileOperations 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.v2021_07_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 _update_initial( + self, + resource_group_name: str, + gallery_name: str, + sharing_update: "_models.SharingUpdate", + **kwargs: Any + ) -> "_models.SharingUpdate": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharingUpdate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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(sharing_update, 'SharingUpdate') + 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 response.status_code == 200: + deserialized = self._deserialize('SharingUpdate', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SharingUpdate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + gallery_name: str, + sharing_update: "_models.SharingUpdate", + **kwargs: Any + ) -> AsyncLROPoller["_models.SharingUpdate"]: + """Update sharing profile of a 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. + :type gallery_name: str + :param sharing_update: Parameters supplied to the update gallery sharing profile. + :type sharing_update: ~azure.mgmt.compute.v2021_07_01.models.SharingUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 SharingUpdate or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.SharingUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharingUpdate"] + 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, + gallery_name=gallery_name, + sharing_update=sharing_update, + 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('SharingUpdate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_images_operations.py new file mode 100644 index 000000000000..cdcbea12d166 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_images_operations.py @@ -0,0 +1,606 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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: Any + ) -> "_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + image_name: str, + parameters: "_models.ImageUpdate", + **kwargs: Any + ) -> "_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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + image_name: str, + **kwargs: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + image_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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/v2021_07_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_log_analytics_operations.py new file mode 100644 index 000000000000..419548d5029d --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_log_analytics_operations.py @@ -0,0 +1,283 @@ +# 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 as _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.v2021_07_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: Any + ) -> 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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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.ThrottledRequestsInput", + **kwargs: Any + ) -> 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 = "2021-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 + 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, 'ThrottledRequestsInput') + 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.ThrottledRequestsInput", + **kwargs: Any + ) -> 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.v2021_07_01.models.ThrottledRequestsInput + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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/v2021_07_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_operations.py new file mode 100644 index 000000000000..840df1ad2e3a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _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.v2021_07_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: Any + ) -> 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.v2021_07_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 = "2021-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 + # 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/v2021_07_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_proximity_placement_groups_operations.py new file mode 100644 index 000000000000..97ca55d12cb3 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _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.v2021_07_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: Any + ) -> "_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.v2021_07_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.v2021_07_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 = "2021-07-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.ProximityPlacementGroupUpdate", + **kwargs: Any + ) -> "_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.v2021_07_01.models.ProximityPlacementGroupUpdate + :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.v2021_07_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 = "2021-07-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, 'ProximityPlacementGroupUpdate') + 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: Any + ) -> 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 = "2021-07-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: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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/v2021_07_01/aio/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_resource_skus_operations.py new file mode 100644 index 000000000000..7eb7e076b716 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_resource_skus_operations.py @@ -0,0 +1,120 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ResourceSkusOperations: + """ResourceSkusOperations 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.v2021_07_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, + filter: Optional[str] = None, + include_extended_locations: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ResourceSkusResult"]: + """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. + :type filter: str + :param include_extended_locations: To Include Extended Locations information or not in the + response. + :type include_extended_locations: 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) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.ResourceSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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 filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if include_extended_locations is not None: + query_parameters['includeExtendedLocations'] = self._serialize.query("include_extended_locations", include_extended_locations, '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('ResourceSkusResult', 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/skus'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_point_collections_operations.py new file mode 100644 index 000000000000..ee26fd32be4d --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_point_collections_operations.py @@ -0,0 +1,494 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RestorePointCollectionsOperations: + """RestorePointCollectionsOperations 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.v2021_07_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, + restore_point_collection_name: str, + parameters: "_models.RestorePointCollection", + **kwargs: Any + ) -> "_models.RestorePointCollection": + """The operation to create or update the restore point collection. Please refer to + https://aka.ms/RestorePoints for more details. When updating a restore point collection, only + tags may be modified. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection. + :type restore_point_collection_name: str + :param parameters: Parameters supplied to the Create or Update restore point collection + operation. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestorePointCollection, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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 = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # 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, 'RestorePointCollection') + 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('RestorePointCollection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RestorePointCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + restore_point_collection_name: str, + parameters: "_models.RestorePointCollectionUpdate", + **kwargs: Any + ) -> "_models.RestorePointCollection": + """The operation to update the restore point collection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection. + :type restore_point_collection_name: str + :param parameters: Parameters supplied to the Update restore point collection operation. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollectionUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestorePointCollection, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # 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, 'RestorePointCollectionUpdate') + 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('RestorePointCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + restore_point_collection_name: str, + **kwargs: Any + ) -> 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 = "2021-07-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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_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/restorePointCollections/{restorePointCollectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + restore_point_collection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """The operation to delete the restore point collection. This operation will also delete all the + contained restore points. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the Restore Point Collection. + :type restore_point_collection_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + restore_point_collection_name=restore_point_collection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + restore_point_collection_name: str, + expand: Optional[Union[str, "_models.RestorePointCollectionExpandOptions"]] = None, + **kwargs: Any + ) -> "_models.RestorePointCollection": + """The operation to get the restore point collection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection. + :type restore_point_collection_name: str + :param expand: The expand expression to apply on the operation. If expand=restorePoints, server + will return all contained restore points in the restorePointCollection. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollectionExpandOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestorePointCollection, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, '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('RestorePointCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.RestorePointCollectionListResult"]: + """Gets the list of restore point collections 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 RestorePointCollectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.RestorePointCollectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePointCollectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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('RestorePointCollectionListResult', 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/restorePointCollections'} # type: ignore + + def list_all( + self, + **kwargs: Any + ) -> AsyncIterable["_models.RestorePointCollectionListResult"]: + """Gets the list of restore point collections in the subscription. Use nextLink property in the + response to get the next page of restore point collections. Do this till nextLink is not null + to fetch all the restore point collections. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RestorePointCollectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.RestorePointCollectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePointCollectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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('RestorePointCollectionListResult', 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/restorePointCollections'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_points_operations.py new file mode 100644 index 000000000000..e674eb222e99 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_points_operations.py @@ -0,0 +1,352 @@ +# 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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RestorePointsOperations: + """RestorePointsOperations 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.v2021_07_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_initial( + self, + resource_group_name: str, + restore_point_collection_name: str, + restore_point_name: str, + parameters: "_models.RestorePoint", + **kwargs: Any + ) -> "_models.RestorePoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'restorePointName': self._serialize.url("restore_point_name", restore_point_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['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, 'RestorePoint') + 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 [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestorePoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + restore_point_collection_name: str, + restore_point_name: str, + parameters: "_models.RestorePoint", + **kwargs: Any + ) -> AsyncLROPoller["_models.RestorePoint"]: + """The operation to create the restore point. Updating properties of an existing restore point is + not allowed. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection. + :type restore_point_collection_name: str + :param restore_point_name: The name of the restore point. + :type restore_point_name: str + :param parameters: Parameters supplied to the Create restore point operation. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.RestorePoint + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 RestorePoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.RestorePoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePoint"] + 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_initial( + resource_group_name=resource_group_name, + restore_point_collection_name=restore_point_collection_name, + restore_point_name=restore_point_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('RestorePoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'restorePointName': self._serialize.url("restore_point_name", restore_point_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + restore_point_collection_name: str, + restore_point_name: str, + **kwargs: Any + ) -> 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 = "2021-07-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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'restorePointName': self._serialize.url("restore_point_name", restore_point_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + restore_point_collection_name: str, + restore_point_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """The operation to delete the restore point. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the Restore Point Collection. + :type restore_point_collection_name: str + :param restore_point_name: The name of the restore point. + :type restore_point_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + restore_point_collection_name=restore_point_collection_name, + restore_point_name=restore_point_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'restorePointName': self._serialize.url("restore_point_name", restore_point_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + restore_point_collection_name: str, + restore_point_name: str, + **kwargs: Any + ) -> "_models.RestorePoint": + """The operation to get the restore point. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection. + :type restore_point_collection_name: str + :param restore_point_name: The name of the restore point. + :type restore_point_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestorePoint, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.RestorePoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'restorePointName': self._serialize.url("restore_point_name", restore_point_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestorePoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_galleries_operations.py new file mode 100644 index 000000000000..c42364e81427 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_galleries_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 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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SharedGalleriesOperations: + """SharedGalleriesOperations 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.v2021_07_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, + shared_to: Optional[Union[str, "_models.SharedToValues"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.SharedGalleryList"]: + """List shared galleries by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param shared_to: The query parameter to decide what shared galleries to fetch when doing + listing operations. + :type shared_to: str or ~azure.mgmt.compute.v2021_07_01.models.SharedToValues + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedGalleryList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.SharedGalleryList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(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 shared_to is not None: + query_parameters['sharedTo'] = self._serialize.query("shared_to", shared_to, '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('SharedGalleryList', 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}/sharedGalleries'} # type: ignore + + async def get( + self, + location: str, + gallery_unique_name: str, + **kwargs: Any + ) -> "_models.SharedGallery": + """Get a shared gallery by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SharedGallery, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.SharedGallery + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_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('SharedGallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_image_versions_operations.py new file mode 100644 index 000000000000..b5b204f2ff18 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_image_versions_operations.py @@ -0,0 +1,197 @@ +# 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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SharedGalleryImageVersionsOperations: + """SharedGalleryImageVersionsOperations 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.v2021_07_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, + gallery_unique_name: str, + gallery_image_name: str, + shared_to: Optional[Union[str, "_models.SharedToValues"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.SharedGalleryImageVersionList"]: + """List shared gallery image versions by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image + Versions are to be listed. + :type gallery_image_name: str + :param shared_to: The query parameter to decide what shared galleries to fetch when doing + listing operations. + :type shared_to: str or ~azure.mgmt.compute.v2021_07_01.models.SharedToValues + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedGalleryImageVersionList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.SharedGalleryImageVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImageVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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') + if shared_to is not None: + query_parameters['sharedTo'] = self._serialize.query("shared_to", shared_to, '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('SharedGalleryImageVersionList', 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}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions'} # type: ignore + + async def get( + self, + location: str, + gallery_unique_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + **kwargs: Any + ) -> "_models.SharedGalleryImageVersion": + """Get a shared gallery image version by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image + Versions are to be listed. + :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:``. + :type gallery_image_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SharedGalleryImageVersion, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.SharedGalleryImageVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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('SharedGalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_images_operations.py new file mode 100644 index 000000000000..93eb9499fde4 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_images_operations.py @@ -0,0 +1,185 @@ +# 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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SharedGalleryImagesOperations: + """SharedGalleryImagesOperations 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.v2021_07_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, + gallery_unique_name: str, + shared_to: Optional[Union[str, "_models.SharedToValues"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.SharedGalleryImageList"]: + """List shared gallery images by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param shared_to: The query parameter to decide what shared galleries to fetch when doing + listing operations. + :type shared_to: str or ~azure.mgmt.compute.v2021_07_01.models.SharedToValues + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedGalleryImageList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.SharedGalleryImageList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImageList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_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') + if shared_to is not None: + query_parameters['sharedTo'] = self._serialize.query("shared_to", shared_to, '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('SharedGalleryImageList', 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}/sharedGalleries/{galleryUniqueName}/images'} # type: ignore + + async def get( + self, + location: str, + gallery_unique_name: str, + gallery_image_name: str, + **kwargs: Any + ) -> "_models.SharedGalleryImage": + """Get a shared gallery image by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param gallery_image_name: The name of the Shared Gallery Image Definition from which the 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: SharedGalleryImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.SharedGalleryImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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('SharedGalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_ssh_public_keys_operations.py new file mode 100644 index 000000000000..660fd6f2667a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _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.v2021_07_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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> "_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.v2021_07_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.v2021_07_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 = "2021-07-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: Any + ) -> "_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.v2021_07_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.v2021_07_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 = "2021-07-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: Any + ) -> 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 = "2021-07-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: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> "_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.v2021_07_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 = "2021-07-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/v2021_07_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_usage_operations.py new file mode 100644 index 000000000000..3edc89297843 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _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.v2021_07_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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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/v2021_07_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extension_images_operations.py new file mode 100644 index 000000000000..95f503f8326f --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _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.v2021_07_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: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-07-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/v2021_07_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extensions_operations.py new file mode 100644 index 000000000000..3f7fbe8b9c7e --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extensions_operations.py @@ -0,0 +1,555 @@ +# 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 as _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.v2021_07_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: Any + ) -> "_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 = "2021-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 + 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: Any + ) -> 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.v2021_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. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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: Any + ) -> "_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 = "2021-07-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: Any + ) -> 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.v2021_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. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_name: str, + vm_extension_name: str, + **kwargs: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> "_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.v2021_07_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 = "2021-07-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/v2021_07_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_edge_zone_operations.py new file mode 100644 index 000000000000..9eee834806dd --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -0,0 +1,390 @@ +# 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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineImagesEdgeZoneOperations: + """VirtualMachineImagesEdgeZoneOperations 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.v2021_07_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, + edge_zone: str, + publisher_name: str, + offer: str, + skus: str, + version: str, + **kwargs: Any + ) -> "_models.VirtualMachineImage": + """Gets a virtual machine image in an edge zone. + + :param location: The name of a supported Azure region. + :type location: str + :param edge_zone: The name of the edge zone. + :type edge_zone: 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.v2021_07_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 = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'edgeZone': self._serialize.url("edge_zone", edge_zone, '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}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}'} # type: ignore + + async def list( + self, + location: str, + edge_zone: str, + publisher_name: str, + offer: str, + skus: str, + expand: Optional[str] = None, + top: Optional[int] = None, + orderby: Optional[str] = None, + **kwargs: Any + ) -> List["_models.VirtualMachineImageResource"]: + """Gets a list of all virtual machine image versions for the specified location, edge zone, + publisher, offer, and SKU. + + :param location: The name of a supported Azure region. + :type location: str + :param edge_zone: The name of the edge zone. + :type edge_zone: 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: An integer value specifying the number of images to return that matches supplied + values. + :type top: int + :param orderby: Specifies the order of the results returned. Formatted as an OData query. + :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.v2021_07_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 = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'edgeZone': self._serialize.url("edge_zone", edge_zone, '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}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions'} # type: ignore + + async def list_offers( + self, + location: str, + edge_zone: str, + publisher_name: str, + **kwargs: Any + ) -> List["_models.VirtualMachineImageResource"]: + """Gets a list of virtual machine image offers for the specified location, edge zone and + publisher. + + :param location: The name of a supported Azure region. + :type location: str + :param edge_zone: The name of the edge zone. + :type edge_zone: 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.v2021_07_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 = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list_offers.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'edgeZone': self._serialize.url("edge_zone", edge_zone, '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}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers'} # type: ignore + + async def list_publishers( + self, + location: str, + edge_zone: str, + **kwargs: Any + ) -> List["_models.VirtualMachineImageResource"]: + """Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + + :param location: The name of a supported Azure region. + :type location: str + :param edge_zone: The name of the edge zone. + :type edge_zone: 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.v2021_07_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 = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list_publishers.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'edgeZone': self._serialize.url("edge_zone", edge_zone, '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}/edgeZones/{edgeZone}/publishers'} # type: ignore + + async def list_skus( + self, + location: str, + edge_zone: str, + publisher_name: str, + offer: str, + **kwargs: Any + ) -> List["_models.VirtualMachineImageResource"]: + """Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and + offer. + + :param location: The name of a supported Azure region. + :type location: str + :param edge_zone: The name of the edge zone. + :type edge_zone: 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.v2021_07_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 = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'edgeZone': self._serialize.url("edge_zone", edge_zone, '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}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_operations.py new file mode 100644 index 000000000000..639ecf2de941 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _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.v2021_07_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: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-07-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/v2021_07_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_run_commands_operations.py new file mode 100644 index 000000000000..25bca6d48e9d --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -0,0 +1,700 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> "_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.v2021_07_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 = "2021-07-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 + + async def _create_or_update_initial( + self, + resource_group_name: str, + vm_name: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommand", + **kwargs: Any + ) -> "_models.VirtualMachineRunCommand": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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(run_command, 'VirtualMachineRunCommand') + 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('VirtualMachineRunCommand', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineRunCommand', 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}/runCommands/{runCommandName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + vm_name: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommand", + **kwargs: Any + ) -> AsyncLROPoller["_models.VirtualMachineRunCommand"]: + """The operation to create or update the run command. + + :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 run command should be created or + updated. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Create Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + vm_name: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommandUpdate", + **kwargs: Any + ) -> "_models.VirtualMachineRunCommand": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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(run_command, 'VirtualMachineRunCommandUpdate') + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + vm_name: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommandUpdate", + **kwargs: Any + ) -> AsyncLROPoller["_models.VirtualMachineRunCommand"]: + """The operation to update the run command. + + :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 run command should be updated. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Update Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_name: str, + run_command_name: str, + **kwargs: Any + ) -> 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 = "2021-07-01" + accept = "application/json, text/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'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + vm_name: str, + run_command_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """The operation to delete the run command. + + :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 run command should be deleted. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + run_command_name=run_command_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + async def get_by_virtual_machine( + self, + resource_group_name: str, + vm_name: str, + run_command_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.VirtualMachineRunCommand": + """The operation to get the run command. + + :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 run command. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_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: VirtualMachineRunCommand, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json, text/json" + + # Construct URL + url = self.get_by_virtual_machine.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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_virtual_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def list_by_virtual_machine( + self, + resource_group_name: str, + vm_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.VirtualMachineRunCommandsListResult"]: + """The operation to get all run commands 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 run command. + :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: An iterator like instance of either VirtualMachineRunCommandsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommandsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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_by_virtual_machine.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') + + 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('VirtualMachineRunCommandsListResult', 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_virtual_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py new file mode 100644 index 000000000000..11d1321e10ff --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -0,0 +1,571 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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: Any + ) -> "_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 = "2021-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 + 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: Any + ) -> 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.v2021_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. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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: Any + ) -> "_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 = "2021-07-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: Any + ) -> 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.v2021_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. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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/v2021_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py new file mode 100644 index 000000000000..9a80b294eea5 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -0,0 +1,423 @@ +# 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 as _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.v2021_07_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> "_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.v2021_07_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 = "2021-07-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/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py new file mode 100644 index 000000000000..4ca18857a971 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -0,0 +1,585 @@ +# 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 as _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.v2021_07_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.VirtualMachineScaleSetVMExtension", + **kwargs: Any + ) -> "_models.VirtualMachineScaleSetVMExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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, 'VirtualMachineScaleSetVMExtension') + 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('VirtualMachineScaleSetVMExtension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', 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.VirtualMachineScaleSetVMExtension", + **kwargs: Any + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetVMExtension"]: + """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.v2021_07_01.models.VirtualMachineScaleSetVMExtension + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 VirtualMachineScaleSetVMExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetVMExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] + 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('VirtualMachineScaleSetVMExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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.VirtualMachineScaleSetVMExtensionUpdate", + **kwargs: Any + ) -> "_models.VirtualMachineScaleSetVMExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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, 'VirtualMachineScaleSetVMExtensionUpdate') + 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('VirtualMachineScaleSetVMExtension', 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.VirtualMachineScaleSetVMExtensionUpdate", + **kwargs: Any + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetVMExtension"]: + """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.v2021_07_01.models.VirtualMachineScaleSetVMExtensionUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 VirtualMachineScaleSetVMExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetVMExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] + 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('VirtualMachineScaleSetVMExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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: Any + ) -> "_models.VirtualMachineScaleSetVMExtension": + """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: VirtualMachineScaleSetVMExtension, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetVMExtension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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('VirtualMachineScaleSetVMExtension', 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: Any + ) -> "_models.VirtualMachineScaleSetVMExtensionsListResult": + """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: VirtualMachineScaleSetVMExtensionsListResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetVMExtensionsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtensionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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('VirtualMachineScaleSetVMExtensionsListResult', 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/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py new file mode 100644 index 000000000000..0fa80cba3412 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -0,0 +1,600 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineScaleSetVMRunCommandsOperations: + """VirtualMachineScaleSetVMRunCommandsOperations 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.v2021_07_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, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommand", + **kwargs: Any + ) -> "_models.VirtualMachineRunCommand": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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(run_command, 'VirtualMachineRunCommand') + 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('VirtualMachineRunCommand', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineRunCommand', 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}/runCommands/{runCommandName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommand", + **kwargs: Any + ) -> AsyncLROPoller["_models.VirtualMachineRunCommand"]: + """The operation to create or update the VMSS VM run command. + + :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 run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Create Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommandUpdate", + **kwargs: Any + ) -> "_models.VirtualMachineRunCommand": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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(run_command, 'VirtualMachineRunCommandUpdate') + 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('VirtualMachineRunCommand', 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}/runCommands/{runCommandName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommandUpdate", + **kwargs: Any + ) -> AsyncLROPoller["_models.VirtualMachineRunCommand"]: + """The operation to update the VMSS VM run command. + + :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 run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Update Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + run_command_name: str, + **kwargs: Any + ) -> 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 = "2021-07-01" + accept = "application/json, text/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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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}/runCommands/{runCommandName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + run_command_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """The operation to delete the VMSS VM run command. + + :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 run_command_name: The name of the virtual machine run command. + :type run_command_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + run_command_name=run_command_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + '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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + run_command_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.VirtualMachineRunCommand": + """The operation to get the VMSS VM run command. + + :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 run_command_name: The name of the virtual machine run command. + :type run_command_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: VirtualMachineRunCommand, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json, text/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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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('VirtualMachineRunCommand', 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}/runCommands/{runCommandName}'} # type: ignore + + def list( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.VirtualMachineRunCommandsListResult"]: + """The operation to get all run commands 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: An iterator like instance of either VirtualMachineRunCommandsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommandsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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') + + 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('VirtualMachineRunCommandsListResult', 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}/virtualMachines/{instanceId}/runCommands'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py new file mode 100644 index 000000000000..7aded4f51d54 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -0,0 +1,1716 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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.VirtualMachineScaleSetVMReimageParameters"] = None, + **kwargs: Any + ) -> 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 = "2021-07-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, 'VirtualMachineScaleSetVMReimageParameters') + 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.VirtualMachineScaleSetVMReimageParameters"] = None, + **kwargs: Any + ) -> 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.v2021_07_01.models.VirtualMachineScaleSetVMReimageParameters + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> "_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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + force_deletion: Optional[bool] = None, + **kwargs: Any + ) -> 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 = "2021-07-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] + if force_deletion is not None: + query_parameters['forceDeletion'] = self._serialize.query("force_deletion", force_deletion, 'bool') + 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, + force_deletion: Optional[bool] = None, + **kwargs: Any + ) -> 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 + :param force_deletion: Optional parameter to force delete a virtual machine from a VM scale + set. (Feature in Preview). + :type force_deletion: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + force_deletion=force_deletion, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} # type: ignore + + async def get( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + expand: Optional[Union[str, "_models.InstanceViewTypes"]] = None, + **kwargs: Any + ) -> "_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. 'InstanceView' will retrieve + the instance view of the virtual machine. 'UserData' will retrieve the UserData of the virtual + machine. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.InstanceViewTypes + :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.v2021_07_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 = "2021-07-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: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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/v2021_07_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_sets_operations.py new file mode 100644 index 000000000000..b58757141478 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -0,0 +1,2342 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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: Any + ) -> AsyncIterable["_models.VirtualMachineScaleSetListResult"]: + """Gets all the VM scale sets under the specified subscription for the specified location. + + :param location: The location for which VM scale sets 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 VirtualMachineScaleSetListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2021_07_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 = "2021-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 + 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('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_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + parameters: "_models.VirtualMachineScaleSet", + **kwargs: Any + ) -> "_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + parameters: "_models.VirtualMachineScaleSetUpdate", + **kwargs: Any + ) -> "_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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + force_deletion: Optional[bool] = None, + **kwargs: Any + ) -> 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 = "2021-07-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] + if force_deletion is not None: + query_parameters['forceDeletion'] = self._serialize.query("force_deletion", force_deletion, 'bool') + 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, + force_deletion: Optional[bool] = None, + **kwargs: Any + ) -> 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 + :param force_deletion: Optional parameter to force delete a VM scale set. (Feature in Preview). + :type force_deletion: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + force_deletion=force_deletion, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + vm_scale_set_name: str, + expand: Optional[Union[str, "_models.ExpandTypesForGetVMScaleSets"]] = None, + **kwargs: Any + ) -> "_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 + :param expand: The expand expression to apply on the operation. 'UserData' retrieves the + UserData property of the VM scale set that was provided by the user during the VM scale set + Create/Update operation. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.ExpandTypesForGetVMScaleSets + :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.v2021_07_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 = "2021-07-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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, '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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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", + force_deletion: Optional[bool] = None, + **kwargs: Any + ) -> 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 = "2021-07-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] + if force_deletion is not None: + query_parameters['forceDeletion'] = self._serialize.query("force_deletion", force_deletion, '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] + 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", + force_deletion: Optional[bool] = None, + **kwargs: Any + ) -> 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.v2021_07_01.models.VirtualMachineScaleSetVMInstanceRequiredIDs + :param force_deletion: Optional parameter to force delete virtual machines from the VM scale + set. (Feature in Preview). + :type force_deletion: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + force_deletion=force_deletion, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_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: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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/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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-07-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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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/v2021_07_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_sizes_operations.py new file mode 100644 index 000000000000..736fcf587063 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _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.v2021_07_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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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/v2021_07_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machines_operations.py new file mode 100644 index 000000000000..0e59be7d0715 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machines_operations.py @@ -0,0 +1,2483 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> "_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + vm_name: str, + parameters: "_models.VirtualMachineUpdate", + **kwargs: Any + ) -> "_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 = "2021-07-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]: + 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 + _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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_name: str, + force_deletion: Optional[bool] = None, + **kwargs: Any + ) -> 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 = "2021-07-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] + if force_deletion is not None: + query_parameters['forceDeletion'] = self._serialize.query("force_deletion", force_deletion, 'bool') + 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, + force_deletion: Optional[bool] = None, + **kwargs: Any + ) -> 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 + :param force_deletion: Optional parameter to force delete virtual machines.(Feature in + Preview). + :type force_deletion: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + force_deletion=force_deletion, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + vm_name: str, + expand: Optional[Union[str, "_models.InstanceViewTypes"]] = None, + **kwargs: Any + ) -> "_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. 'InstanceView' retrieves a + snapshot of the runtime properties of the virtual machine that is managed by the platform and + can change outside of control plane operations. 'UserData' retrieves the UserData property as + part of the VM model view that was provided by the user during the VM Create/Update operation. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.InstanceViewTypes + :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.v2021_07_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 = "2021-07-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: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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, + hibernate: Optional[bool] = None, + **kwargs: Any + ) -> 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 = "2021-07-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] + if hibernate is not None: + query_parameters['hibernate'] = self._serialize.query("hibernate", hibernate, '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, {}) + + _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, + hibernate: Optional[bool] = None, + **kwargs: Any + ) -> 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 + :param hibernate: Optional parameter to hibernate a virtual machine. (Feature in Preview). + :type hibernate: 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, + hibernate=hibernate, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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 = "2021-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 + 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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> "_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.v2021_07_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 = "2021-07-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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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 = "2021-07-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: Any + ) -> 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_assess_patches.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches'} # type: ignore + + async def _install_patches_initial( + self, + resource_group_name: str, + vm_name: str, + install_patches_input: "_models.VirtualMachineInstallPatchesParameters", + **kwargs: Any + ) -> Optional["_models.VirtualMachineInstallPatchesResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineInstallPatchesResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._install_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['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(install_patches_input, 'VirtualMachineInstallPatchesParameters') + 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('VirtualMachineInstallPatchesResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_patches_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches'} # type: ignore + + async def begin_install_patches( + self, + resource_group_name: str, + vm_name: str, + install_patches_input: "_models.VirtualMachineInstallPatchesParameters", + **kwargs: Any + ) -> AsyncLROPoller["_models.VirtualMachineInstallPatchesResult"]: + """Installs 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 + :param install_patches_input: Input for InstallPatches as directly received by the API. + :type install_patches_input: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineInstallPatchesParameters + :keyword callable cls: A custom type 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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 VirtualMachineInstallPatchesResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineInstallPatchesResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstallPatchesResult"] + 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._install_patches_initial( + resource_group_name=resource_group_name, + vm_name=vm_name, + install_patches_input=install_patches_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): + deserialized = self._deserialize('VirtualMachineInstallPatchesResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_patches.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches'} # type: ignore + + async def _run_command_initial( + self, + resource_group_name: str, + vm_name: str, + parameters: "_models.RunCommandInput", + **kwargs: Any + ) -> 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 = "2021-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 + 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: Any + ) -> 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.v2021_07_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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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/v2021_07_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/__init__.py new file mode 100644 index 000000000000..5c63a367acd9 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/__init__.py @@ -0,0 +1,1089 @@ +# 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 ApplicationProfile + 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 CapacityReservation + from ._models_py3 import CapacityReservationGroup + from ._models_py3 import CapacityReservationGroupInstanceView + from ._models_py3 import CapacityReservationGroupListResult + from ._models_py3 import CapacityReservationGroupUpdate + from ._models_py3 import CapacityReservationInstanceView + from ._models_py3 import CapacityReservationInstanceViewWithName + from ._models_py3 import CapacityReservationListResult + from ._models_py3 import CapacityReservationProfile + from ._models_py3 import CapacityReservationUpdate + from ._models_py3 import CapacityReservationUtilization + from ._models_py3 import ComputeOperationListResult + from ._models_py3 import ComputeOperationValue + from ._models_py3 import DataDisk + from ._models_py3 import DataDiskImage + from ._models_py3 import DataDiskImageEncryption + 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 Disallowed + from ._models_py3 import DisallowedConfiguration + from ._models_py3 import DiskEncryptionSetParameters + from ._models_py3 import DiskEncryptionSettings + from ._models_py3 import DiskImageEncryption + from ._models_py3 import DiskInstanceView + from ._models_py3 import EncryptionImages + from ._models_py3 import ExtendedLocation + from ._models_py3 import Gallery + from ._models_py3 import GalleryApplication + from ._models_py3 import GalleryApplicationList + from ._models_py3 import GalleryApplicationUpdate + from ._models_py3 import GalleryApplicationVersion + from ._models_py3 import GalleryApplicationVersionList + from ._models_py3 import GalleryApplicationVersionPublishingProfile + from ._models_py3 import GalleryApplicationVersionUpdate + from ._models_py3 import GalleryArtifactPublishingProfileBase + from ._models_py3 import GalleryArtifactSource + from ._models_py3 import GalleryArtifactVersionSource + from ._models_py3 import GalleryDataDiskImage + from ._models_py3 import GalleryDiskImage + from ._models_py3 import GalleryIdentifier + from ._models_py3 import GalleryImage + from ._models_py3 import GalleryImageFeature + from ._models_py3 import GalleryImageIdentifier + from ._models_py3 import GalleryImageList + from ._models_py3 import GalleryImageUpdate + from ._models_py3 import GalleryImageVersion + from ._models_py3 import GalleryImageVersionList + from ._models_py3 import GalleryImageVersionPublishingProfile + from ._models_py3 import GalleryImageVersionStorageProfile + from ._models_py3 import GalleryImageVersionUpdate + from ._models_py3 import GalleryList + from ._models_py3 import GalleryOSDiskImage + from ._models_py3 import GalleryUpdate + 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 ImagePurchasePlan + 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 LinuxParameters + from ._models_py3 import LinuxPatchSettings + 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 ManagedArtifact + 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 OSDiskImageEncryption + from ._models_py3 import OSProfile + from ._models_py3 import OrchestrationServiceStateInput + from ._models_py3 import OrchestrationServiceSummary + from ._models_py3 import PatchInstallationDetail + from ._models_py3 import PatchSettings + from ._models_py3 import PirResource + from ._models_py3 import PirSharedGalleryResource + from ._models_py3 import Plan + from ._models_py3 import ProximityPlacementGroup + from ._models_py3 import ProximityPlacementGroupListResult + from ._models_py3 import ProximityPlacementGroupUpdate + from ._models_py3 import ProxyResource + from ._models_py3 import PublicIPAddressSku + from ._models_py3 import PurchasePlan + from ._models_py3 import RecommendedMachineConfiguration + from ._models_py3 import RecoveryWalkResponse + from ._models_py3 import RegionalReplicationStatus + from ._models_py3 import ReplicationStatus + from ._models_py3 import RequestRateByIntervalInput + from ._models_py3 import Resource + from ._models_py3 import ResourceRange + from ._models_py3 import ResourceSku + from ._models_py3 import ResourceSkuCapabilities + from ._models_py3 import ResourceSkuCapacity + from ._models_py3 import ResourceSkuCosts + from ._models_py3 import ResourceSkuLocationInfo + from ._models_py3 import ResourceSkuRestrictionInfo + from ._models_py3 import ResourceSkuRestrictions + from ._models_py3 import ResourceSkuZoneDetails + from ._models_py3 import ResourceSkusResult + from ._models_py3 import RestorePoint + from ._models_py3 import RestorePointCollection + from ._models_py3 import RestorePointCollectionListResult + from ._models_py3 import RestorePointCollectionSourceProperties + from ._models_py3 import RestorePointCollectionUpdate + from ._models_py3 import RestorePointProvisioningDetails + from ._models_py3 import RestorePointSourceMetadata + from ._models_py3 import RestorePointSourceVMDataDisk + from ._models_py3 import RestorePointSourceVMOSDisk + from ._models_py3 import RestorePointSourceVMStorageProfile + 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 SharedGallery + from ._models_py3 import SharedGalleryImage + from ._models_py3 import SharedGalleryImageList + from ._models_py3 import SharedGalleryImageVersion + from ._models_py3 import SharedGalleryImageVersionList + from ._models_py3 import SharedGalleryList + from ._models_py3 import SharingProfile + from ._models_py3 import SharingProfileGroup + from ._models_py3 import SharingUpdate + from ._models_py3 import Sku + from ._models_py3 import SoftDeletePolicy + from ._models_py3 import SpotRestorePolicy + 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 TargetRegion + from ._models_py3 import TerminateNotificationProfile + from ._models_py3 import ThrottledRequestsInput + from ._models_py3 import UefiSettings + from ._models_py3 import UpdateResource + from ._models_py3 import UpdateResourceDefinition + 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 UserArtifactManage + from ._models_py3 import UserArtifactSource + from ._models_py3 import UserAssignedIdentitiesValue + from ._models_py3 import VMGalleryApplication + from ._models_py3 import VMScaleSetConvertToSinglePlacementGroupInput + from ._models_py3 import VMSizeProperties + 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 VirtualMachineImageFeature + from ._models_py3 import VirtualMachineImageResource + from ._models_py3 import VirtualMachineInstallPatchesParameters + from ._models_py3 import VirtualMachineInstallPatchesResult + from ._models_py3 import VirtualMachineInstanceView + from ._models_py3 import VirtualMachineIpTag + from ._models_py3 import VirtualMachineListResult + from ._models_py3 import VirtualMachineNetworkInterfaceConfiguration + from ._models_py3 import VirtualMachineNetworkInterfaceDnsSettingsConfiguration + from ._models_py3 import VirtualMachineNetworkInterfaceIPConfiguration + from ._models_py3 import VirtualMachinePatchStatus + from ._models_py3 import VirtualMachinePublicIPAddressConfiguration + from ._models_py3 import VirtualMachinePublicIPAddressDnsSettingsConfiguration + from ._models_py3 import VirtualMachineReimageParameters + from ._models_py3 import VirtualMachineRunCommand + from ._models_py3 import VirtualMachineRunCommandInstanceView + from ._models_py3 import VirtualMachineRunCommandScriptSource + from ._models_py3 import VirtualMachineRunCommandUpdate + from ._models_py3 import VirtualMachineRunCommandsListResult + 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 VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue + 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 VirtualMachineScaleSetVMExtension + from ._models_py3 import VirtualMachineScaleSetVMExtensionUpdate + from ._models_py3 import VirtualMachineScaleSetVMExtensionsListResult + 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 + from ._models_py3 import WindowsParameters +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 ApplicationProfile # 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 CapacityReservation # type: ignore + from ._models import CapacityReservationGroup # type: ignore + from ._models import CapacityReservationGroupInstanceView # type: ignore + from ._models import CapacityReservationGroupListResult # type: ignore + from ._models import CapacityReservationGroupUpdate # type: ignore + from ._models import CapacityReservationInstanceView # type: ignore + from ._models import CapacityReservationInstanceViewWithName # type: ignore + from ._models import CapacityReservationListResult # type: ignore + from ._models import CapacityReservationProfile # type: ignore + from ._models import CapacityReservationUpdate # type: ignore + from ._models import CapacityReservationUtilization # 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 DataDiskImageEncryption # 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 Disallowed # type: ignore + from ._models import DisallowedConfiguration # type: ignore + from ._models import DiskEncryptionSetParameters # type: ignore + from ._models import DiskEncryptionSettings # type: ignore + from ._models import DiskImageEncryption # type: ignore + from ._models import DiskInstanceView # type: ignore + from ._models import EncryptionImages # type: ignore + from ._models import ExtendedLocation # type: ignore + from ._models import Gallery # type: ignore + from ._models import GalleryApplication # type: ignore + from ._models import GalleryApplicationList # type: ignore + from ._models import GalleryApplicationUpdate # type: ignore + from ._models import GalleryApplicationVersion # type: ignore + from ._models import GalleryApplicationVersionList # type: ignore + from ._models import GalleryApplicationVersionPublishingProfile # type: ignore + from ._models import GalleryApplicationVersionUpdate # type: ignore + from ._models import GalleryArtifactPublishingProfileBase # type: ignore + from ._models import GalleryArtifactSource # type: ignore + from ._models import GalleryArtifactVersionSource # type: ignore + from ._models import GalleryDataDiskImage # type: ignore + from ._models import GalleryDiskImage # type: ignore + from ._models import GalleryIdentifier # type: ignore + from ._models import GalleryImage # type: ignore + from ._models import GalleryImageFeature # type: ignore + from ._models import GalleryImageIdentifier # type: ignore + from ._models import GalleryImageList # type: ignore + from ._models import GalleryImageUpdate # type: ignore + from ._models import GalleryImageVersion # type: ignore + from ._models import GalleryImageVersionList # type: ignore + from ._models import GalleryImageVersionPublishingProfile # type: ignore + from ._models import GalleryImageVersionStorageProfile # type: ignore + from ._models import GalleryImageVersionUpdate # type: ignore + from ._models import GalleryList # type: ignore + from ._models import GalleryOSDiskImage # type: ignore + from ._models import GalleryUpdate # 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 ImagePurchasePlan # 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 LinuxParameters # type: ignore + from ._models import LinuxPatchSettings # 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 ManagedArtifact # 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 OSDiskImageEncryption # type: ignore + from ._models import OSProfile # type: ignore + from ._models import OrchestrationServiceStateInput # type: ignore + from ._models import OrchestrationServiceSummary # type: ignore + from ._models import PatchInstallationDetail # type: ignore + from ._models import PatchSettings # type: ignore + from ._models import PirResource # type: ignore + from ._models import PirSharedGalleryResource # 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 ProxyResource # type: ignore + from ._models import PublicIPAddressSku # type: ignore + from ._models import PurchasePlan # type: ignore + from ._models import RecommendedMachineConfiguration # type: ignore + from ._models import RecoveryWalkResponse # type: ignore + from ._models import RegionalReplicationStatus # type: ignore + from ._models import ReplicationStatus # type: ignore + from ._models import RequestRateByIntervalInput # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceRange # type: ignore + from ._models import ResourceSku # type: ignore + from ._models import ResourceSkuCapabilities # type: ignore + from ._models import ResourceSkuCapacity # type: ignore + from ._models import ResourceSkuCosts # type: ignore + from ._models import ResourceSkuLocationInfo # type: ignore + from ._models import ResourceSkuRestrictionInfo # type: ignore + from ._models import ResourceSkuRestrictions # type: ignore + from ._models import ResourceSkuZoneDetails # type: ignore + from ._models import ResourceSkusResult # type: ignore + from ._models import RestorePoint # type: ignore + from ._models import RestorePointCollection # type: ignore + from ._models import RestorePointCollectionListResult # type: ignore + from ._models import RestorePointCollectionSourceProperties # type: ignore + from ._models import RestorePointCollectionUpdate # type: ignore + from ._models import RestorePointProvisioningDetails # type: ignore + from ._models import RestorePointSourceMetadata # type: ignore + from ._models import RestorePointSourceVMDataDisk # type: ignore + from ._models import RestorePointSourceVMOSDisk # type: ignore + from ._models import RestorePointSourceVMStorageProfile # 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 SharedGallery # type: ignore + from ._models import SharedGalleryImage # type: ignore + from ._models import SharedGalleryImageList # type: ignore + from ._models import SharedGalleryImageVersion # type: ignore + from ._models import SharedGalleryImageVersionList # type: ignore + from ._models import SharedGalleryList # type: ignore + from ._models import SharingProfile # type: ignore + from ._models import SharingProfileGroup # type: ignore + from ._models import SharingUpdate # type: ignore + from ._models import Sku # type: ignore + from ._models import SoftDeletePolicy # type: ignore + from ._models import SpotRestorePolicy # 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 TargetRegion # type: ignore + from ._models import TerminateNotificationProfile # type: ignore + from ._models import ThrottledRequestsInput # type: ignore + from ._models import UefiSettings # type: ignore + from ._models import UpdateResource # type: ignore + from ._models import UpdateResourceDefinition # 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 UserArtifactManage # type: ignore + from ._models import UserArtifactSource # type: ignore + from ._models import UserAssignedIdentitiesValue # type: ignore + from ._models import VMGalleryApplication # type: ignore + from ._models import VMScaleSetConvertToSinglePlacementGroupInput # type: ignore + from ._models import VMSizeProperties # 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 VirtualMachineImageFeature # type: ignore + from ._models import VirtualMachineImageResource # type: ignore + from ._models import VirtualMachineInstallPatchesParameters # type: ignore + from ._models import VirtualMachineInstallPatchesResult # type: ignore + from ._models import VirtualMachineInstanceView # type: ignore + from ._models import VirtualMachineIpTag # type: ignore + from ._models import VirtualMachineListResult # type: ignore + from ._models import VirtualMachineNetworkInterfaceConfiguration # type: ignore + from ._models import VirtualMachineNetworkInterfaceDnsSettingsConfiguration # type: ignore + from ._models import VirtualMachineNetworkInterfaceIPConfiguration # type: ignore + from ._models import VirtualMachinePatchStatus # type: ignore + from ._models import VirtualMachinePublicIPAddressConfiguration # type: ignore + from ._models import VirtualMachinePublicIPAddressDnsSettingsConfiguration # type: ignore + from ._models import VirtualMachineReimageParameters # type: ignore + from ._models import VirtualMachineRunCommand # type: ignore + from ._models import VirtualMachineRunCommandInstanceView # type: ignore + from ._models import VirtualMachineRunCommandScriptSource # type: ignore + from ._models import VirtualMachineRunCommandUpdate # type: ignore + from ._models import VirtualMachineRunCommandsListResult # 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 VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue # 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 VirtualMachineScaleSetVMExtension # type: ignore + from ._models import VirtualMachineScaleSetVMExtensionUpdate # type: ignore + from ._models import VirtualMachineScaleSetVMExtensionsListResult # 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 ._models import WindowsParameters # type: ignore + +from ._compute_management_client_enums import ( + AggregatedReplicationState, + AvailabilitySetSkuTypes, + CachingTypes, + CapacityReservationGroupInstanceViewTypes, + CapacityReservationInstanceViewTypes, + ConsistencyModeTypes, + DedicatedHostLicenseTypes, + DeleteOptions, + DiffDiskOptions, + DiffDiskPlacement, + DiskCreateOptionTypes, + DiskDeleteOptionTypes, + DiskDetachOptionTypes, + ExecutionState, + ExpandTypesForGetCapacityReservationGroups, + ExpandTypesForGetVMScaleSets, + ExtendedLocationType, + ExtendedLocationTypes, + GalleryApplicationVersionPropertiesProvisioningState, + GalleryImagePropertiesProvisioningState, + GalleryImageVersionPropertiesProvisioningState, + GalleryPropertiesProvisioningState, + GallerySharingPermissionTypes, + HostCaching, + HyperVGeneration, + HyperVGenerationType, + HyperVGenerationTypes, + IPVersion, + IPVersions, + InstanceViewTypes, + IntervalInMins, + LinuxPatchAssessmentMode, + LinuxVMGuestPatchMode, + MaintenanceOperationResultCodeTypes, + NetworkApiVersion, + OperatingSystemStateTypes, + OperatingSystemType, + OperatingSystemTypes, + OrchestrationMode, + OrchestrationServiceNames, + OrchestrationServiceState, + OrchestrationServiceStateAction, + PatchAssessmentState, + PatchInstallationState, + PatchOperationStatus, + ProtocolTypes, + ProximityPlacementGroupType, + PublicIPAddressSkuName, + PublicIPAddressSkuTier, + PublicIPAllocationMethod, + ReplicationMode, + ReplicationState, + ReplicationStatusTypes, + ResourceIdentityType, + ResourceSkuCapacityScaleType, + ResourceSkuRestrictionsReasonCode, + ResourceSkuRestrictionsType, + RestorePointCollectionExpandOptions, + RollingUpgradeActionType, + RollingUpgradeStatusCode, + SecurityTypes, + SelectPermissions, + SettingNames, + SharedToValues, + SharingProfileGroupTypes, + SharingUpdateOperationTypes, + StatusLevelTypes, + StorageAccountType, + StorageAccountTypes, + UpgradeMode, + UpgradeOperationInvoker, + UpgradeState, + VMGuestPatchClassificationLinux, + VMGuestPatchClassificationWindows, + VMGuestPatchRebootBehavior, + VMGuestPatchRebootSetting, + VMGuestPatchRebootStatus, + VirtualMachineEvictionPolicyTypes, + VirtualMachinePriorityTypes, + VirtualMachineScaleSetScaleInRules, + VirtualMachineScaleSetSkuScaleType, + VirtualMachineSizeTypes, + VmDiskTypes, + WindowsPatchAssessmentMode, + WindowsVMGuestPatchMode, +) + +__all__ = [ + 'AdditionalCapabilities', + 'AdditionalUnattendContent', + 'ApiEntityReference', + 'ApiError', + 'ApiErrorBase', + 'ApplicationProfile', + 'AutomaticOSUpgradePolicy', + 'AutomaticOSUpgradeProperties', + 'AutomaticRepairsPolicy', + 'AvailabilitySet', + 'AvailabilitySetListResult', + 'AvailabilitySetUpdate', + 'AvailablePatchSummary', + 'BillingProfile', + 'BootDiagnostics', + 'BootDiagnosticsInstanceView', + 'CapacityReservation', + 'CapacityReservationGroup', + 'CapacityReservationGroupInstanceView', + 'CapacityReservationGroupListResult', + 'CapacityReservationGroupUpdate', + 'CapacityReservationInstanceView', + 'CapacityReservationInstanceViewWithName', + 'CapacityReservationListResult', + 'CapacityReservationProfile', + 'CapacityReservationUpdate', + 'CapacityReservationUtilization', + 'ComputeOperationListResult', + 'ComputeOperationValue', + 'DataDisk', + 'DataDiskImage', + 'DataDiskImageEncryption', + 'DedicatedHost', + 'DedicatedHostAllocatableVM', + 'DedicatedHostAvailableCapacity', + 'DedicatedHostGroup', + 'DedicatedHostGroupInstanceView', + 'DedicatedHostGroupListResult', + 'DedicatedHostGroupUpdate', + 'DedicatedHostInstanceView', + 'DedicatedHostInstanceViewWithName', + 'DedicatedHostListResult', + 'DedicatedHostUpdate', + 'DiagnosticsProfile', + 'DiffDiskSettings', + 'Disallowed', + 'DisallowedConfiguration', + 'DiskEncryptionSetParameters', + 'DiskEncryptionSettings', + 'DiskImageEncryption', + 'DiskInstanceView', + 'EncryptionImages', + 'ExtendedLocation', + 'Gallery', + 'GalleryApplication', + 'GalleryApplicationList', + 'GalleryApplicationUpdate', + 'GalleryApplicationVersion', + 'GalleryApplicationVersionList', + 'GalleryApplicationVersionPublishingProfile', + 'GalleryApplicationVersionUpdate', + 'GalleryArtifactPublishingProfileBase', + 'GalleryArtifactSource', + 'GalleryArtifactVersionSource', + 'GalleryDataDiskImage', + 'GalleryDiskImage', + 'GalleryIdentifier', + 'GalleryImage', + 'GalleryImageFeature', + 'GalleryImageIdentifier', + 'GalleryImageList', + 'GalleryImageUpdate', + 'GalleryImageVersion', + 'GalleryImageVersionList', + 'GalleryImageVersionPublishingProfile', + 'GalleryImageVersionStorageProfile', + 'GalleryImageVersionUpdate', + 'GalleryList', + 'GalleryOSDiskImage', + 'GalleryUpdate', + 'HardwareProfile', + 'Image', + 'ImageDataDisk', + 'ImageDisk', + 'ImageListResult', + 'ImageOSDisk', + 'ImagePurchasePlan', + 'ImageReference', + 'ImageStorageProfile', + 'ImageUpdate', + 'InnerError', + 'InstanceViewStatus', + 'KeyVaultKeyReference', + 'KeyVaultSecretReference', + 'LastPatchInstallationSummary', + 'LinuxConfiguration', + 'LinuxParameters', + 'LinuxPatchSettings', + 'ListUsagesResult', + 'LogAnalyticsInputBase', + 'LogAnalyticsOperationResult', + 'LogAnalyticsOutput', + 'MaintenanceRedeployStatus', + 'ManagedArtifact', + 'ManagedDiskParameters', + 'NetworkInterfaceReference', + 'NetworkProfile', + 'OSDisk', + 'OSDiskImage', + 'OSDiskImageEncryption', + 'OSProfile', + 'OrchestrationServiceStateInput', + 'OrchestrationServiceSummary', + 'PatchInstallationDetail', + 'PatchSettings', + 'PirResource', + 'PirSharedGalleryResource', + 'Plan', + 'ProximityPlacementGroup', + 'ProximityPlacementGroupListResult', + 'ProximityPlacementGroupUpdate', + 'ProxyResource', + 'PublicIPAddressSku', + 'PurchasePlan', + 'RecommendedMachineConfiguration', + 'RecoveryWalkResponse', + 'RegionalReplicationStatus', + 'ReplicationStatus', + 'RequestRateByIntervalInput', + 'Resource', + 'ResourceRange', + 'ResourceSku', + 'ResourceSkuCapabilities', + 'ResourceSkuCapacity', + 'ResourceSkuCosts', + 'ResourceSkuLocationInfo', + 'ResourceSkuRestrictionInfo', + 'ResourceSkuRestrictions', + 'ResourceSkuZoneDetails', + 'ResourceSkusResult', + 'RestorePoint', + 'RestorePointCollection', + 'RestorePointCollectionListResult', + 'RestorePointCollectionSourceProperties', + 'RestorePointCollectionUpdate', + 'RestorePointProvisioningDetails', + 'RestorePointSourceMetadata', + 'RestorePointSourceVMDataDisk', + 'RestorePointSourceVMOSDisk', + 'RestorePointSourceVMStorageProfile', + 'RetrieveBootDiagnosticsDataResult', + 'RollbackStatusInfo', + 'RollingUpgradePolicy', + 'RollingUpgradeProgressInfo', + 'RollingUpgradeRunningStatus', + 'RollingUpgradeStatusInfo', + 'RunCommandDocument', + 'RunCommandDocumentBase', + 'RunCommandInput', + 'RunCommandInputParameter', + 'RunCommandListResult', + 'RunCommandParameterDefinition', + 'RunCommandResult', + 'ScaleInPolicy', + 'ScheduledEventsProfile', + 'SecurityProfile', + 'SharedGallery', + 'SharedGalleryImage', + 'SharedGalleryImageList', + 'SharedGalleryImageVersion', + 'SharedGalleryImageVersionList', + 'SharedGalleryList', + 'SharingProfile', + 'SharingProfileGroup', + 'SharingUpdate', + 'Sku', + 'SoftDeletePolicy', + 'SpotRestorePolicy', + 'SshConfiguration', + 'SshPublicKey', + 'SshPublicKeyGenerateKeyPairResult', + 'SshPublicKeyResource', + 'SshPublicKeyUpdateResource', + 'SshPublicKeysGroupListResult', + 'StorageProfile', + 'SubResource', + 'SubResourceReadOnly', + 'SubResourceWithColocationStatus', + 'TargetRegion', + 'TerminateNotificationProfile', + 'ThrottledRequestsInput', + 'UefiSettings', + 'UpdateResource', + 'UpdateResourceDefinition', + 'UpgradeOperationHistoricalStatusInfo', + 'UpgradeOperationHistoricalStatusInfoProperties', + 'UpgradeOperationHistoryStatus', + 'UpgradePolicy', + 'Usage', + 'UsageName', + 'UserArtifactManage', + 'UserArtifactSource', + 'UserAssignedIdentitiesValue', + 'VMGalleryApplication', + 'VMScaleSetConvertToSinglePlacementGroupInput', + 'VMSizeProperties', + 'VaultCertificate', + 'VaultSecretGroup', + 'VirtualHardDisk', + 'VirtualMachine', + 'VirtualMachineAgentInstanceView', + 'VirtualMachineAssessPatchesResult', + 'VirtualMachineCaptureParameters', + 'VirtualMachineCaptureResult', + 'VirtualMachineExtension', + 'VirtualMachineExtensionHandlerInstanceView', + 'VirtualMachineExtensionImage', + 'VirtualMachineExtensionInstanceView', + 'VirtualMachineExtensionUpdate', + 'VirtualMachineExtensionsListResult', + 'VirtualMachineHealthStatus', + 'VirtualMachineIdentity', + 'VirtualMachineImage', + 'VirtualMachineImageFeature', + 'VirtualMachineImageResource', + 'VirtualMachineInstallPatchesParameters', + 'VirtualMachineInstallPatchesResult', + 'VirtualMachineInstanceView', + 'VirtualMachineIpTag', + 'VirtualMachineListResult', + 'VirtualMachineNetworkInterfaceConfiguration', + 'VirtualMachineNetworkInterfaceDnsSettingsConfiguration', + 'VirtualMachineNetworkInterfaceIPConfiguration', + 'VirtualMachinePatchStatus', + 'VirtualMachinePublicIPAddressConfiguration', + 'VirtualMachinePublicIPAddressDnsSettingsConfiguration', + 'VirtualMachineReimageParameters', + 'VirtualMachineRunCommand', + 'VirtualMachineRunCommandInstanceView', + 'VirtualMachineRunCommandScriptSource', + 'VirtualMachineRunCommandUpdate', + 'VirtualMachineRunCommandsListResult', + 'VirtualMachineScaleSet', + 'VirtualMachineScaleSetDataDisk', + 'VirtualMachineScaleSetExtension', + 'VirtualMachineScaleSetExtensionListResult', + 'VirtualMachineScaleSetExtensionProfile', + 'VirtualMachineScaleSetExtensionUpdate', + 'VirtualMachineScaleSetIPConfiguration', + 'VirtualMachineScaleSetIdentity', + 'VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue', + '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', + 'VirtualMachineScaleSetVMExtension', + 'VirtualMachineScaleSetVMExtensionUpdate', + 'VirtualMachineScaleSetVMExtensionsListResult', + 'VirtualMachineScaleSetVMExtensionsSummary', + 'VirtualMachineScaleSetVMInstanceIDs', + 'VirtualMachineScaleSetVMInstanceRequiredIDs', + 'VirtualMachineScaleSetVMInstanceView', + 'VirtualMachineScaleSetVMListResult', + 'VirtualMachineScaleSetVMNetworkProfileConfiguration', + 'VirtualMachineScaleSetVMProfile', + 'VirtualMachineScaleSetVMProtectionPolicy', + 'VirtualMachineScaleSetVMReimageParameters', + 'VirtualMachineSize', + 'VirtualMachineSizeListResult', + 'VirtualMachineSoftwarePatchProperties', + 'VirtualMachineStatusCodeCount', + 'VirtualMachineUpdate', + 'WinRMConfiguration', + 'WinRMListener', + 'WindowsConfiguration', + 'WindowsParameters', + 'AggregatedReplicationState', + 'AvailabilitySetSkuTypes', + 'CachingTypes', + 'CapacityReservationGroupInstanceViewTypes', + 'CapacityReservationInstanceViewTypes', + 'ConsistencyModeTypes', + 'DedicatedHostLicenseTypes', + 'DeleteOptions', + 'DiffDiskOptions', + 'DiffDiskPlacement', + 'DiskCreateOptionTypes', + 'DiskDeleteOptionTypes', + 'DiskDetachOptionTypes', + 'ExecutionState', + 'ExpandTypesForGetCapacityReservationGroups', + 'ExpandTypesForGetVMScaleSets', + 'ExtendedLocationType', + 'ExtendedLocationTypes', + 'GalleryApplicationVersionPropertiesProvisioningState', + 'GalleryImagePropertiesProvisioningState', + 'GalleryImageVersionPropertiesProvisioningState', + 'GalleryPropertiesProvisioningState', + 'GallerySharingPermissionTypes', + 'HostCaching', + 'HyperVGeneration', + 'HyperVGenerationType', + 'HyperVGenerationTypes', + 'IPVersion', + 'IPVersions', + 'InstanceViewTypes', + 'IntervalInMins', + 'LinuxPatchAssessmentMode', + 'LinuxVMGuestPatchMode', + 'MaintenanceOperationResultCodeTypes', + 'NetworkApiVersion', + 'OperatingSystemStateTypes', + 'OperatingSystemType', + 'OperatingSystemTypes', + 'OrchestrationMode', + 'OrchestrationServiceNames', + 'OrchestrationServiceState', + 'OrchestrationServiceStateAction', + 'PatchAssessmentState', + 'PatchInstallationState', + 'PatchOperationStatus', + 'ProtocolTypes', + 'ProximityPlacementGroupType', + 'PublicIPAddressSkuName', + 'PublicIPAddressSkuTier', + 'PublicIPAllocationMethod', + 'ReplicationMode', + 'ReplicationState', + 'ReplicationStatusTypes', + 'ResourceIdentityType', + 'ResourceSkuCapacityScaleType', + 'ResourceSkuRestrictionsReasonCode', + 'ResourceSkuRestrictionsType', + 'RestorePointCollectionExpandOptions', + 'RollingUpgradeActionType', + 'RollingUpgradeStatusCode', + 'SecurityTypes', + 'SelectPermissions', + 'SettingNames', + 'SharedToValues', + 'SharingProfileGroupTypes', + 'SharingUpdateOperationTypes', + 'StatusLevelTypes', + 'StorageAccountType', + 'StorageAccountTypes', + 'UpgradeMode', + 'UpgradeOperationInvoker', + 'UpgradeState', + 'VMGuestPatchClassificationLinux', + 'VMGuestPatchClassificationWindows', + 'VMGuestPatchRebootBehavior', + 'VMGuestPatchRebootSetting', + 'VMGuestPatchRebootStatus', + 'VirtualMachineEvictionPolicyTypes', + 'VirtualMachinePriorityTypes', + 'VirtualMachineScaleSetScaleInRules', + 'VirtualMachineScaleSetSkuScaleType', + 'VirtualMachineSizeTypes', + 'VmDiskTypes', + 'WindowsPatchAssessmentMode', + 'WindowsVMGuestPatchMode', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_compute_management_client_enums.py new file mode 100644 index 000000000000..9f2bcaf8ea39 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_compute_management_client_enums.py @@ -0,0 +1,925 @@ +# 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 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" + +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 CapacityReservationGroupInstanceViewTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + INSTANCE_VIEW = "instanceView" + +class CapacityReservationInstanceViewTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + INSTANCE_VIEW = "instanceView" + +class ConsistencyModeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets the consistency mode for the restore point. Please refer to https://aka.ms/RestorePoints + for more details. + """ + + CRASH_CONSISTENT = "CrashConsistent" + FILE_SYSTEM_CONSISTENT = "FileSystemConsistent" + APPLICATION_CONSISTENT = "ApplicationConsistent" + +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 DeleteOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specify what happens to the network interface when the VM is deleted + """ + + DELETE = "Delete" + DETACH = "Detach" + +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/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements + and Linux VM at + https://docs.microsoft.com/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 DiskDeleteOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the behavior of the managed disk when the VM gets deleted i.e whether the managed + disk is deleted or detached. Supported values::code:`
`:code:`
` **Delete** If this value + is used, the managed disk is deleted when VM gets deleted.:code:`
`:code:`
` **Detach** + If this value is used, the managed disk is retained after VM gets + deleted.:code:`
`:code:`
` Minimum api-version: 2021-03-01 + """ + + DELETE = "Delete" + DETACH = "Detach" + +class DiskDetachOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the detach behavior to be used while detaching a disk or which is already in the + process of detachment from the virtual machine. Supported values: **ForceDetach**. + :code:`
`:code:`
` detachOption: **ForceDetach** is applicable only for managed data + disks. If a previous detachment attempt of the data disk did not complete due to an unexpected + failure from the virtual machine and the disk is still not released then use force-detach as a + last resort option to detach the disk forcibly from the VM. All writes might not have been + flushed when using this detach behavior. :code:`
`:code:`
` This feature is still in + preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk + update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. + """ + + FORCE_DETACH = "ForceDetach" + +class ExecutionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Script execution status. + """ + + UNKNOWN = "Unknown" + PENDING = "Pending" + RUNNING = "Running" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + TIMED_OUT = "TimedOut" + CANCELED = "Canceled" + +class ExpandTypesForGetCapacityReservationGroups(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + VIRTUAL_MACHINE_SCALE_SET_VMS_REF = "virtualMachineScaleSetVMs/$ref" + VIRTUAL_MACHINES_REF = "virtualMachines/$ref" + +class ExpandTypesForGetVMScaleSets(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + USER_DATA = "userData" + +class ExtendedLocationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the extended location. + """ + + EDGE_ZONE = "EdgeZone" + +class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of extendedLocation. + """ + + EDGE_ZONE = "EdgeZone" + +class GalleryApplicationVersionPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The provisioning state, which only appears in the response. + """ + + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" + +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" + +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" + +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" + +class GallerySharingPermissionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This property allows you to specify the permission of sharing gallery. :code:`
`:code:`
` + Possible values are: :code:`
`:code:`
` **Private** :code:`
`:code:`
` **Groups** + """ + + PRIVATE = "Private" + GROUPS = "Groups" + +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" + +class HyperVGeneration(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + """ + + V1 = "V1" + V2 = "V2" + +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 InstanceViewTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + INSTANCE_VIEW = "instanceView" + USER_DATA = "userData" + +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 IPVersions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """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'. + """ + + I_PV4 = "IPv4" + I_PV6 = "IPv6" + +class LinuxPatchAssessmentMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **ImageDefault** - You + control the timing of patch assessments on a virtual machine. :code:`
`:code:`
` + **AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property + provisionVMAgent must be true. + """ + + IMAGE_DEFAULT = "ImageDefault" + AUTOMATIC_BY_PLATFORM = "AutomaticByPlatform" + +class LinuxVMGuestPatchMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated + to virtual machine scale set with OrchestrationMode as Flexible.:code:`
`:code:`
` + Possible values are::code:`
`:code:`
` **ImageDefault** - The virtual machine's + default patching configuration is used. :code:`
`:code:`
` **AutomaticByPlatform** - + The virtual machine will be automatically updated by the platform. The property + provisionVMAgent must be true + """ + + IMAGE_DEFAULT = "ImageDefault" + AUTOMATIC_BY_PLATFORM = "AutomaticByPlatform" + +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 NetworkApiVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """specifies the Microsoft.Network API version used when creating networking resources in the + Network Interface Configurations + """ + + TWO_THOUSAND_TWENTY11_01 = "2020-11-01" + +class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The OS State. + """ + + #: Generalized image. Needs to be provisioned during deployment time. + GENERALIZED = "Generalized" + #: Specialized image. Contains already provisioned OS Disk. + SPECIALIZED = "Specialized" + +class OperatingSystemType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets the Operating System type. + """ + + WINDOWS = "Windows" + LINUX = "Linux" + +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The operating system of the osDiskImage. + """ + + WINDOWS = "Windows" + LINUX = "Linux" + +class OrchestrationMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the orchestration mode for the virtual machine scale set. + """ + + UNIFORM = "Uniform" + FLEXIBLE = "Flexible" + +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 availability of a given patch. + """ + + UNKNOWN = "Unknown" + AVAILABLE = "Available" + +class PatchInstallationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The state of the patch after the installation operation completed. + """ + + UNKNOWN = "Unknown" + INSTALLED = "Installed" + FAILED = "Failed" + EXCLUDED = "Excluded" + NOT_SELECTED = "NotSelected" + PENDING = "Pending" + +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 "Unknown", "Failed", "Succeeded", or + "CompletedWithWarnings." + """ + + UNKNOWN = "Unknown" + 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 PublicIPAddressSkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specify public IP sku name + """ + + BASIC = "Basic" + STANDARD = "Standard" + +class PublicIPAddressSkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specify public IP sku tier + """ + + REGIONAL = "Regional" + GLOBAL_ENUM = "Global" + +class PublicIPAllocationMethod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specify the public IP allocation type + """ + + DYNAMIC = "Dynamic" + STATIC = "Static" + +class ReplicationMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Optional parameter which specifies the mode to be used for replication. This property is not + updatable. + """ + + FULL = "Full" + SHALLOW = "Shallow" + +class ReplicationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This is the regional replication state. + """ + + UNKNOWN = "Unknown" + REPLICATING = "Replicating" + COMPLETED = "Completed" + FAILED = "Failed" + +class ReplicationStatusTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REPLICATION_STATUS = "ReplicationStatus" + +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 ResourceSkuCapacityScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The scale type applicable to the sku. + """ + + AUTOMATIC = "Automatic" + MANUAL = "Manual" + NONE = "None" + +class ResourceSkuRestrictionsReasonCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The reason for restriction. + """ + + QUOTA_ID = "QuotaId" + NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" + +class ResourceSkuRestrictionsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of restrictions. + """ + + LOCATION = "Location" + ZONE = "Zone" + +class RestorePointCollectionExpandOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + RESTORE_POINTS = "restorePoints" + +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 SecurityTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to enable + UefiSettings. :code:`
`:code:`
` Default: UefiSettings will not be enabled unless this + property is set as TrustedLaunch. + """ + + TRUSTED_LAUNCH = "TrustedLaunch" + +class SelectPermissions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + PERMISSIONS = "Permissions" + +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 SharedToValues(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + TENANT = "tenant" + +class SharingProfileGroupTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This property allows you to specify the type of sharing group. :code:`
`:code:`
` + Possible values are: :code:`
`:code:`
` **Subscriptions** :code:`
`:code:`
` + **AADTenants** + """ + + SUBSCRIPTIONS = "Subscriptions" + AAD_TENANTS = "AADTenants" + +class SharingUpdateOperationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This property allows you to specify the operation type of gallery sharing update. + :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Add** + :code:`
`:code:`
` **Remove** :code:`
`:code:`
` **Reset** + """ + + ADD = "Add" + REMOVE = "Remove" + RESET = "Reset" + +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The level code. + """ + + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" + +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" + +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. Premium_ZRS uses + Premium SSD zone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant storage. + For more information regarding disks supported for Windows Virtual Machines, refer to + https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for Linux Virtual + Machines, refer to https://docs.microsoft.com/azure/virtual-machines/linux/disks-types + """ + + STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" + STANDARD_SSD_LRS = "StandardSSD_LRS" + ULTRA_SSD_LRS = "UltraSSD_LRS" + PREMIUM_ZRS = "Premium_ZRS" + STANDARD_SSD_ZRS = "StandardSSD_ZRS" + +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. :code:`
`:code:`
` The enum data type is + currently deprecated and will be removed by December 23rd 2023. :code:`
`:code:`
` + Recommended way to get the list of available sizes is using 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 + `_. For more + information about virtual machine sizes, see `Sizes for virtual machines + `_. :code:`
`:code:`
` The + available VM sizes depend on region and availability set. + """ + + 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" + +class VMGuestPatchClassificationLinux(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + CRITICAL = "Critical" + SECURITY = "Security" + OTHER = "Other" + +class VMGuestPatchClassificationWindows(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + CRITICAL = "Critical" + SECURITY = "Security" + UPDATE_ROLL_UP = "UpdateRollUp" + FEATURE_PACK = "FeaturePack" + SERVICE_PACK = "ServicePack" + DEFINITION = "Definition" + TOOLS = "Tools" + UPDATES = "Updates" + +class VMGuestPatchRebootBehavior(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Describes the reboot requirements of the patch. + """ + + UNKNOWN = "Unknown" + NEVER_REBOOTS = "NeverReboots" + ALWAYS_REQUIRES_REBOOT = "AlwaysRequiresReboot" + CAN_REQUEST_REBOOT = "CanRequestReboot" + +class VMGuestPatchRebootSetting(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines when it is acceptable to reboot a VM during a software update operation. + """ + + IF_REQUIRED = "IfRequired" + NEVER = "Never" + ALWAYS = "Always" + +class VMGuestPatchRebootStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The reboot state of the VM following completion of the operation. + """ + + UNKNOWN = "Unknown" + NOT_NEEDED = "NotNeeded" + REQUIRED = "Required" + STARTED = "Started" + FAILED = "Failed" + COMPLETED = "Completed" + +class WindowsPatchAssessmentMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **ImageDefault** - You + control the timing of patch assessments on a virtual machine.:code:`
`:code:`
` + **AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property + provisionVMAgent must be true. + """ + + IMAGE_DEFAULT = "ImageDefault" + AUTOMATIC_BY_PLATFORM = "AutomaticByPlatform" + +class WindowsVMGuestPatchMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated + to virtual machine scale set with OrchestrationMode as Flexible.: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" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models.py new file mode 100644 index 000000000000..9d5f904cd057 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models.py @@ -0,0 +1,12874 @@ +# 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 + :param hibernation_enabled: The flag that enables or disables hibernation capability on the VM. + :type hibernation_enabled: bool + """ + + _attribute_map = { + 'ultra_ssd_enabled': {'key': 'ultraSSDEnabled', 'type': 'bool'}, + 'hibernation_enabled': {'key': 'hibernationEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AdditionalCapabilities, self).__init__(**kwargs) + self.ultra_ssd_enabled = kwargs.get('ultra_ssd_enabled', None) + self.hibernation_enabled = kwargs.get('hibernation_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. + + :param pass_name: The pass name. Currently, the only allowable value is OobeSystem. The only + acceptable values to pass in are None and "OobeSystem". The default value is None. + :type pass_name: str + :param component_name: The component name. Currently, the only allowable value is + Microsoft-Windows-Shell-Setup. The only acceptable values to pass in are None and + "Microsoft-Windows-Shell-Setup". The default value is None. + :type 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.v2021_07_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 + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.pass_name = kwargs.get('pass_name', None) + self.component_name = kwargs.get('component_name', None) + 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.v2021_07_01.models.ApiErrorBase] + :param innererror: The Api inner error. + :type innererror: ~azure.mgmt.compute.v2021_07_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 ApplicationProfile(msrest.serialization.Model): + """Contains the list of gallery applications that should be made available to the VM/VMSS. + + :param gallery_applications: Specifies the gallery applications that should be made available + to the VM/VMSS. + :type gallery_applications: list[~azure.mgmt.compute.v2021_07_01.models.VMGalleryApplication] + """ + + _attribute_map = { + 'gallery_applications': {'key': 'galleryApplications', 'type': '[VMGalleryApplication]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationProfile, self).__init__(**kwargs) + self.gallery_applications = kwargs.get('gallery_applications', 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 `Availability sets overview `_. :code:`
`:code:`
` For more information on Azure planned maintenance, see `Maintenance and updates 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.v2021_07_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.v2021_07_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.v2021_07_01.models.SubResource + :ivar statuses: The resource status information. + :vartype statuses: list[~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.SubResource + :ivar statuses: The resource status information. + :vartype statuses: list[~azure.mgmt.compute.v2021_07_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 "Unknown", "Failed", "Succeeded", + or "CompletedWithWarnings.". Possible values include: "Unknown", "InProgress", "Failed", + "Succeeded", "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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 CapacityReservation(Resource): + """Specifies information about the capacity reservation. + + 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 resource for which capacity needs be reserved. The SKU name + and capacity is required to be set. Currently VM Skus with the capability called + 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs + in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported + values. + :type sku: ~azure.mgmt.compute.v2021_07_01.models.Sku + :param zones: Availability Zone to use for this capacity reservation. The zone has to be single + value and also should be part for the list of zones specified during the capacity reservation + group creation. The zone can be assigned only during creation. If not provided, the reservation + supports only non-zonal deployments. If provided, enforces VM/VMSS using this capacity + reservation to be in same zone. + :type zones: list[str] + :ivar reservation_id: A unique id generated and assigned to the capacity reservation by the + platform which does not change throughout the lifetime of the resource. + :vartype reservation_id: str + :ivar virtual_machines_associated: A list of all virtual machine resource ids that are + associated with the capacity reservation. + :vartype virtual_machines_associated: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + :ivar provisioning_time: The date time when the capacity reservation was last updated. + :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 Capacity reservation instance view. + :vartype instance_view: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'reservation_id': {'readonly': True}, + 'virtual_machines_associated': {'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'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'virtual_machines_associated': {'key': 'properties.virtualMachinesAssociated', 'type': '[SubResourceReadOnly]'}, + 'provisioning_time': {'key': 'properties.provisioningTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'CapacityReservationInstanceView'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacityReservation, self).__init__(**kwargs) + self.sku = kwargs['sku'] + self.zones = kwargs.get('zones', None) + self.reservation_id = None + self.virtual_machines_associated = None + self.provisioning_time = None + self.provisioning_state = None + self.instance_view = None + + +class CapacityReservationGroup(Resource): + """Specifies information about the capacity reservation group that the capacity reservations should be assigned to. :code:`
`:code:`
` Currently, a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation cannot be added or moved to another capacity reservation 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 Zones to use for this capacity reservation group. The zones can be + assigned only during creation. If not provided, the group supports only regional resources in + the region. If provided, enforces each capacity reservation in the group to be in one of the + zones. + :type zones: list[str] + :ivar capacity_reservations: A list of all capacity reservation resource ids that belong to + capacity reservation group. + :vartype capacity_reservations: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + :ivar virtual_machines_associated: A list of references to all virtual machines associated to + the capacity reservation group. + :vartype virtual_machines_associated: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + :ivar instance_view: The capacity reservation group instance view which has the list of + instance views for all the capacity reservations that belong to the capacity reservation group. + :vartype instance_view: + ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroupInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'capacity_reservations': {'readonly': True}, + 'virtual_machines_associated': {'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]'}, + 'capacity_reservations': {'key': 'properties.capacityReservations', 'type': '[SubResourceReadOnly]'}, + 'virtual_machines_associated': {'key': 'properties.virtualMachinesAssociated', 'type': '[SubResourceReadOnly]'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'CapacityReservationGroupInstanceView'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacityReservationGroup, self).__init__(**kwargs) + self.zones = kwargs.get('zones', None) + self.capacity_reservations = None + self.virtual_machines_associated = None + self.instance_view = None + + +class CapacityReservationGroupInstanceView(msrest.serialization.Model): + """CapacityReservationGroupInstanceView. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar capacity_reservations: List of instance view of the capacity reservations under the + capacity reservation group. + :vartype capacity_reservations: + list[~azure.mgmt.compute.v2021_07_01.models.CapacityReservationInstanceViewWithName] + """ + + _validation = { + 'capacity_reservations': {'readonly': True}, + } + + _attribute_map = { + 'capacity_reservations': {'key': 'capacityReservations', 'type': '[CapacityReservationInstanceViewWithName]'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacityReservationGroupInstanceView, self).__init__(**kwargs) + self.capacity_reservations = None + + +class CapacityReservationGroupListResult(msrest.serialization.Model): + """The List capacity reservation group with resource group response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of capacity reservation groups. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroup] + :param next_link: The URI to fetch the next page of capacity reservation groups. Call + ListNext() with this URI to fetch the next page of capacity reservation groups. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CapacityReservationGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacityReservationGroupListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class CapacityReservationGroupUpdate(UpdateResource): + """Specifies information about the capacity reservation group. Only tags can 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] + :ivar capacity_reservations: A list of all capacity reservation resource ids that belong to + capacity reservation group. + :vartype capacity_reservations: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + :ivar virtual_machines_associated: A list of references to all virtual machines associated to + the capacity reservation group. + :vartype virtual_machines_associated: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + :ivar instance_view: The capacity reservation group instance view which has the list of + instance views for all the capacity reservations that belong to the capacity reservation group. + :vartype instance_view: + ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroupInstanceView + """ + + _validation = { + 'capacity_reservations': {'readonly': True}, + 'virtual_machines_associated': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'capacity_reservations': {'key': 'properties.capacityReservations', 'type': '[SubResourceReadOnly]'}, + 'virtual_machines_associated': {'key': 'properties.virtualMachinesAssociated', 'type': '[SubResourceReadOnly]'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'CapacityReservationGroupInstanceView'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacityReservationGroupUpdate, self).__init__(**kwargs) + self.capacity_reservations = None + self.virtual_machines_associated = None + self.instance_view = None + + +class CapacityReservationInstanceView(msrest.serialization.Model): + """The instance view of a capacity reservation that provides as snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations. + + :param utilization_info: Unutilized capacity of the capacity reservation. + :type utilization_info: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationUtilization + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'utilization_info': {'key': 'utilizationInfo', 'type': 'CapacityReservationUtilization'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacityReservationInstanceView, self).__init__(**kwargs) + self.utilization_info = kwargs.get('utilization_info', None) + self.statuses = kwargs.get('statuses', None) + + +class CapacityReservationInstanceViewWithName(CapacityReservationInstanceView): + """The instance view of a capacity reservation that includes the name of the capacity reservation. It is used for the response to the instance view of a capacity reservation group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param utilization_info: Unutilized capacity of the capacity reservation. + :type utilization_info: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationUtilization + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_01.models.InstanceViewStatus] + :ivar name: The name of the capacity reservation. + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'utilization_info': {'key': 'utilizationInfo', 'type': 'CapacityReservationUtilization'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacityReservationInstanceViewWithName, self).__init__(**kwargs) + self.name = None + + +class CapacityReservationListResult(msrest.serialization.Model): + """The list capacity reservation operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of capacity reservations. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.CapacityReservation] + :param next_link: The URI to fetch the next page of capacity reservations. Call ListNext() with + this URI to fetch the next page of capacity reservations. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CapacityReservation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacityReservationListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class CapacityReservationProfile(msrest.serialization.Model): + """The parameters of a capacity reservation Profile. + + :param capacity_reservation_group: Specifies the capacity reservation group resource id that + should be used for allocating the virtual machine or scaleset vm instances provided enough + capacity has been reserved. Please refer to https://aka.ms/CapacityReservation for more + details. + :type capacity_reservation_group: ~azure.mgmt.compute.v2021_07_01.models.SubResource + """ + + _attribute_map = { + 'capacity_reservation_group': {'key': 'capacityReservationGroup', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacityReservationProfile, self).__init__(**kwargs) + self.capacity_reservation_group = kwargs.get('capacity_reservation_group', None) + + +class CapacityReservationUpdate(UpdateResource): + """Specifies information about the capacity reservation. Only tags and sku.capacity can 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 resource for which capacity needs be reserved. The SKU name and capacity + is required to be set. Currently VM Skus with the capability called + 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs + in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported + values. + :type sku: ~azure.mgmt.compute.v2021_07_01.models.Sku + :ivar reservation_id: A unique id generated and assigned to the capacity reservation by the + platform which does not change throughout the lifetime of the resource. + :vartype reservation_id: str + :ivar virtual_machines_associated: A list of all virtual machine resource ids that are + associated with the capacity reservation. + :vartype virtual_machines_associated: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + :ivar provisioning_time: The date time when the capacity reservation was last updated. + :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 Capacity reservation instance view. + :vartype instance_view: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationInstanceView + """ + + _validation = { + 'reservation_id': {'readonly': True}, + 'virtual_machines_associated': {'readonly': True}, + 'provisioning_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'virtual_machines_associated': {'key': 'properties.virtualMachinesAssociated', 'type': '[SubResourceReadOnly]'}, + 'provisioning_time': {'key': 'properties.provisioningTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'CapacityReservationInstanceView'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacityReservationUpdate, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.reservation_id = None + self.virtual_machines_associated = None + self.provisioning_time = None + self.provisioning_state = None + self.instance_view = None + + +class CapacityReservationUtilization(msrest.serialization.Model): + """Represents the capacity reservation utilization in terms of resources allocated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar virtual_machines_allocated: A list of all virtual machines resource ids allocated against + the capacity reservation. + :vartype virtual_machines_allocated: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + """ + + _validation = { + 'virtual_machines_allocated': {'readonly': True}, + } + + _attribute_map = { + 'virtual_machines_allocated': {'key': 'virtualMachinesAllocated', 'type': '[SubResourceReadOnly]'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacityReservationUtilization, self).__init__(**kwargs) + self.virtual_machines_allocated = 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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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 + :param detach_option: Specifies the detach behavior to be used while detaching a disk or which + is already in the process of detachment from the virtual machine. Supported values: + **ForceDetach**. :code:`
`:code:`
` detachOption: **ForceDetach** is applicable only for + managed data disks. If a previous detachment attempt of the data disk did not complete due to + an unexpected failure from the virtual machine and the disk is still not released then use + force-detach as a last resort option to detach the disk forcibly from the VM. All writes might + not have been flushed when using this detach behavior. :code:`
`:code:`
` This feature is + still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data + disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. Possible + values include: "ForceDetach". + :type detach_option: str or ~azure.mgmt.compute.v2021_07_01.models.DiskDetachOptionTypes + :param delete_option: Specifies whether data disk should be deleted or detached upon VM + deletion.:code:`
`:code:`
` Possible values: :code:`
`:code:`
` **Delete** If this + value is used, the data disk is deleted when VM is deleted.:code:`
`:code:`
` **Detach** + If this value is used, the data disk is retained after VM is deleted.:code:`
`:code:`
` + The default value is set to **detach**. Possible values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DiskDeleteOptionTypes + """ + + _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'}, + 'detach_option': {'key': 'detachOption', 'type': 'str'}, + 'delete_option': {'key': 'deleteOption', 'type': 'str'}, + } + + 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 + self.detach_option = kwargs.get('detach_option', None) + self.delete_option = kwargs.get('delete_option', 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 DiskImageEncryption(msrest.serialization.Model): + """This is the disk image encryption base class. + + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str + """ + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskImageEncryption, self).__init__(**kwargs) + self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) + + +class DataDiskImageEncryption(DiskImageEncryption): + """Contains encryption settings for a data disk image. + + All required parameters must be populated in order to send to Azure. + + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str + :param lun: Required. This property specifies the logical unit number of the data disk. This + value is used to identify data disks within the Virtual Machine and therefore must be unique + for each data disk attached to the Virtual Machine. + :type lun: int + """ + + _validation = { + 'lun': {'required': True}, + } + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DataDiskImageEncryption, self).__init__(**kwargs) + self.lun = kwargs['lun'] + + +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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.DedicatedHostInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'platform_fault_domain': {'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.v2021_07_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.v2021_07_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.v2021_07_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 'false' 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': {'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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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 'false' when not provided. :code:`
`:code:`
`Minimum + api-version: 2020-06-01. + :type support_automatic_placement: bool + """ + + _validation = { + 'platform_fault_domain_count': {'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.v2021_07_01.models.DedicatedHostAvailableCapacity + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.DedicatedHostAvailableCapacity + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.DedicatedHostInstanceView + """ + + _validation = { + 'platform_fault_domain': {'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.v2021_07_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.v2021_07_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/azure/virtual-machines/windows/sizes and Linux VM at + https://docs.microsoft.com/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.v2021_07_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 Disallowed(msrest.serialization.Model): + """Describes the disallowed disk types. + + :param disk_types: A list of disk types. + :type disk_types: list[str] + """ + + _attribute_map = { + 'disk_types': {'key': 'diskTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(Disallowed, self).__init__(**kwargs) + self.disk_types = kwargs.get('disk_types', 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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.DiskEncryptionSettings] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_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 EncryptionImages(msrest.serialization.Model): + """Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. + + :param os_disk_image: Contains encryption settings for an OS disk image. + :type os_disk_image: ~azure.mgmt.compute.v2021_07_01.models.OSDiskImageEncryption + :param data_disk_images: A list of encryption specifications for data disk images. + :type data_disk_images: list[~azure.mgmt.compute.v2021_07_01.models.DataDiskImageEncryption] + """ + + _attribute_map = { + 'os_disk_image': {'key': 'osDiskImage', 'type': 'OSDiskImageEncryption'}, + 'data_disk_images': {'key': 'dataDiskImages', 'type': '[DataDiskImageEncryption]'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionImages, self).__init__(**kwargs) + self.os_disk_image = kwargs.get('os_disk_image', None) + self.data_disk_images = kwargs.get('data_disk_images', None) + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class Gallery(Resource): + """Specifies information about the Shared Image Gallery that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this Shared Image Gallery resource. This property is + updatable. + :type description: str + :param identifier: Describes the gallery unique name. + :type identifier: ~azure.mgmt.compute.v2021_07_01.models.GalleryIdentifier + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryPropertiesProvisioningState + :param sharing_profile: Profile for gallery sharing to subscription or tenant. + :type sharing_profile: ~azure.mgmt.compute.v2021_07_01.models.SharingProfile + :param soft_delete_policy: Contains information about the soft deletion policy of the gallery. + :type soft_delete_policy: ~azure.mgmt.compute.v2021_07_01.models.SoftDeletePolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, + 'soft_delete_policy': {'key': 'properties.softDeletePolicy', 'type': 'SoftDeletePolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(Gallery, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.identifier = kwargs.get('identifier', None) + self.provisioning_state = None + self.sharing_profile = kwargs.get('sharing_profile', None) + self.soft_delete_policy = kwargs.get('soft_delete_policy', None) + + +class GalleryApplication(Resource): + """Specifies information about the gallery Application Definition that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery Application Definition resource. This + property is updatable. + :type description: str + :param eula: The Eula agreement for the gallery Application Definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param end_of_life_date: The end of life date of the gallery Application Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param supported_os_type: This property allows you to specify the supported type of the OS that + application is built for. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type supported_os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplication, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.eula = kwargs.get('eula', None) + self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) + self.release_note_uri = kwargs.get('release_note_uri', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.supported_os_type = kwargs.get('supported_os_type', None) + + +class GalleryApplicationList(msrest.serialization.Model): + """The List Gallery Applications operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of Gallery Applications. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.GalleryApplication] + :param next_link: The uri to fetch the next page of Application Definitions in the Application + Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryApplication]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class UpdateResourceDefinition(msrest.serialization.Model): + """The Update Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateResourceDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = kwargs.get('tags', None) + + +class GalleryApplicationUpdate(UpdateResourceDefinition): + """Specifies information about the gallery Application Definition that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery Application Definition resource. This + property is updatable. + :type description: str + :param eula: The Eula agreement for the gallery Application Definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param end_of_life_date: The end of life date of the gallery Application Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param supported_os_type: This property allows you to specify the supported type of the OS that + application is built for. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type supported_os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationUpdate, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.eula = kwargs.get('eula', None) + self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) + self.release_note_uri = kwargs.get('release_note_uri', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.supported_os_type = kwargs.get('supported_os_type', None) + + +class GalleryApplicationVersion(Resource): + """Specifies information about the gallery Application Version that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image version. + :type publishing_profile: + ~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersionPropertiesProvisioningState + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2021_07_01.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationVersion, self).__init__(**kwargs) + self.publishing_profile = kwargs.get('publishing_profile', None) + self.provisioning_state = None + self.replication_status = None + + +class GalleryApplicationVersionList(msrest.serialization.Model): + """The List Gallery Application version operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of gallery Application Versions. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersion] + :param next_link: The uri to fetch the next page of gallery Application Versions. Call + ListNext() with this to fetch the next page of gallery Application Versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryApplicationVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationVersionList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class GalleryArtifactPublishingProfileBase(msrest.serialization.Model): + """Describes the basic gallery artifact publishing profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2021_07_01.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_01.models.StorageAccountType + :param replication_mode: Optional parameter which specifies the mode to be used for + replication. This property is not updatable. Possible values include: "Full", "Shallow". + :type replication_mode: str or ~azure.mgmt.compute.v2021_07_01.models.ReplicationMode + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'replication_mode': {'key': 'replicationMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryArtifactPublishingProfileBase, self).__init__(**kwargs) + self.target_regions = kwargs.get('target_regions', None) + self.replica_count = kwargs.get('replica_count', None) + self.exclude_from_latest = kwargs.get('exclude_from_latest', None) + self.published_date = None + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.storage_account_type = kwargs.get('storage_account_type', None) + self.replication_mode = kwargs.get('replication_mode', None) + + +class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery image version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2021_07_01.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_01.models.StorageAccountType + :param replication_mode: Optional parameter which specifies the mode to be used for + replication. This property is not updatable. Possible values include: "Full", "Shallow". + :type replication_mode: str or ~azure.mgmt.compute.v2021_07_01.models.ReplicationMode + :param source: Required. The source image from which the Image Version is going to be created. + :type source: ~azure.mgmt.compute.v2021_07_01.models.UserArtifactSource + :param manage_actions: + :type manage_actions: ~azure.mgmt.compute.v2021_07_01.models.UserArtifactManage + :param enable_health_check: Optional. Whether or not this application reports health. + :type enable_health_check: bool + """ + + _validation = { + 'published_date': {'readonly': True}, + 'source': {'required': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'replication_mode': {'key': 'replicationMode', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'UserArtifactSource'}, + 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, + 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationVersionPublishingProfile, self).__init__(**kwargs) + self.source = kwargs['source'] + self.manage_actions = kwargs.get('manage_actions', None) + self.enable_health_check = kwargs.get('enable_health_check', None) + + +class GalleryApplicationVersionUpdate(UpdateResourceDefinition): + """Specifies information about the gallery Application Version that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image version. + :type publishing_profile: + ~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersionPropertiesProvisioningState + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2021_07_01.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationVersionUpdate, self).__init__(**kwargs) + self.publishing_profile = kwargs.get('publishing_profile', None) + self.provisioning_state = None + self.replication_status = None + + +class GalleryArtifactSource(msrest.serialization.Model): + """The source image from which the Image Version is going to be created. + + All required parameters must be populated in order to send to Azure. + + :param managed_image: Required. The managed artifact. + :type managed_image: ~azure.mgmt.compute.v2021_07_01.models.ManagedArtifact + """ + + _validation = { + 'managed_image': {'required': True}, + } + + _attribute_map = { + 'managed_image': {'key': 'managedImage', 'type': 'ManagedArtifact'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryArtifactSource, self).__init__(**kwargs) + self.managed_image = kwargs['managed_image'] + + +class GalleryArtifactVersionSource(msrest.serialization.Model): + """The gallery artifact version source. + + :param id: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, + user image or storage account resource. + :type id: str + :param uri: The uri of the gallery artifact version source. Currently used to specify vhd/blob + source. + :type uri: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryArtifactVersionSource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.uri = kwargs.get('uri', None) + + +class GalleryDiskImage(msrest.serialization.Model): + """This is the disk image base class. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2021_07_01.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2021_07_01.models.GalleryArtifactVersionSource + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryDiskImage, self).__init__(**kwargs) + self.size_in_gb = None + self.host_caching = kwargs.get('host_caching', None) + self.source = kwargs.get('source', None) + + +class GalleryDataDiskImage(GalleryDiskImage): + """This is the data disk image. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2021_07_01.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2021_07_01.models.GalleryArtifactVersionSource + :param lun: Required. This property specifies the logical unit number of the data disk. This + value is used to identify data disks within the Virtual Machine and therefore must be unique + for each data disk attached to the Virtual Machine. + :type lun: int + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + 'lun': {'required': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryDataDiskImage, self).__init__(**kwargs) + self.lun = kwargs['lun'] + + +class GalleryIdentifier(msrest.serialization.Model): + """Describes the gallery unique name. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unique_name: The unique name of the Shared Image Gallery. This name is generated + automatically by Azure. + :vartype unique_name: str + """ + + _validation = { + 'unique_name': {'readonly': True}, + } + + _attribute_map = { + 'unique_name': {'key': 'uniqueName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryIdentifier, self).__init__(**kwargs) + self.unique_name = None + + +class GalleryImage(Resource): + """Specifies information about the gallery image definition that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery image definition resource. This property is + updatable. + :type description: str + :param eula: The Eula agreement for the gallery image definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemStateTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2021_07_01.models.HyperVGeneration + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2021_07_01.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2021_07_01.models.Disallowed + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2021_07_01.models.ImagePurchasePlan + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryImagePropertiesProvisioningState + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2021_07_01.models.GalleryImageFeature] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImage, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.eula = kwargs.get('eula', None) + self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) + self.release_note_uri = kwargs.get('release_note_uri', None) + self.os_type = kwargs.get('os_type', None) + self.os_state = kwargs.get('os_state', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.identifier = kwargs.get('identifier', None) + self.recommended = kwargs.get('recommended', None) + self.disallowed = kwargs.get('disallowed', None) + self.purchase_plan = kwargs.get('purchase_plan', None) + self.provisioning_state = None + self.features = kwargs.get('features', None) + + +class GalleryImageFeature(msrest.serialization.Model): + """A feature for gallery image. + + :param name: The name of the gallery image feature. + :type name: str + :param value: The value of the gallery image feature. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageFeature, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class GalleryImageIdentifier(msrest.serialization.Model): + """This is the gallery image definition identifier. + + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The name of the gallery image definition publisher. + :type publisher: str + :param offer: Required. The name of the gallery image definition offer. + :type offer: str + :param sku: Required. The name of the gallery image definition SKU. + :type sku: str + """ + + _validation = { + 'publisher': {'required': True}, + 'offer': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageIdentifier, self).__init__(**kwargs) + self.publisher = kwargs['publisher'] + self.offer = kwargs['offer'] + self.sku = kwargs['sku'] + + +class GalleryImageList(msrest.serialization.Model): + """The List Gallery Images operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of Shared Image Gallery images. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.GalleryImage] + :param next_link: The uri to fetch the next page of Image Definitions in the Shared Image + Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryImage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class GalleryImageUpdate(UpdateResourceDefinition): + """Specifies information about the gallery image definition that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery image definition resource. This property is + updatable. + :type description: str + :param eula: The Eula agreement for the gallery image definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemStateTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2021_07_01.models.HyperVGeneration + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2021_07_01.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2021_07_01.models.Disallowed + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2021_07_01.models.ImagePurchasePlan + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryImagePropertiesProvisioningState + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2021_07_01.models.GalleryImageFeature] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageUpdate, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.eula = kwargs.get('eula', None) + self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) + self.release_note_uri = kwargs.get('release_note_uri', None) + self.os_type = kwargs.get('os_type', None) + self.os_state = kwargs.get('os_state', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.identifier = kwargs.get('identifier', None) + self.recommended = kwargs.get('recommended', None) + self.disallowed = kwargs.get('disallowed', None) + self.purchase_plan = kwargs.get('purchase_plan', None) + self.provisioning_state = None + self.features = kwargs.get('features', None) + + +class GalleryImageVersion(Resource): + """Specifies information about the gallery image version that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image Version. + :type publishing_profile: + ~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionPropertiesProvisioningState + :param storage_profile: This is the storage profile of a Gallery Image Version. + :type storage_profile: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionStorageProfile + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2021_07_01.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryImageVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersion, self).__init__(**kwargs) + self.publishing_profile = kwargs.get('publishing_profile', None) + self.provisioning_state = None + self.storage_profile = kwargs.get('storage_profile', None) + self.replication_status = None + + +class GalleryImageVersionList(msrest.serialization.Model): + """The List Gallery Image version operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of gallery image versions. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersion] + :param next_link: The uri to fetch the next page of gallery image versions. Call ListNext() + with this to fetch the next page of gallery image versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryImageVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersionList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class GalleryImageVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery image Version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2021_07_01.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_01.models.StorageAccountType + :param replication_mode: Optional parameter which specifies the mode to be used for + replication. This property is not updatable. Possible values include: "Full", "Shallow". + :type replication_mode: str or ~azure.mgmt.compute.v2021_07_01.models.ReplicationMode + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'replication_mode': {'key': 'replicationMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersionPublishingProfile, self).__init__(**kwargs) + + +class GalleryImageVersionStorageProfile(msrest.serialization.Model): + """This is the storage profile of a Gallery Image Version. + + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2021_07_01.models.GalleryArtifactVersionSource + :param os_disk_image: This is the OS disk image. + :type os_disk_image: ~azure.mgmt.compute.v2021_07_01.models.GalleryOSDiskImage + :param data_disk_images: A list of data disk images. + :type data_disk_images: list[~azure.mgmt.compute.v2021_07_01.models.GalleryDataDiskImage] + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'os_disk_image': {'key': 'osDiskImage', 'type': 'GalleryOSDiskImage'}, + 'data_disk_images': {'key': 'dataDiskImages', 'type': '[GalleryDataDiskImage]'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersionStorageProfile, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.os_disk_image = kwargs.get('os_disk_image', None) + self.data_disk_images = kwargs.get('data_disk_images', None) + + +class GalleryImageVersionUpdate(UpdateResourceDefinition): + """Specifies information about the gallery image version that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image Version. + :type publishing_profile: + ~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionPropertiesProvisioningState + :param storage_profile: This is the storage profile of a Gallery Image Version. + :type storage_profile: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionStorageProfile + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2021_07_01.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryImageVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersionUpdate, self).__init__(**kwargs) + self.publishing_profile = kwargs.get('publishing_profile', None) + self.provisioning_state = None + self.storage_profile = kwargs.get('storage_profile', None) + self.replication_status = None + + +class GalleryList(msrest.serialization.Model): + """The List Galleries operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of galleries. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.Gallery] + :param next_link: The uri to fetch the next page of galleries. Call ListNext() with this to + fetch the next page of galleries. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Gallery]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class GalleryOSDiskImage(GalleryDiskImage): + """This is the OS disk image. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2021_07_01.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2021_07_01.models.GalleryArtifactVersionSource + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryOSDiskImage, self).__init__(**kwargs) + + +class GalleryUpdate(UpdateResourceDefinition): + """Specifies information about the Shared Image Gallery that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this Shared Image Gallery resource. This property is + updatable. + :type description: str + :param identifier: Describes the gallery unique name. + :type identifier: ~azure.mgmt.compute.v2021_07_01.models.GalleryIdentifier + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryPropertiesProvisioningState + :param sharing_profile: Profile for gallery sharing to subscription or tenant. + :type sharing_profile: ~azure.mgmt.compute.v2021_07_01.models.SharingProfile + :param soft_delete_policy: Contains information about the soft deletion policy of the gallery. + :type soft_delete_policy: ~azure.mgmt.compute.v2021_07_01.models.SoftDeletePolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, + 'soft_delete_policy': {'key': 'properties.softDeletePolicy', 'type': 'SoftDeletePolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryUpdate, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.identifier = kwargs.get('identifier', None) + self.provisioning_state = None + self.sharing_profile = kwargs.get('sharing_profile', None) + self.soft_delete_policy = kwargs.get('soft_delete_policy', None) + + +class HardwareProfile(msrest.serialization.Model): + """Specifies the hardware settings for the virtual machine. + + :param vm_size: Specifies the size of the virtual machine. :code:`
`:code:`
` The enum + data type is currently deprecated and will be removed by December 23rd 2023. + :code:`
`:code:`
` Recommended way to get the list of available sizes is using 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 + `_. For more + information about virtual machine sizes, see `Sizes for virtual machines + `_. :code:`
`:code:`
` The + available VM sizes depend on region and availability set. 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.v2021_07_01.models.VirtualMachineSizeTypes + :param vm_size_properties: Specifies the properties for customizing the size of the virtual + machine. Minimum api-version: 2021-07-01. :code:`
`:code:`
` This feature is still in + preview mode and is not supported for VirtualMachineScaleSet. :code:`
`:code:`
` Please + follow the instructions in `VM Customization `_ for more + details. + :type vm_size_properties: ~azure.mgmt.compute.v2021_07_01.models.VMSizeProperties + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'vm_size_properties': {'key': 'vmSizeProperties', 'type': 'VMSizeProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) + self.vm_size_properties = kwargs.get('vm_size_properties', 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 extended_location: The extended location of the Image. + :type extended_location: ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocation + :param source_virtual_machine: The source virtual machine from which Image is created. + :type source_virtual_machine: ~azure.mgmt.compute.v2021_07_01.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2021_07_01.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + :param hyper_v_generation: Specifies the HyperVGenerationType of the VirtualMachine created + from the image. From API Version 2019-03-01 if the image source is a blob, then we need the + user to specify the value, if the source is managed resource like disk or snapshot, we may + require the user to specify the property if we cannot deduce it from the source managed + resource. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2021_07_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}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + '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.extended_location = kwargs.get('extended_location', None) + 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.v2021_07_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2021_07_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.v2021_07_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", "Premium_ZRS", + "StandardSSD_ZRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.DiskEncryptionSetParameters + """ + + _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': 'DiskEncryptionSetParameters'}, + } + + 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.v2021_07_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2021_07_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.v2021_07_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", "Premium_ZRS", + "StandardSSD_ZRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.DiskEncryptionSetParameters + :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': 'DiskEncryptionSetParameters'}, + '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.v2021_07_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.v2021_07_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2021_07_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.v2021_07_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", "Premium_ZRS", + "StandardSSD_ZRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.DiskEncryptionSetParameters + :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.v2021_07_01.models.OperatingSystemTypes + :param os_state: Required. The OS State. Possible values include: "Generalized", "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2021_07_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': 'DiskEncryptionSetParameters'}, + '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 ImagePurchasePlan(msrest.serialization.Model): + """Describes the gallery image definition purchase plan. This is used by marketplace images. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The product ID. + :type product: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ImagePurchasePlan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + + +class 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 + :param shared_gallery_image_id: Specified the shared gallery image unique id for vm deployment. + This can be fetched from shared gallery image GET call. + :type shared_gallery_image_id: 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'}, + 'shared_gallery_image_id': {'key': 'sharedGalleryImageId', '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 + self.shared_gallery_image_id = kwargs.get('shared_gallery_image_id', 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.v2021_07_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.v2021_07_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.v2021_07_01.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2021_07_01.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + :param hyper_v_generation: Specifies the HyperVGenerationType of the VirtualMachine created + from the image. From API Version 2019-03-01 if the image source is a blob, then we need the + user to specify the value, if the source is managed resource like disk or snapshot, we may + require the user to specify the property if we cannot deduce it from the source managed + resource. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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 "Unknown", "Failed", "Succeeded", + or "CompletedWithWarnings.". Possible values include: "Unknown", "InProgress", "Failed", + "Succeeded", "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2021_07_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 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 error: The errors that were encountered during execution of the operation. The details + array contains the list of them. + :vartype error: ~azure.mgmt.compute.v2021_07_01.models.ApiError + """ + + _validation = { + 'status': {'readonly': True}, + 'installation_activity_id': {'readonly': True}, + 'maintenance_window_exceeded': {'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}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'installation_activity_id': {'key': 'installationActivityId', 'type': 'str'}, + 'maintenance_window_exceeded': {'key': 'maintenanceWindowExceeded', 'type': 'bool'}, + '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'}, + '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.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.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 `_. + + :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.v2021_07_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 + :param patch_settings: [Preview Feature] Specifies settings related to VM Guest Patching on + Linux. + :type patch_settings: ~azure.mgmt.compute.v2021_07_01.models.LinuxPatchSettings + """ + + _attribute_map = { + 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, + 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, + 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, + 'patch_settings': {'key': 'patchSettings', 'type': 'LinuxPatchSettings'}, + } + + 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) + self.patch_settings = kwargs.get('patch_settings', None) + + +class LinuxParameters(msrest.serialization.Model): + """Input for InstallPatches on a Linux VM, as directly received by the API. + + :param classifications_to_include: The update classifications to select when installing patches + for Linux. + :type classifications_to_include: list[str or + ~azure.mgmt.compute.v2021_07_01.models.VMGuestPatchClassificationLinux] + :param package_name_masks_to_include: packages to include in the patch operation. Format: + packageName_packageVersion. + :type package_name_masks_to_include: list[str] + :param package_name_masks_to_exclude: packages to exclude in the patch operation. Format: + packageName_packageVersion. + :type package_name_masks_to_exclude: list[str] + :param maintenance_run_id: This is used as a maintenance run identifier for Auto VM Guest + Patching in Linux. + :type maintenance_run_id: str + """ + + _attribute_map = { + 'classifications_to_include': {'key': 'classificationsToInclude', 'type': '[str]'}, + 'package_name_masks_to_include': {'key': 'packageNameMasksToInclude', 'type': '[str]'}, + 'package_name_masks_to_exclude': {'key': 'packageNameMasksToExclude', 'type': '[str]'}, + 'maintenance_run_id': {'key': 'maintenanceRunId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LinuxParameters, self).__init__(**kwargs) + self.classifications_to_include = kwargs.get('classifications_to_include', None) + self.package_name_masks_to_include = kwargs.get('package_name_masks_to_include', None) + self.package_name_masks_to_exclude = kwargs.get('package_name_masks_to_exclude', None) + self.maintenance_run_id = kwargs.get('maintenance_run_id', None) + + +class LinuxPatchSettings(msrest.serialization.Model): + """Specifies settings related to VM Guest Patching on Linux. + + :param patch_mode: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + machines associated to virtual machine scale set with OrchestrationMode as Flexible.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **ImageDefault** - The + virtual machine's default patching configuration is used. :code:`
`:code:`
` + **AutomaticByPlatform** - The virtual machine will be automatically updated by the platform. + The property provisionVMAgent must be true. Possible values include: "ImageDefault", + "AutomaticByPlatform". + :type patch_mode: str or ~azure.mgmt.compute.v2021_07_01.models.LinuxVMGuestPatchMode + :param assessment_mode: Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + machine.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` + **ImageDefault** - You control the timing of patch assessments on a virtual machine. :code:`
`:code:`
` **AutomaticByPlatform** - The platform will trigger periodic patch + assessments. The property provisionVMAgent must be true. Possible values include: + "ImageDefault", "AutomaticByPlatform". + :type assessment_mode: str or ~azure.mgmt.compute.v2021_07_01.models.LinuxPatchAssessmentMode + """ + + _attribute_map = { + 'patch_mode': {'key': 'patchMode', 'type': 'str'}, + 'assessment_mode': {'key': 'assessmentMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LinuxPatchSettings, self).__init__(**kwargs) + self.patch_mode = kwargs.get('patch_mode', None) + self.assessment_mode = kwargs.get('assessment_mode', 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.v2021_07_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 + :param group_by_client_application_id: Group query result by Client Application ID. + :type group_by_client_application_id: bool + :param group_by_user_agent: Group query result by User Agent. + :type group_by_user_agent: bool + """ + + _validation = { + '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'}, + 'group_by_client_application_id': {'key': 'groupByClientApplicationId', 'type': 'bool'}, + 'group_by_user_agent': {'key': 'groupByUserAgent', '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) + self.group_by_client_application_id = kwargs.get('group_by_client_application_id', None) + self.group_by_user_agent = kwargs.get('group_by_user_agent', None) + + +class LogAnalyticsOperationResult(msrest.serialization.Model): + """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.v2021_07_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.v2021_07_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 ManagedArtifact(msrest.serialization.Model): + """The managed artifact. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The managed artifact id. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedArtifact, self).__init__(**kwargs) + self.id = kwargs['id'] + + +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", "Premium_ZRS", + "StandardSSD_ZRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.DiskEncryptionSetParameters + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'DiskEncryptionSetParameters'}, + } + + 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 + :param delete_option: Specify what happens to the network interface when the VM is deleted. + Possible values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterfaceReference, self).__init__(**kwargs) + self.primary = kwargs.get('primary', None) + self.delete_option = kwargs.get('delete_option', None) + + +class NetworkProfile(msrest.serialization.Model): + """Specifies the network interfaces or the networking configuration 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.v2021_07_01.models.NetworkInterfaceReference] + :param network_api_version: specifies the Microsoft.Network API version used when creating + networking resources in the Network Interface Configurations. Possible values include: + "2020-11-01". + :type network_api_version: str or ~azure.mgmt.compute.v2021_07_01.models.NetworkApiVersion + :param network_interface_configurations: Specifies the networking configurations that will be + used to create the virtual machine networking resources. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineNetworkInterfaceConfiguration] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, + 'network_api_version': {'key': 'networkApiVersion', 'type': 'str'}, + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineNetworkInterfaceConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) + self.network_api_version = kwargs.get('network_api_version', None) + self.network_interface_configurations = kwargs.get('network_interface_configurations', 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.v2021_07_01.models.OrchestrationServiceNames + :param action: Required. The action to be performed. Possible values include: "Resume", + "Suspend". + :type action: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.DiskEncryptionSettings + :param name: The disk name. + :type name: str + :param vhd: The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.ManagedDiskParameters + :param delete_option: Specifies whether OS Disk should be deleted or detached upon VM deletion. + :code:`
`:code:`
` Possible values: :code:`
`:code:`
` **Delete** If this value is + used, the OS disk is deleted when VM is deleted.:code:`
`:code:`
` **Detach** If this + value is used, the os disk is retained after VM is deleted. :code:`
`:code:`
` The + default value is set to **detach**. For an ephemeral OS Disk, the default value is set to + **Delete**. User cannot change the delete option for ephemeral OS Disk. Possible values + include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DiskDeleteOptionTypes + """ + + _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'}, + 'delete_option': {'key': 'deleteOption', 'type': 'str'}, + } + + 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) + self.delete_option = kwargs.get('delete_option', 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.v2021_07_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 OSDiskImageEncryption(DiskImageEncryption): + """Contains encryption settings for an OS disk image. + + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str + """ + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OSDiskImageEncryption, self).__init__(**kwargs) + + +class 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. + :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.v2021_07_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 + `_. + :type linux_configuration: ~azure.mgmt.compute.v2021_07_01.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed onto the virtual + machine. To install certificates on a virtual machine it is recommended to use the `Azure Key + Vault virtual machine extension for Linux + `_ or the `Azure + Key Vault virtual machine extension for Windows + `_. + :type secrets: list[~azure.mgmt.compute.v2021_07_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 PatchInstallationDetail(msrest.serialization.Model): + """Information about a specific patch that was encountered during an installation action. + + 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 string of the package. It may conform to Semantic Versioning. Only + applies to Linux. + :vartype version: str + :ivar kb_id: The KBID of the patch. Only applies to Windows patches. + :vartype kb_id: str + :ivar classifications: The classification(s) of the patch as provided by the patch publisher. + :vartype classifications: list[str] + :ivar installation_state: The state of the patch after the installation operation completed. + Possible values include: "Unknown", "Installed", "Failed", "Excluded", "NotSelected", + "Pending". + :vartype installation_state: str or + ~azure.mgmt.compute.v2021_07_01.models.PatchInstallationState + """ + + _validation = { + 'patch_id': {'readonly': True}, + 'name': {'readonly': True}, + 'version': {'readonly': True}, + 'kb_id': {'readonly': True}, + 'classifications': {'readonly': True}, + 'installation_state': {'readonly': True}, + } + + _attribute_map = { + 'patch_id': {'key': 'patchId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'kb_id': {'key': 'kbId', 'type': 'str'}, + 'classifications': {'key': 'classifications', 'type': '[str]'}, + 'installation_state': {'key': 'installationState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PatchInstallationDetail, self).__init__(**kwargs) + self.patch_id = None + self.name = None + self.version = None + self.kb_id = None + self.classifications = None + self.installation_state = None + + +class PatchSettings(msrest.serialization.Model): + """Specifies settings related to VM Guest Patching on Windows. + + :param patch_mode: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + machines associated to virtual machine scale set with OrchestrationMode as Flexible.: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.v2021_07_01.models.WindowsVMGuestPatchMode + :param enable_hotpatching: Enables customers to patch their Azure VMs without requiring a + reboot. For enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must + be set to 'AutomaticByPlatform'. + :type enable_hotpatching: bool + :param assessment_mode: Specifies the mode of VM Guest patch assessment for the IaaS virtual + machine.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` + **ImageDefault** - You control the timing of patch assessments on a virtual machine.:code:`
`:code:`
` **AutomaticByPlatform** - The platform will trigger periodic patch + assessments. The property provisionVMAgent must be true. Possible values include: + "ImageDefault", "AutomaticByPlatform". + :type assessment_mode: str or ~azure.mgmt.compute.v2021_07_01.models.WindowsPatchAssessmentMode + """ + + _attribute_map = { + 'patch_mode': {'key': 'patchMode', 'type': 'str'}, + 'enable_hotpatching': {'key': 'enableHotpatching', 'type': 'bool'}, + 'assessment_mode': {'key': 'assessmentMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PatchSettings, self).__init__(**kwargs) + self.patch_mode = kwargs.get('patch_mode', None) + self.enable_hotpatching = kwargs.get('enable_hotpatching', None) + self.assessment_mode = kwargs.get('assessment_mode', None) + + +class PirResource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PirResource, self).__init__(**kwargs) + self.name = None + self.location = None + + +class PirSharedGalleryResource(PirResource): + """Base information about the shared gallery resource in pir. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PirSharedGalleryResource, self).__init__(**kwargs) + self.unique_id = kwargs.get('unique_id', 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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.SubResourceWithColocationStatus] + :param colocation_status: Describes colocation status of the Proximity Placement Group. + :type colocation_status: ~azure.mgmt.compute.v2021_07_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.v2021_07_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 ProxyResource(msrest.serialization.Model): + """The resource model definition for an Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class PublicIPAddressSku(msrest.serialization.Model): + """Describes the public IP Sku. + + :param name: Specify public IP sku name. Possible values include: "Basic", "Standard". + :type name: str or ~azure.mgmt.compute.v2021_07_01.models.PublicIPAddressSkuName + :param tier: Specify public IP sku tier. Possible values include: "Regional", "Global". + :type tier: str or ~azure.mgmt.compute.v2021_07_01.models.PublicIPAddressSkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +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 RecommendedMachineConfiguration(msrest.serialization.Model): + """The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. + + :param v_cp_us: Describes the resource range. + :type v_cp_us: ~azure.mgmt.compute.v2021_07_01.models.ResourceRange + :param memory: Describes the resource range. + :type memory: ~azure.mgmt.compute.v2021_07_01.models.ResourceRange + """ + + _attribute_map = { + 'v_cp_us': {'key': 'vCPUs', 'type': 'ResourceRange'}, + 'memory': {'key': 'memory', 'type': 'ResourceRange'}, + } + + def __init__( + self, + **kwargs + ): + super(RecommendedMachineConfiguration, self).__init__(**kwargs) + self.v_cp_us = kwargs.get('v_cp_us', None) + self.memory = kwargs.get('memory', None) + + +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 RegionalReplicationStatus(msrest.serialization.Model): + """This is the regional replication status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar region: The region to which the gallery image version is being replicated to. + :vartype region: str + :ivar state: This is the regional replication state. Possible values include: "Unknown", + "Replicating", "Completed", "Failed". + :vartype state: str or ~azure.mgmt.compute.v2021_07_01.models.ReplicationState + :ivar details: The details of the replication status. + :vartype details: str + :ivar progress: It indicates progress of the replication job. + :vartype progress: int + """ + + _validation = { + 'region': {'readonly': True}, + 'state': {'readonly': True}, + 'details': {'readonly': True}, + 'progress': {'readonly': True}, + } + + _attribute_map = { + 'region': {'key': 'region', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + 'progress': {'key': 'progress', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RegionalReplicationStatus, self).__init__(**kwargs) + self.region = None + self.state = None + self.details = None + self.progress = None + + +class ReplicationStatus(msrest.serialization.Model): + """This is the replication status of the gallery image version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar aggregated_state: This is the aggregated replication status based on all the regional + replication status flags. Possible values include: "Unknown", "InProgress", "Completed", + "Failed". + :vartype aggregated_state: str or + ~azure.mgmt.compute.v2021_07_01.models.AggregatedReplicationState + :ivar summary: This is a summary of replication status for each region. + :vartype summary: list[~azure.mgmt.compute.v2021_07_01.models.RegionalReplicationStatus] + """ + + _validation = { + 'aggregated_state': {'readonly': True}, + 'summary': {'readonly': True}, + } + + _attribute_map = { + 'aggregated_state': {'key': 'aggregatedState', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': '[RegionalReplicationStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(ReplicationStatus, self).__init__(**kwargs) + self.aggregated_state = None + self.summary = 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 group_by_client_application_id: Group query result by Client Application ID. + :type group_by_client_application_id: bool + :param group_by_user_agent: Group query result by User Agent. + :type group_by_user_agent: bool + :param interval_length: Required. Interval value in minutes used to create LogAnalytics call + rate logs. Possible values include: "ThreeMins", "FiveMins", "ThirtyMins", "SixtyMins". + :type interval_length: str or ~azure.mgmt.compute.v2021_07_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'}, + 'group_by_client_application_id': {'key': 'groupByClientApplicationId', 'type': 'bool'}, + 'group_by_user_agent': {'key': 'groupByUserAgent', 'type': 'bool'}, + 'interval_length': {'key': 'intervalLength', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RequestRateByIntervalInput, self).__init__(**kwargs) + self.interval_length = kwargs['interval_length'] + + +class ResourceRange(msrest.serialization.Model): + """Describes the resource range. + + :param min: The minimum number of the resource. + :type min: int + :param max: The maximum number of the resource. + :type max: int + """ + + _attribute_map = { + 'min': {'key': 'min', 'type': 'int'}, + 'max': {'key': 'max', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceRange, self).__init__(**kwargs) + self.min = kwargs.get('min', None) + self.max = kwargs.get('max', None) + + +class ResourceSku(msrest.serialization.Model): + """Describes an available Compute 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 name: The name of SKU. + :vartype name: str + :ivar tier: Specifies the tier of virtual machines in a scale set.:code:`
`:code:`
` + Possible Values::code:`
`:code:`
` **Standard**\ :code:`
`:code:`
` + **Basic**. + :vartype tier: str + :ivar size: The Size of the SKU. + :vartype size: str + :ivar family: The Family of this particular SKU. + :vartype family: str + :ivar kind: The Kind of resources that are supported in this SKU. + :vartype kind: str + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: ~azure.mgmt.compute.v2021_07_01.models.ResourceSkuCapacity + :ivar locations: The set of locations that the SKU is available. + :vartype locations: list[str] + :ivar location_info: A list of locations and availability zones in those locations where the + SKU is available. + :vartype location_info: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSkuLocationInfo] + :ivar api_versions: The api versions that support this SKU. + :vartype api_versions: list[str] + :ivar costs: Metadata for retrieving price info. + :vartype costs: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSkuCosts] + :ivar capabilities: A name value pair to describe the capability. + :vartype capabilities: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSkuCapabilities] + :ivar restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :vartype restrictions: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSkuRestrictions] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'kind': {'readonly': True}, + 'capacity': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'costs': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'ResourceSkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'costs': {'key': 'costs', 'type': '[ResourceSkuCosts]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.size = None + self.family = None + self.kind = None + self.capacity = None + self.locations = None + self.location_info = None + self.api_versions = None + self.costs = None + self.capabilities = None + self.restrictions = None + + +class ResourceSkuCapabilities(msrest.serialization.Model): + """Describes The SKU capabilities object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: An invariant to describe the feature. + :vartype name: str + :ivar value: An invariant if the feature is measured by quantity. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuCapabilities, self).__init__(**kwargs) + self.name = None + self.value = None + + +class ResourceSkuCapacity(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: The default capacity. + :vartype default: long + :ivar scale_type: The scale type applicable to the sku. Possible values include: "Automatic", + "Manual", "None". + :vartype scale_type: str or ~azure.mgmt.compute.v2021_07_01.models.ResourceSkuCapacityScaleType + """ + + _validation = { + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'default': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'long'}, + 'maximum': {'key': 'maximum', 'type': 'long'}, + 'default': {'key': 'default', 'type': 'long'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default = None + self.scale_type = None + + +class ResourceSkuCosts(msrest.serialization.Model): + """Describes metadata for retrieving price info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar meter_id: Used for querying price from commerce. + :vartype meter_id: str + :ivar quantity: The multiplier is needed to extend the base metered cost. + :vartype quantity: long + :ivar extended_unit: An invariant to show the extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterID', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuCosts, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class ResourceSkuLocationInfo(msrest.serialization.Model): + """Describes an available Compute SKU Location Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Location of the SKU. + :vartype location: str + :ivar zones: List of availability zones where the SKU is supported. + :vartype zones: list[str] + :ivar zone_details: Details of capabilities available to a SKU in specific zones. + :vartype zone_details: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSkuZoneDetails] + :ivar extended_locations: The names of extended locations. + :vartype extended_locations: list[str] + :ivar type: The type of the extended location. Possible values include: "EdgeZone". + :vartype type: str or ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocationType + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'zone_details': {'readonly': True}, + 'extended_locations': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + 'extended_locations': {'key': 'extendedLocations', 'type': '[str]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.zone_details = None + self.extended_locations = None + self.type = None + + +class ResourceSkuRestrictionInfo(msrest.serialization.Model): + """Describes an available Compute SKU Restriction Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar locations: Locations where the SKU is restricted. + :vartype locations: list[str] + :ivar zones: List of availability zones where the SKU is restricted. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None + + +class ResourceSkuRestrictions(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 type: The type of restrictions. Possible values include: "Location", "Zone". + :vartype type: str or ~azure.mgmt.compute.v2021_07_01.models.ResourceSkuRestrictionsType + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :ivar restriction_info: The information about the restriction where the SKU cannot be used. + :vartype restriction_info: ~azure.mgmt.compute.v2021_07_01.models.ResourceSkuRestrictionInfo + :ivar reason_code: The reason for restriction. Possible values include: "QuotaId", + "NotAvailableForSubscription". + :vartype reason_code: str or + ~azure.mgmt.compute.v2021_07_01.models.ResourceSkuRestrictionsReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'restriction_info': {'readonly': True}, + 'reason_code': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.restriction_info = None + self.reason_code = None + + +class ResourceSkusResult(msrest.serialization.Model): + """The List Resource 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 subscription. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSku] + :param next_link: The URI to fetch the next page of Resource Skus. Call ListNext() with this + URI to fetch the next page of Resource Skus. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkusResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class ResourceSkuZoneDetails(msrest.serialization.Model): + """Describes The zonal capabilities of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The set of zones that the SKU is available in with the specified capabilities. + :vartype name: list[str] + :ivar capabilities: A list of capabilities that are available for the SKU in the specified list + of zones. + :vartype capabilities: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSkuCapabilities] + """ + + _validation = { + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = None + self.capabilities = None + + +class RestorePoint(ProxyResource): + """Restore Point details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param exclude_disks: List of disk resource ids that the customer wishes to exclude from the + restore point. If no disks are specified, all disks will be included. + :type exclude_disks: list[~azure.mgmt.compute.v2021_07_01.models.ApiEntityReference] + :ivar source_metadata: Gets the details of the VM captured at the time of the restore point + creation. + :vartype source_metadata: ~azure.mgmt.compute.v2021_07_01.models.RestorePointSourceMetadata + :ivar provisioning_state: Gets the provisioning state of the restore point. + :vartype provisioning_state: str + :ivar consistency_mode: Gets the consistency mode for the restore point. Please refer to + https://aka.ms/RestorePoints for more details. Possible values include: "CrashConsistent", + "FileSystemConsistent", "ApplicationConsistent". + :vartype consistency_mode: str or ~azure.mgmt.compute.v2021_07_01.models.ConsistencyModeTypes + :ivar provisioning_details: Gets the provisioning details set by the server during Create + restore point operation. + :vartype provisioning_details: + ~azure.mgmt.compute.v2021_07_01.models.RestorePointProvisioningDetails + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'source_metadata': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'consistency_mode': {'readonly': True}, + 'provisioning_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'exclude_disks': {'key': 'properties.excludeDisks', 'type': '[ApiEntityReference]'}, + 'source_metadata': {'key': 'properties.sourceMetadata', 'type': 'RestorePointSourceMetadata'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'consistency_mode': {'key': 'properties.consistencyMode', 'type': 'str'}, + 'provisioning_details': {'key': 'properties.provisioningDetails', 'type': 'RestorePointProvisioningDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(RestorePoint, self).__init__(**kwargs) + self.exclude_disks = kwargs.get('exclude_disks', None) + self.source_metadata = None + self.provisioning_state = None + self.consistency_mode = None + self.provisioning_details = None + + +class RestorePointCollection(Resource): + """Create or update Restore Point collection parameters. + + 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: The properties of the source resource that this restore point collection is + created from. + :type source: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollectionSourceProperties + :ivar provisioning_state: The provisioning state of the restore point collection. + :vartype provisioning_state: str + :ivar restore_point_collection_id: The unique id of the restore point collection. + :vartype restore_point_collection_id: str + :ivar restore_points: A list containing all restore points created under this restore point + collection. + :vartype restore_points: list[~azure.mgmt.compute.v2021_07_01.models.RestorePoint] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'restore_point_collection_id': {'readonly': True}, + 'restore_points': {'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': {'key': 'properties.source', 'type': 'RestorePointCollectionSourceProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'restore_point_collection_id': {'key': 'properties.restorePointCollectionId', 'type': 'str'}, + 'restore_points': {'key': 'properties.restorePoints', 'type': '[RestorePoint]'}, + } + + def __init__( + self, + **kwargs + ): + super(RestorePointCollection, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.provisioning_state = None + self.restore_point_collection_id = None + self.restore_points = None + + +class RestorePointCollectionListResult(msrest.serialization.Model): + """The List restore point collection operation response. + + :param value: Gets the list of restore point collections. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.RestorePointCollection] + :param next_link: The uri to fetch the next page of RestorePointCollections. Call ListNext() + with this to fetch the next page of RestorePointCollections. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RestorePointCollection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RestorePointCollectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class RestorePointCollectionSourceProperties(msrest.serialization.Model): + """The properties of the source resource that this restore point collection is created from. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Location of the source resource used to create this restore point collection. + :vartype location: str + :param id: Resource Id of the source resource used to create this restore point collection. + :type id: str + """ + + _validation = { + 'location': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RestorePointCollectionSourceProperties, self).__init__(**kwargs) + self.location = None + self.id = kwargs.get('id', None) + + +class RestorePointCollectionUpdate(UpdateResource): + """Update Restore Point collection parameters. + + 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: The properties of the source resource that this restore point collection is + created from. + :type source: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollectionSourceProperties + :ivar provisioning_state: The provisioning state of the restore point collection. + :vartype provisioning_state: str + :ivar restore_point_collection_id: The unique id of the restore point collection. + :vartype restore_point_collection_id: str + :ivar restore_points: A list containing all restore points created under this restore point + collection. + :vartype restore_points: list[~azure.mgmt.compute.v2021_07_01.models.RestorePoint] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'restore_point_collection_id': {'readonly': True}, + 'restore_points': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'RestorePointCollectionSourceProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'restore_point_collection_id': {'key': 'properties.restorePointCollectionId', 'type': 'str'}, + 'restore_points': {'key': 'properties.restorePoints', 'type': '[RestorePoint]'}, + } + + def __init__( + self, + **kwargs + ): + super(RestorePointCollectionUpdate, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.provisioning_state = None + self.restore_point_collection_id = None + self.restore_points = None + + +class RestorePointProvisioningDetails(msrest.serialization.Model): + """Restore Point Provisioning details. + + :param creation_time: Gets the creation time of the restore point. + :type creation_time: ~datetime.datetime + :param total_used_size_in_bytes: Gets the total size of the data in all the disks which are + part of the restore point. + :type total_used_size_in_bytes: long + :param status_code: Gets the status of the Create restore point operation. + :type status_code: int + :param status_message: Gets the status message of the Create restore point operation. + :type status_message: str + """ + + _attribute_map = { + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'total_used_size_in_bytes': {'key': 'totalUsedSizeInBytes', 'type': 'long'}, + 'status_code': {'key': 'statusCode', 'type': 'int'}, + 'status_message': {'key': 'statusMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RestorePointProvisioningDetails, self).__init__(**kwargs) + self.creation_time = kwargs.get('creation_time', None) + self.total_used_size_in_bytes = kwargs.get('total_used_size_in_bytes', None) + self.status_code = kwargs.get('status_code', None) + self.status_message = kwargs.get('status_message', None) + + +class RestorePointSourceMetadata(msrest.serialization.Model): + """Describes the properties of the Virtual Machine for which the restore point was created. The properties provided are a subset and the snapshot of the overall Virtual Machine properties captured at the time of the restore point creation. + + :param hardware_profile: Gets the hardware profile. + :type hardware_profile: ~azure.mgmt.compute.v2021_07_01.models.HardwareProfile + :param storage_profile: Gets the storage profile. + :type storage_profile: + ~azure.mgmt.compute.v2021_07_01.models.RestorePointSourceVMStorageProfile + :param os_profile: Gets the OS profile. + :type os_profile: ~azure.mgmt.compute.v2021_07_01.models.OSProfile + :param diagnostics_profile: Gets the diagnostics profile. + :type diagnostics_profile: ~azure.mgmt.compute.v2021_07_01.models.DiagnosticsProfile + :param license_type: Gets the license type, which is for bring your own license scenario. + :type license_type: str + :param vm_id: Gets the virtual machine unique id. + :type vm_id: str + :param security_profile: Gets the security profile. + :type security_profile: ~azure.mgmt.compute.v2021_07_01.models.SecurityProfile + :param location: Location of the VM from which the restore point was created. + :type location: str + """ + + _attribute_map = { + 'hardware_profile': {'key': 'hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'RestorePointSourceVMStorageProfile'}, + 'os_profile': {'key': 'osProfile', 'type': 'OSProfile'}, + 'diagnostics_profile': {'key': 'diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'security_profile': {'key': 'securityProfile', 'type': 'SecurityProfile'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RestorePointSourceMetadata, self).__init__(**kwargs) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.license_type = kwargs.get('license_type', None) + self.vm_id = kwargs.get('vm_id', None) + self.security_profile = kwargs.get('security_profile', None) + self.location = kwargs.get('location', None) + + +class RestorePointSourceVMDataDisk(msrest.serialization.Model): + """Describes a data disk. + + :param lun: Gets the logical unit number. + :type lun: int + :param name: Gets the disk name. + :type name: str + :param caching: Gets the caching type. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2021_07_01.models.CachingTypes + :param disk_size_gb: Gets the initial disk size in GB for blank data disks, and the new desired + size for existing OS and Data disks. + :type disk_size_gb: int + :param managed_disk: Gets the managed disk details. + :type managed_disk: ~azure.mgmt.compute.v2021_07_01.models.ManagedDiskParameters + :param disk_restore_point: Gets the disk restore point Id. + :type disk_restore_point: ~azure.mgmt.compute.v2021_07_01.models.ApiEntityReference + """ + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, + 'disk_restore_point': {'key': 'diskRestorePoint', 'type': 'ApiEntityReference'}, + } + + def __init__( + self, + **kwargs + ): + super(RestorePointSourceVMDataDisk, self).__init__(**kwargs) + self.lun = kwargs.get('lun', None) + self.name = kwargs.get('name', None) + self.caching = kwargs.get('caching', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', None) + self.disk_restore_point = kwargs.get('disk_restore_point', None) + + +class RestorePointSourceVMOSDisk(msrest.serialization.Model): + """Describes an Operating System disk. + + :param os_type: Gets the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemType + :param encryption_settings: Gets the disk encryption settings. + :type encryption_settings: ~azure.mgmt.compute.v2021_07_01.models.DiskEncryptionSettings + :param name: Gets the disk name. + :type name: str + :param caching: Gets the caching type. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2021_07_01.models.CachingTypes + :param disk_size_gb: Gets the disk size in GB. + :type disk_size_gb: int + :param managed_disk: Gets the managed disk details. + :type managed_disk: ~azure.mgmt.compute.v2021_07_01.models.ManagedDiskParameters + :param disk_restore_point: Gets the disk restore point Id. + :type disk_restore_point: ~azure.mgmt.compute.v2021_07_01.models.ApiEntityReference + """ + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'str'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': 'DiskEncryptionSettings'}, + 'name': {'key': 'name', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, + 'disk_restore_point': {'key': 'diskRestorePoint', 'type': 'ApiEntityReference'}, + } + + def __init__( + self, + **kwargs + ): + super(RestorePointSourceVMOSDisk, 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.caching = kwargs.get('caching', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', None) + self.disk_restore_point = kwargs.get('disk_restore_point', None) + + +class RestorePointSourceVMStorageProfile(msrest.serialization.Model): + """Describes the storage profile. + + :param os_disk: Gets the OS disk of the VM captured at the time of the restore point creation. + :type os_disk: ~azure.mgmt.compute.v2021_07_01.models.RestorePointSourceVMOSDisk + :param data_disks: Gets the data disks of the VM captured at the time of the restore point + creation. + :type data_disks: list[~azure.mgmt.compute.v2021_07_01.models.RestorePointSourceVMDataDisk] + """ + + _attribute_map = { + 'os_disk': {'key': 'osDisk', 'type': 'RestorePointSourceVMOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[RestorePointSourceVMDataDisk]'}, + } + + def __init__( + self, + **kwargs + ): + super(RestorePointSourceVMStorageProfile, self).__init__(**kwargs) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) + + +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.v2021_07_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 + :param enable_cross_zone_upgrade: Allow VMSS to ignore AZ boundaries when constructing upgrade + batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the + batch size. + :type enable_cross_zone_upgrade: bool + :param prioritize_unhealthy_instances: Upgrade all unhealthy instances in a scale set before + any healthy instances. + :type prioritize_unhealthy_instances: bool + """ + + _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'}, + 'enable_cross_zone_upgrade': {'key': 'enableCrossZoneUpgrade', 'type': 'bool'}, + 'prioritize_unhealthy_instances': {'key': 'prioritizeUnhealthyInstances', 'type': 'bool'}, + } + + 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) + self.enable_cross_zone_upgrade = kwargs.get('enable_cross_zone_upgrade', None) + self.prioritize_unhealthy_instances = kwargs.get('prioritize_unhealthy_instances', 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.v2021_07_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.v2021_07_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.v2021_07_01.models.RollingUpgradePolicy + :ivar running_status: Information about the current running state of the overall upgrade. + :vartype running_status: ~azure.mgmt.compute.v2021_07_01.models.RollingUpgradeRunningStatus + :ivar progress: Information about the number of virtual machine instances in each upgrade + state. + :vartype progress: ~azure.mgmt.compute.v2021_07_01.models.RollingUpgradeProgressInfo + :ivar error: Error details for this upgrade, if there are any. + :vartype error: ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetScaleInRules] + :param force_deletion: This property allows you to specify if virtual machines chosen for + removal have to be force deleted when a virtual machine scale set is being scaled-in.(Feature + in Preview). + :type force_deletion: bool + """ + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[str]'}, + 'force_deletion': {'key': 'forceDeletion', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ScaleInPolicy, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.force_deletion = kwargs.get('force_deletion', None) + + +class ScheduledEventsProfile(msrest.serialization.Model): + """ScheduledEventsProfile. + + :param terminate_notification_profile: Specifies Terminate Scheduled Event related + configurations. + :type terminate_notification_profile: + ~azure.mgmt.compute.v2021_07_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 uefi_settings: Specifies the security settings like secure boot and vTPM used while + creating the virtual machine. :code:`
`:code:`
`Minimum api-version: 2020-12-01. + :type uefi_settings: ~azure.mgmt.compute.v2021_07_01.models.UefiSettings + :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 + :param security_type: Specifies the SecurityType of the virtual machine. It is set as + TrustedLaunch to enable UefiSettings. :code:`
`:code:`
` Default: UefiSettings will not + be enabled unless this property is set as TrustedLaunch. Possible values include: + "TrustedLaunch". + :type security_type: str or ~azure.mgmt.compute.v2021_07_01.models.SecurityTypes + """ + + _attribute_map = { + 'uefi_settings': {'key': 'uefiSettings', 'type': 'UefiSettings'}, + 'encryption_at_host': {'key': 'encryptionAtHost', 'type': 'bool'}, + 'security_type': {'key': 'securityType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityProfile, self).__init__(**kwargs) + self.uefi_settings = kwargs.get('uefi_settings', None) + self.encryption_at_host = kwargs.get('encryption_at_host', None) + self.security_type = kwargs.get('security_type', None) + + +class SharedGallery(PirSharedGalleryResource): + """Specifies information about the Shared Gallery that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedGallery, self).__init__(**kwargs) + + +class SharedGalleryImage(PirSharedGalleryResource): + """Specifies information about the gallery image definition that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemStateTypes + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2021_07_01.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2021_07_01.models.Disallowed + :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.v2021_07_01.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2021_07_01.models.GalleryImageFeature] + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2021_07_01.models.ImagePurchasePlan + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedGalleryImage, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.os_state = kwargs.get('os_state', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.identifier = kwargs.get('identifier', None) + self.recommended = kwargs.get('recommended', None) + self.disallowed = kwargs.get('disallowed', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.features = kwargs.get('features', None) + self.purchase_plan = kwargs.get('purchase_plan', None) + + +class SharedGalleryImageList(msrest.serialization.Model): + """The List Shared Gallery Images operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of shared gallery images. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.SharedGalleryImage] + :param next_link: The uri to fetch the next page of shared gallery images. Call ListNext() with + this to fetch the next page of shared gallery images. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedGalleryImage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedGalleryImageList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class SharedGalleryImageVersion(PirSharedGalleryResource): + """Specifies information about the gallery image version that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + :param published_date: The published date of the gallery image version Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'published_date': {'key': 'properties.publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedGalleryImageVersion, self).__init__(**kwargs) + self.published_date = kwargs.get('published_date', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + + +class SharedGalleryImageVersionList(msrest.serialization.Model): + """The List Shared Gallery Image versions operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of shared gallery images versions. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.SharedGalleryImageVersion] + :param next_link: The uri to fetch the next page of shared gallery image versions. Call + ListNext() with this to fetch the next page of shared gallery image versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedGalleryImageVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedGalleryImageVersionList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class SharedGalleryList(msrest.serialization.Model): + """The List Shared Galleries operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of shared galleries. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.SharedGallery] + :param next_link: The uri to fetch the next page of shared galleries. Call ListNext() with this + to fetch the next page of shared galleries. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedGallery]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedGalleryList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class SharingProfile(msrest.serialization.Model): + """Profile for gallery sharing to subscription or tenant. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param permissions: This property allows you to specify the permission of sharing gallery. + :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Private** + :code:`
`:code:`
` **Groups**. Possible values include: "Private", "Groups". + :type permissions: str or ~azure.mgmt.compute.v2021_07_01.models.GallerySharingPermissionTypes + :ivar groups: A list of sharing profile groups. + :vartype groups: list[~azure.mgmt.compute.v2021_07_01.models.SharingProfileGroup] + """ + + _validation = { + 'groups': {'readonly': True}, + } + + _attribute_map = { + 'permissions': {'key': 'permissions', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[SharingProfileGroup]'}, + } + + def __init__( + self, + **kwargs + ): + super(SharingProfile, self).__init__(**kwargs) + self.permissions = kwargs.get('permissions', None) + self.groups = None + + +class SharingProfileGroup(msrest.serialization.Model): + """Group of the gallery sharing profile. + + :param type: This property allows you to specify the type of sharing group. + :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Subscriptions** + :code:`
`:code:`
` **AADTenants**. Possible values include: "Subscriptions", + "AADTenants". + :type type: str or ~azure.mgmt.compute.v2021_07_01.models.SharingProfileGroupTypes + :param ids: A list of subscription/tenant ids the gallery is aimed to be shared to. + :type ids: list[str] + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'ids': {'key': 'ids', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SharingProfileGroup, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.ids = kwargs.get('ids', None) + + +class SharingUpdate(msrest.serialization.Model): + """Specifies information about the gallery sharing profile update. + + All required parameters must be populated in order to send to Azure. + + :param operation_type: Required. This property allows you to specify the operation type of + gallery sharing update. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` + **Add** :code:`
`:code:`
` **Remove** :code:`
`:code:`
` **Reset**. Possible values + include: "Add", "Remove", "Reset". + :type operation_type: str or ~azure.mgmt.compute.v2021_07_01.models.SharingUpdateOperationTypes + :param groups: A list of sharing profile groups. + :type groups: list[~azure.mgmt.compute.v2021_07_01.models.SharingProfileGroup] + """ + + _validation = { + 'operation_type': {'required': True}, + } + + _attribute_map = { + 'operation_type': {'key': 'operationType', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[SharingProfileGroup]'}, + } + + def __init__( + self, + **kwargs + ): + super(SharingUpdate, self).__init__(**kwargs) + self.operation_type = kwargs['operation_type'] + self.groups = kwargs.get('groups', 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 SoftDeletePolicy(msrest.serialization.Model): + """Contains information about the soft deletion policy of the gallery. + + :param is_soft_delete_enabled: Enables soft-deletion for resources in this gallery, allowing + them to be recovered within retention time. + :type is_soft_delete_enabled: bool + """ + + _attribute_map = { + 'is_soft_delete_enabled': {'key': 'isSoftDeleteEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SoftDeletePolicy, self).__init__(**kwargs) + self.is_soft_delete_enabled = kwargs.get('is_soft_delete_enabled', None) + + +class SpotRestorePolicy(msrest.serialization.Model): + """Specifies the Spot-Try-Restore properties for the virtual machine scale set. :code:`
`:code:`
` With this property customer can enable or disable automatic restore of the evicted Spot VMSS VM instances opportunistically based on capacity availability and pricing constraint. + + :param enabled: Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be + tried to be restored opportunistically based on capacity availability and pricing constraints. + :type enabled: bool + :param restore_timeout: Timeout value expressed as an ISO 8601 time duration after which the + platform will not try to restore the VMSS SPOT instances. + :type restore_timeout: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'restore_timeout': {'key': 'restoreTimeout', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SpotRestorePolicy, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.restore_timeout = kwargs.get('restore_timeout', 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.v2021_07_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]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + :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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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 TargetRegion(msrest.serialization.Model): + """Describes the target region information. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the region. + :type name: str + :param regional_replica_count: The number of replicas of the Image Version to be created per + region. This property is updatable. + :type regional_replica_count: int + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_01.models.StorageAccountType + :param encryption: Optional. Allows users to provide customer managed keys for encrypting the + OS and data disks in the gallery artifact. + :type encryption: ~azure.mgmt.compute.v2021_07_01.models.EncryptionImages + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'regional_replica_count': {'key': 'regionalReplicaCount', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'encryption': {'key': 'encryption', 'type': 'EncryptionImages'}, + } + + def __init__( + self, + **kwargs + ): + super(TargetRegion, self).__init__(**kwargs) + self.name = kwargs['name'] + self.regional_replica_count = kwargs.get('regional_replica_count', None) + self.storage_account_type = kwargs.get('storage_account_type', None) + self.encryption = kwargs.get('encryption', 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 + :param group_by_client_application_id: Group query result by Client Application ID. + :type group_by_client_application_id: bool + :param group_by_user_agent: Group query result by User Agent. + :type group_by_user_agent: bool + """ + + _validation = { + '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'}, + 'group_by_client_application_id': {'key': 'groupByClientApplicationId', 'type': 'bool'}, + 'group_by_user_agent': {'key': 'groupByUserAgent', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ThrottledRequestsInput, self).__init__(**kwargs) + + +class UefiSettings(msrest.serialization.Model): + """Specifies the security settings like secure boot and vTPM used while creating the virtual machine. :code:`
`:code:`
`Minimum api-version: 2020-12-01. + + :param secure_boot_enabled: Specifies whether secure boot should be enabled on the virtual + machine. :code:`
`:code:`
`Minimum api-version: 2020-12-01. + :type secure_boot_enabled: bool + :param v_tpm_enabled: Specifies whether vTPM should be enabled on the virtual machine. + :code:`
`:code:`
`Minimum api-version: 2020-12-01. + :type v_tpm_enabled: bool + """ + + _attribute_map = { + 'secure_boot_enabled': {'key': 'secureBootEnabled', 'type': 'bool'}, + 'v_tpm_enabled': {'key': 'vTpmEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(UefiSettings, self).__init__(**kwargs) + self.secure_boot_enabled = kwargs.get('secure_boot_enabled', None) + self.v_tpm_enabled = kwargs.get('v_tpm_enabled', None) + + +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.v2021_07_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.v2021_07_01.models.UpgradeOperationHistoryStatus + :ivar progress: Counts of the VMs in each state. + :vartype progress: ~azure.mgmt.compute.v2021_07_01.models.RollingUpgradeProgressInfo + :ivar error: Error Details for this upgrade if there are any. + :vartype error: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.UpgradeOperationInvoker + :ivar target_image_reference: Image Reference details. + :vartype target_image_reference: ~azure.mgmt.compute.v2021_07_01.models.ImageReference + :ivar rollback_info: Information about OS rollback if performed. + :vartype rollback_info: ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_01.models.UpgradeMode + :param rolling_upgrade_policy: The configuration parameters used while performing a rolling + upgrade. + :type rolling_upgrade_policy: ~azure.mgmt.compute.v2021_07_01.models.RollingUpgradePolicy + :param automatic_os_upgrade_policy: Configuration parameters used for performing automatic OS + Upgrade. + :type automatic_os_upgrade_policy: + ~azure.mgmt.compute.v2021_07_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: An enum describing the unit of usage measurement. Has constant 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.v2021_07_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 UserArtifactManage(msrest.serialization.Model): + """UserArtifactManage. + + All required parameters must be populated in order to send to Azure. + + :param install: Required. Required. The path and arguments to install the gallery application. + This is limited to 4096 characters. + :type install: str + :param remove: Required. Required. The path and arguments to remove the gallery application. + This is limited to 4096 characters. + :type remove: str + :param update: Optional. The path and arguments to update the gallery application. If not + present, then update operation will invoke remove command on the previous version and install + command on the current version of the gallery application. This is limited to 4096 characters. + :type update: str + """ + + _validation = { + 'install': {'required': True}, + 'remove': {'required': True}, + } + + _attribute_map = { + 'install': {'key': 'install', 'type': 'str'}, + 'remove': {'key': 'remove', 'type': 'str'}, + 'update': {'key': 'update', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserArtifactManage, self).__init__(**kwargs) + self.install = kwargs['install'] + self.remove = kwargs['remove'] + self.update = kwargs.get('update', None) + + +class UserArtifactSource(msrest.serialization.Model): + """The source image from which the Image Version is going to be created. + + All required parameters must be populated in order to send to Azure. + + :param media_link: Required. Required. The mediaLink of the artifact, must be a readable + storage page blob. + :type media_link: str + :param default_configuration_link: Optional. The defaultConfigurationLink of the artifact, must + be a readable storage page blob. + :type default_configuration_link: str + """ + + _validation = { + 'media_link': {'required': True}, + } + + _attribute_map = { + 'media_link': {'key': 'mediaLink', 'type': 'str'}, + 'default_configuration_link': {'key': 'defaultConfigurationLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserArtifactSource, self).__init__(**kwargs) + self.media_link = kwargs['media_link'] + self.default_configuration_link = kwargs.get('default_configuration_link', None) + + +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + 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(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = 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:`
`} :code:`
` To install certificates on a + virtual machine it is recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ or the + `Azure Key Vault virtual machine extension for Windows + `_. + :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.v2021_07_01.models.SubResource + :param vault_certificates: The list of key vault references in SourceVault which contain + certificates. + :type vault_certificates: list[~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.Plan + :ivar resources: The virtual machine child extension resources. + :vartype resources: list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineExtension] + :param identity: The identity of the virtual machine, if configured. + :type identity: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineIdentity + :param zones: The virtual machine zones. + :type zones: list[str] + :param extended_location: The extended location of the Virtual Machine. + :type extended_location: ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocation + :param hardware_profile: Specifies the hardware settings for the virtual machine. + :type hardware_profile: ~azure.mgmt.compute.v2021_07_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2021_07_01.models.StorageProfile + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + virtual machine. + :type additional_capabilities: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual machine. + :type network_profile: ~azure.mgmt.compute.v2021_07_01.models.NetworkProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machine. + :type security_profile: ~azure.mgmt.compute.v2021_07_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.v2021_07_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 `Availability sets overview + `_. + :code:`
`:code:`
` For more information on Azure planned maintenance, see `Maintenance + and updates 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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used was licensed + on-premises. :code:`
`:code:`
` Possible values for Windows Server operating system are: + :code:`
`:code:`
` Windows_Client :code:`
`:code:`
` Windows_Server + :code:`
`:code:`
` Possible values for Linux Server operating system are: + :code:`
`:code:`
` RHEL_BYOS (for RHEL) :code:`
`:code:`
` SLES_BYOS (for SUSE) + :code:`
`:code:`
` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ + :code:`
`:code:`
` `Azure Hybrid Use Benefit for Linux 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 + :param platform_fault_domain: Specifies the scale set logical fault domain into which the + Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned + to a fault domain that best maintains balance across available fault + domains.:code:`
`:code:`
  • `This is applicable only if the 'virtualMachineScaleSet' + property of this Virtual Machine is set.:code:`
  • `The Virtual Machine Scale Set that is + referenced, must have 'platformFaultDomainCount' > 1.:code:`
  • `This property cannot be + updated once the Virtual Machine is created.:code:`
  • `Fault domain assignment can be viewed + in the Virtual Machine Instance View.:code:`
    `:code:`
    `Minimum api‐version: 2020‐12‐01. + :type platform_fault_domain: int + :param scheduled_events_profile: Specifies Scheduled Event related configurations. + :type scheduled_events_profile: ~azure.mgmt.compute.v2021_07_01.models.ScheduledEventsProfile + :param user_data: UserData for the VM, which must be base-64 encoded. Customer should not pass + any secrets in here. :code:`
    `:code:`
    `Minimum api-version: 2021-03-01. + :type user_data: str + :param capacity_reservation: Specifies information about the capacity reservation that is used + to allocate virtual machine. :code:`
    `:code:`
    `Minimum api-version: 2021-04-01. + :type capacity_reservation: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationProfile + :param application_profile: Specifies the gallery applications that should be made available to + the VM/VMSS. + :type application_profile: ~azure.mgmt.compute.v2021_07_01.models.ApplicationProfile + """ + + _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]'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + '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'}, + 'platform_fault_domain': {'key': 'properties.platformFaultDomain', 'type': 'int'}, + 'scheduled_events_profile': {'key': 'properties.scheduledEventsProfile', 'type': 'ScheduledEventsProfile'}, + 'user_data': {'key': 'properties.userData', 'type': 'str'}, + 'capacity_reservation': {'key': 'properties.capacityReservation', 'type': 'CapacityReservationProfile'}, + 'application_profile': {'key': 'properties.applicationProfile', 'type': 'ApplicationProfile'}, + } + + 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.extended_location = kwargs.get('extended_location', 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) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.scheduled_events_profile = kwargs.get('scheduled_events_profile', None) + self.user_data = kwargs.get('user_data', None) + self.capacity_reservation = kwargs.get('capacity_reservation', None) + self.application_profile = kwargs.get('application_profile', 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.v2021_07_01.models.VirtualMachineExtensionHandlerInstanceView] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_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 "Unknown", "Failed", "Succeeded", + or "CompletedWithWarnings.". Possible values include: "Unknown", "InProgress", "Failed", + "Succeeded", "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2021_07_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 available_patches: The list of patches that have been detected as available for + installation. + :vartype available_patches: + list[~azure.mgmt.compute.v2021_07_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.v2021_07_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}, + 'available_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'}, + 'available_patches': {'key': 'availablePatches', '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.available_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: any + :ivar resources: a list of resource items of the captured virtual machine. + :vartype resources: list[any] + """ + + _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: any + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: any + :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.v2021_07_01.models.VirtualMachineExtensionInstanceView + :param suppress_failures: Indicates whether failures stemming from the extension will be + suppressed (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :type suppress_failures: bool + """ + + _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'}, + 'suppress_failures': {'key': 'properties.suppressFailures', 'type': 'bool'}, + } + + 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) + self.suppress_failures = kwargs.get('suppress_failures', 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.v2021_07_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.v2021_07_01.models.InstanceViewStatus] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_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.v2021_07_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: any + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: any + :param suppress_failures: Indicates whether failures stemming from the extension will be + suppressed (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :type suppress_failures: bool + """ + + _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'}, + 'suppress_failures': {'key': 'properties.suppressFailures', 'type': 'bool'}, + } + + 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) + self.suppress_failures = kwargs.get('suppress_failures', 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.v2021_07_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.v2021_07_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.v2021_07_01.models.UserAssignedIdentitiesValue] + """ + + _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': '{UserAssignedIdentitiesValue}'}, + } + + 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] + :param extended_location: The extended location of the Virtual Machine. + :type extended_location: ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocation + """ + + _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}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineImageResource, self).__init__(**kwargs) + self.name = kwargs['name'] + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + self.extended_location = kwargs.get('extended_location', 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 extended_location: The extended location of the Virtual Machine. + :type extended_location: ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocation + :param plan: Used for establishing the purchase context of any 3rd Party artifact through + MarketPlace. + :type plan: ~azure.mgmt.compute.v2021_07_01.models.PurchasePlan + :param os_disk_image: Contains the os disk image information. + :type os_disk_image: ~azure.mgmt.compute.v2021_07_01.models.OSDiskImage + :param data_disk_images: + :type data_disk_images: list[~azure.mgmt.compute.v2021_07_01.models.DataDiskImage] + :param automatic_os_upgrade_properties: Describes automatic OS upgrade properties on the image. + :type automatic_os_upgrade_properties: + ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.HyperVGenerationTypes + :param disallowed: Specifies disallowed configuration for the VirtualMachine created from the + image. + :type disallowed: ~azure.mgmt.compute.v2021_07_01.models.DisallowedConfiguration + :param features: + :type features: list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineImageFeature] + """ + + _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}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + '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'}, + 'features': {'key': 'properties.features', 'type': '[VirtualMachineImageFeature]'}, + } + + 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) + self.features = kwargs.get('features', None) + + +class VirtualMachineImageFeature(msrest.serialization.Model): + """Specifies additional capabilities supported by the image. + + :param name: The name of the feature. + :type name: str + :param value: The corresponding value for the feature. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineImageFeature, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class VirtualMachineInstallPatchesParameters(msrest.serialization.Model): + """Input for InstallPatches as directly received by the API. + + All required parameters must be populated in order to send to Azure. + + :param maximum_duration: Specifies the maximum amount of time that the operation will run. It + must be an ISO 8601-compliant duration string such as PT4H (4 hours). + :type maximum_duration: str + :param reboot_setting: Required. Defines when it is acceptable to reboot a VM during a software + update operation. Possible values include: "IfRequired", "Never", "Always". + :type reboot_setting: str or ~azure.mgmt.compute.v2021_07_01.models.VMGuestPatchRebootSetting + :param windows_parameters: Input for InstallPatches on a Windows VM, as directly received by + the API. + :type windows_parameters: ~azure.mgmt.compute.v2021_07_01.models.WindowsParameters + :param linux_parameters: Input for InstallPatches on a Linux VM, as directly received by the + API. + :type linux_parameters: ~azure.mgmt.compute.v2021_07_01.models.LinuxParameters + """ + + _validation = { + 'reboot_setting': {'required': True}, + } + + _attribute_map = { + 'maximum_duration': {'key': 'maximumDuration', 'type': 'str'}, + 'reboot_setting': {'key': 'rebootSetting', 'type': 'str'}, + 'windows_parameters': {'key': 'windowsParameters', 'type': 'WindowsParameters'}, + 'linux_parameters': {'key': 'linuxParameters', 'type': 'LinuxParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineInstallPatchesParameters, self).__init__(**kwargs) + self.maximum_duration = kwargs.get('maximum_duration', None) + self.reboot_setting = kwargs['reboot_setting'] + self.windows_parameters = kwargs.get('windows_parameters', None) + self.linux_parameters = kwargs.get('linux_parameters', None) + + +class VirtualMachineInstallPatchesResult(msrest.serialization.Model): + """The result summary of an installation operation. + + 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", "Unknown" or + "CompletedWithWarnings.". Possible values include: "Unknown", "InProgress", "Failed", + "Succeeded", "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2021_07_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 reboot_status: The reboot state of the VM following completion of the operation. Possible + values include: "Unknown", "NotNeeded", "Required", "Started", "Failed", "Completed". + :vartype reboot_status: str or ~azure.mgmt.compute.v2021_07_01.models.VMGuestPatchRebootStatus + :ivar maintenance_window_exceeded: Whether the operation ran out of time before it completed + all its intended actions. + :vartype maintenance_window_exceeded: bool + :ivar excluded_patch_count: The number of patches that were not installed due to the user + blocking their installation. + :vartype excluded_patch_count: int + :ivar not_selected_patch_count: The number of patches that were detected as available for + install, but did not meet the operation's criteria. + :vartype not_selected_patch_count: int + :ivar pending_patch_count: The number of patches that were identified as meeting the + installation criteria, but were not able to be installed. Typically this happens when + maintenanceWindowExceeded == true. + :vartype pending_patch_count: int + :ivar installed_patch_count: The number of patches successfully installed. + :vartype installed_patch_count: int + :ivar failed_patch_count: The number of patches that could not be installed due to some issue. + See errors for details. + :vartype failed_patch_count: int + :ivar patches: The patches that were installed during the operation. + :vartype patches: list[~azure.mgmt.compute.v2021_07_01.models.PatchInstallationDetail] + :ivar start_date_time: The UTC timestamp when the operation began. + :vartype start_date_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.v2021_07_01.models.ApiError + """ + + _validation = { + 'status': {'readonly': True}, + 'installation_activity_id': {'readonly': True}, + 'reboot_status': {'readonly': True}, + 'maintenance_window_exceeded': {'readonly': True}, + 'excluded_patch_count': {'readonly': True}, + 'not_selected_patch_count': {'readonly': True}, + 'pending_patch_count': {'readonly': True}, + 'installed_patch_count': {'readonly': True}, + 'failed_patch_count': {'readonly': True}, + 'patches': {'readonly': True}, + 'start_date_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'installation_activity_id': {'key': 'installationActivityId', 'type': 'str'}, + 'reboot_status': {'key': 'rebootStatus', 'type': 'str'}, + 'maintenance_window_exceeded': {'key': 'maintenanceWindowExceeded', 'type': 'bool'}, + 'excluded_patch_count': {'key': 'excludedPatchCount', 'type': 'int'}, + 'not_selected_patch_count': {'key': 'notSelectedPatchCount', 'type': 'int'}, + 'pending_patch_count': {'key': 'pendingPatchCount', 'type': 'int'}, + 'installed_patch_count': {'key': 'installedPatchCount', 'type': 'int'}, + 'failed_patch_count': {'key': 'failedPatchCount', 'type': 'int'}, + 'patches': {'key': 'patches', 'type': '[PatchInstallationDetail]'}, + 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineInstallPatchesResult, self).__init__(**kwargs) + self.status = None + self.installation_activity_id = None + self.reboot_status = None + self.maintenance_window_exceeded = None + self.excluded_patch_count = None + self.not_selected_patch_count = None + self.pending_patch_count = None + self.installed_patch_count = None + self.failed_patch_count = None + self.patches = None + self.start_date_time = None + self.error = 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.v2021_07_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.v2021_07_01.models.VirtualMachineAgentInstanceView + :param maintenance_redeploy_status: The Maintenance Operation status on the virtual machine. + :type maintenance_redeploy_status: + ~azure.mgmt.compute.v2021_07_01.models.MaintenanceRedeployStatus + :param disks: The virtual machine disk information. + :type disks: list[~azure.mgmt.compute.v2021_07_01.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineExtensionInstanceView] + :ivar vm_health: The health status for the VM. + :vartype vm_health: ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_01.models.InstanceViewStatus] + :param patch_status: [Preview Feature] The status of virtual machine patch operations. + :type patch_status: ~azure.mgmt.compute.v2021_07_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 VirtualMachineIpTag(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(VirtualMachineIpTag, self).__init__(**kwargs) + self.ip_tag_type = kwargs.get('ip_tag_type', None) + self.tag = kwargs.get('tag', 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.v2021_07_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 VirtualMachineNetworkInterfaceConfiguration(msrest.serialization.Model): + """Describes a virtual machine network interface configurations. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The network interface 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 delete_option: Specify what happens to the network interface when the VM is deleted. + Possible values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + :param enable_accelerated_networking: Specifies whether the network interface is accelerated + networking-enabled. + :type enable_accelerated_networking: bool + :param enable_fpga: Specifies whether the network interface is FPGA networking-enabled. + :type enable_fpga: bool + :param enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :type enable_ip_forwarding: bool + :param network_security_group: The network security group. + :type network_security_group: ~azure.mgmt.compute.v2021_07_01.models.SubResource + :param dns_settings: The dns settings to be applied on the network interfaces. + :type dns_settings: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration + :param ip_configurations: Specifies the IP configurations of the network interface. + :type ip_configurations: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineNetworkInterfaceIPConfiguration] + :param dscp_configuration: + :type dscp_configuration: ~azure.mgmt.compute.v2021_07_01.models.SubResource + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_fpga': {'key': 'properties.enableFpga', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineNetworkInterfaceDnsSettingsConfiguration'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineNetworkInterfaceIPConfiguration]'}, + 'dscp_configuration': {'key': 'properties.dscpConfiguration', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineNetworkInterfaceConfiguration, self).__init__(**kwargs) + self.name = kwargs['name'] + self.primary = kwargs.get('primary', None) + self.delete_option = kwargs.get('delete_option', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.enable_fpga = kwargs.get('enable_fpga', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', 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.dscp_configuration = kwargs.get('dscp_configuration', None) + + +class VirtualMachineNetworkInterfaceDnsSettingsConfiguration(msrest.serialization.Model): + """Describes a virtual machines 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(VirtualMachineNetworkInterfaceDnsSettingsConfiguration, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + + +class VirtualMachineNetworkInterfaceIPConfiguration(msrest.serialization.Model): + """Describes a virtual machine network profile's IP configuration. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The IP configuration name. + :type name: str + :param subnet: Specifies the identifier of the subnet. + :type subnet: ~azure.mgmt.compute.v2021_07_01.models.SubResource + :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.v2021_07_01.models.VirtualMachinePublicIPAddressConfiguration + :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.v2021_07_01.models.IPVersions + :param application_security_groups: Specifies an array of references to application security + group. + :type application_security_groups: list[~azure.mgmt.compute.v2021_07_01.models.SubResource] + :param application_gateway_backend_address_pools: Specifies an array of references to backend + address pools of application gateways. A virtual machine can reference backend address pools of + multiple application gateways. Multiple virtual machines cannot use the same application + gateway. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.compute.v2021_07_01.models.SubResource] + :param load_balancer_backend_address_pools: Specifies an array of references to backend address + pools of load balancers. A virtual machine can reference backend address pools of one public + and one internal load balancer. [Multiple virtual machines cannot use the same basic sku load + balancer]. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.compute.v2021_07_01.models.SubResource] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address_configuration': {'key': 'properties.publicIPAddressConfiguration', 'type': 'VirtualMachinePublicIPAddressConfiguration'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'application_security_groups': {'key': 'properties.applicationSecurityGroups', 'type': '[SubResource]'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineNetworkInterfaceIPConfiguration, 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_security_groups = kwargs.get('application_security_groups', None) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + + +class VirtualMachinePatchStatus(msrest.serialization.Model): + """The status of virtual machine patch operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param available_patch_summary: The available patch summary of the latest assessment operation + for the virtual machine. + :type available_patch_summary: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.LastPatchInstallationSummary + :ivar configuration_statuses: The enablement status of the specified patchMode. + :vartype configuration_statuses: + list[~azure.mgmt.compute.v2021_07_01.models.InstanceViewStatus] + """ + + _validation = { + 'configuration_statuses': {'readonly': True}, + } + + _attribute_map = { + 'available_patch_summary': {'key': 'availablePatchSummary', 'type': 'AvailablePatchSummary'}, + 'last_patch_installation_summary': {'key': 'lastPatchInstallationSummary', 'type': 'LastPatchInstallationSummary'}, + 'configuration_statuses': {'key': 'configurationStatuses', 'type': '[InstanceViewStatus]'}, + } + + 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) + self.configuration_statuses = None + + +class VirtualMachinePublicIPAddressConfiguration(msrest.serialization.Model): + """Describes a virtual machines 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 sku: Describes the public IP Sku. + :type sku: ~azure.mgmt.compute.v2021_07_01.models.PublicIPAddressSku + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param delete_option: Specify what happens to the public IP address when the VM is deleted. + Possible values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + :param dns_settings: The dns settings to be applied on the publicIP addresses . + :type dns_settings: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration + :param ip_tags: The list of IP tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineIpTag] + :param public_ip_prefix: The PublicIPPrefix from which to allocate publicIP addresses. + :type public_ip_prefix: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.IPVersions + :param public_ip_allocation_method: Specify the public IP allocation type. Possible values + include: "Dynamic", "Static". + :type public_ip_allocation_method: str or + ~azure.mgmt.compute.v2021_07_01.models.PublicIPAllocationMethod + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachinePublicIPAddressDnsSettingsConfiguration'}, + 'ip_tags': {'key': 'properties.ipTags', 'type': '[VirtualMachineIpTag]'}, + 'public_ip_prefix': {'key': 'properties.publicIPPrefix', 'type': 'SubResource'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachinePublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = kwargs['name'] + self.sku = kwargs.get('sku', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.delete_option = kwargs.get('delete_option', 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) + self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) + + +class VirtualMachinePublicIPAddressDnsSettingsConfiguration(msrest.serialization.Model): + """Describes a virtual machines 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 prefix of the PublicIPAddress + resources that will be created. The generated name label is the concatenation of the domain + name label and vm network profile unique ID. + :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(VirtualMachinePublicIPAddressDnsSettingsConfiguration, self).__init__(**kwargs) + self.domain_name_label = kwargs['domain_name_label'] + + +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 VirtualMachineRunCommand(Resource): + """Describes a Virtual Machine run command. + + 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: The source of the run command script. + :type source: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandScriptSource + :param parameters: The parameters used by the script. + :type parameters: list[~azure.mgmt.compute.v2021_07_01.models.RunCommandInputParameter] + :param protected_parameters: The parameters used by the script. + :type protected_parameters: + list[~azure.mgmt.compute.v2021_07_01.models.RunCommandInputParameter] + :param async_execution: Optional. If set to true, provisioning will complete as soon as the + script starts and will not wait for script to complete. + :type async_execution: bool + :param run_as_user: Specifies the user account on the VM when executing the run command. + :type run_as_user: str + :param run_as_password: Specifies the user account password on the VM when executing the run + command. + :type run_as_password: str + :param timeout_in_seconds: The timeout in seconds to execute the run command. + :type timeout_in_seconds: int + :param output_blob_uri: Specifies the Azure storage blob where script output stream will be + uploaded. + :type output_blob_uri: str + :param error_blob_uri: Specifies the Azure storage blob where script error stream will be + uploaded. + :type error_blob_uri: str + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine run command instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + 'source': {'key': 'properties.source', 'type': 'VirtualMachineRunCommandScriptSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '[RunCommandInputParameter]'}, + 'protected_parameters': {'key': 'properties.protectedParameters', 'type': '[RunCommandInputParameter]'}, + 'async_execution': {'key': 'properties.asyncExecution', 'type': 'bool'}, + 'run_as_user': {'key': 'properties.runAsUser', 'type': 'str'}, + 'run_as_password': {'key': 'properties.runAsPassword', 'type': 'str'}, + 'timeout_in_seconds': {'key': 'properties.timeoutInSeconds', 'type': 'int'}, + 'output_blob_uri': {'key': 'properties.outputBlobUri', 'type': 'str'}, + 'error_blob_uri': {'key': 'properties.errorBlobUri', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineRunCommandInstanceView'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineRunCommand, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.parameters = kwargs.get('parameters', None) + self.protected_parameters = kwargs.get('protected_parameters', None) + self.async_execution = kwargs.get('async_execution', False) + self.run_as_user = kwargs.get('run_as_user', None) + self.run_as_password = kwargs.get('run_as_password', None) + self.timeout_in_seconds = kwargs.get('timeout_in_seconds', None) + self.output_blob_uri = kwargs.get('output_blob_uri', None) + self.error_blob_uri = kwargs.get('error_blob_uri', None) + self.provisioning_state = None + self.instance_view = None + + +class VirtualMachineRunCommandInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine run command. + + :param execution_state: Script execution status. Possible values include: "Unknown", "Pending", + "Running", "Failed", "Succeeded", "TimedOut", "Canceled". + :type execution_state: str or ~azure.mgmt.compute.v2021_07_01.models.ExecutionState + :param execution_message: Communicate script configuration errors or execution messages. + :type execution_message: str + :param exit_code: Exit code returned from script execution. + :type exit_code: int + :param output: Script output stream. + :type output: str + :param error: Script error stream. + :type error: str + :param start_time: Script start time. + :type start_time: ~datetime.datetime + :param end_time: Script end time. + :type end_time: ~datetime.datetime + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'execution_state': {'key': 'executionState', 'type': 'str'}, + 'execution_message': {'key': 'executionMessage', 'type': 'str'}, + 'exit_code': {'key': 'exitCode', 'type': 'int'}, + 'output': {'key': 'output', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineRunCommandInstanceView, self).__init__(**kwargs) + self.execution_state = kwargs.get('execution_state', None) + self.execution_message = kwargs.get('execution_message', None) + self.exit_code = kwargs.get('exit_code', None) + self.output = kwargs.get('output', None) + self.error = kwargs.get('error', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.statuses = kwargs.get('statuses', None) + + +class VirtualMachineRunCommandScriptSource(msrest.serialization.Model): + """Describes the script sources for run command. + + :param script: Specifies the script content to be executed on the VM. + :type script: str + :param script_uri: Specifies the script download location. + :type script_uri: str + :param command_id: Specifies a commandId of predefined built-in script. + :type command_id: str + """ + + _attribute_map = { + 'script': {'key': 'script', 'type': 'str'}, + 'script_uri': {'key': 'scriptUri', 'type': 'str'}, + 'command_id': {'key': 'commandId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineRunCommandScriptSource, self).__init__(**kwargs) + self.script = kwargs.get('script', None) + self.script_uri = kwargs.get('script_uri', None) + self.command_id = kwargs.get('command_id', None) + + +class VirtualMachineRunCommandsListResult(msrest.serialization.Model): + """The List run command operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of run commands. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand] + :param next_link: The uri to fetch the next page of run commands. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineRunCommand]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineRunCommandsListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class VirtualMachineRunCommandUpdate(UpdateResource): + """Describes a Virtual Machine run command. + + 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: The source of the run command script. + :type source: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandScriptSource + :param parameters: The parameters used by the script. + :type parameters: list[~azure.mgmt.compute.v2021_07_01.models.RunCommandInputParameter] + :param protected_parameters: The parameters used by the script. + :type protected_parameters: + list[~azure.mgmt.compute.v2021_07_01.models.RunCommandInputParameter] + :param async_execution: Optional. If set to true, provisioning will complete as soon as the + script starts and will not wait for script to complete. + :type async_execution: bool + :param run_as_user: Specifies the user account on the VM when executing the run command. + :type run_as_user: str + :param run_as_password: Specifies the user account password on the VM when executing the run + command. + :type run_as_password: str + :param timeout_in_seconds: The timeout in seconds to execute the run command. + :type timeout_in_seconds: int + :param output_blob_uri: Specifies the Azure storage blob where script output stream will be + uploaded. + :type output_blob_uri: str + :param error_blob_uri: Specifies the Azure storage blob where script error stream will be + uploaded. + :type error_blob_uri: str + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine run command instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandInstanceView + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'VirtualMachineRunCommandScriptSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '[RunCommandInputParameter]'}, + 'protected_parameters': {'key': 'properties.protectedParameters', 'type': '[RunCommandInputParameter]'}, + 'async_execution': {'key': 'properties.asyncExecution', 'type': 'bool'}, + 'run_as_user': {'key': 'properties.runAsUser', 'type': 'str'}, + 'run_as_password': {'key': 'properties.runAsPassword', 'type': 'str'}, + 'timeout_in_seconds': {'key': 'properties.timeoutInSeconds', 'type': 'int'}, + 'output_blob_uri': {'key': 'properties.outputBlobUri', 'type': 'str'}, + 'error_blob_uri': {'key': 'properties.errorBlobUri', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineRunCommandInstanceView'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineRunCommandUpdate, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.parameters = kwargs.get('parameters', None) + self.protected_parameters = kwargs.get('protected_parameters', None) + self.async_execution = kwargs.get('async_execution', False) + self.run_as_user = kwargs.get('run_as_user', None) + self.run_as_password = kwargs.get('run_as_password', None) + self.timeout_in_seconds = kwargs.get('timeout_in_seconds', None) + self.output_blob_uri = kwargs.get('output_blob_uri', None) + self.error_blob_uri = kwargs.get('error_blob_uri', None) + self.provisioning_state = None + self.instance_view = 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.v2021_07_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.v2021_07_01.models.Plan + :param identity: The identity of the virtual machine scale set, if configured. + :type identity: ~azure.mgmt.compute.v2021_07_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 extended_location: The extended location of the Virtual Machine Scale Set. + :type extended_location: ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocation + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2021_07_01.models.UpgradePolicy + :param automatic_repairs_policy: Policy for automatic repairs. + :type automatic_repairs_policy: ~azure.mgmt.compute.v2021_07_01.models.AutomaticRepairsPolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2021_07_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. zoneBalance property can only be set if the zones property of the + scale set contains more than one zone. If there are no zones or only one zone specified, then + zoneBalance property should not be set. + :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.v2021_07_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.v2021_07_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.v2021_07_01.models.AdditionalCapabilities + :param scale_in_policy: Specifies the policies applied when scaling in Virtual Machines in the + Virtual Machine Scale Set. + :type scale_in_policy: ~azure.mgmt.compute.v2021_07_01.models.ScaleInPolicy + :param orchestration_mode: Specifies the orchestration mode for the virtual machine scale set. + Possible values include: "Uniform", "Flexible". + :type orchestration_mode: str or ~azure.mgmt.compute.v2021_07_01.models.OrchestrationMode + :param spot_restore_policy: Specifies the Spot Restore properties for the virtual machine scale + set. + :type spot_restore_policy: ~azure.mgmt.compute.v2021_07_01.models.SpotRestorePolicy + """ + + _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]'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + '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'}, + 'orchestration_mode': {'key': 'properties.orchestrationMode', 'type': 'str'}, + 'spot_restore_policy': {'key': 'properties.spotRestorePolicy', 'type': 'SpotRestorePolicy'}, + } + + 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.extended_location = kwargs.get('extended_location', 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) + self.orchestration_mode = kwargs.get('orchestration_mode', None) + self.spot_restore_policy = kwargs.get('spot_restore_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.v2021_07_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.v2021_07_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.v2021_07_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: any + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: any + :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] + :param suppress_failures: Indicates whether failures stemming from the extension will be + suppressed (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :type suppress_failures: bool + """ + + _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]'}, + 'suppress_failures': {'key': 'properties.suppressFailures', 'type': 'bool'}, + } + + 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) + self.suppress_failures = kwargs.get('suppress_failures', 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.v2021_07_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.v2021_07_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: any + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: any + :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] + :param suppress_failures: Indicates whether failures stemming from the extension will be + suppressed (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :type suppress_failures: bool + """ + + _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]'}, + 'suppress_failures': {'key': 'properties.suppressFailures', 'type': 'bool'}, + } + + 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) + self.suppress_failures = kwargs.get('suppress_failures', 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.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] + """ + + _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': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, + } + + 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 VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + 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(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = 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.v2021_07_01.models.VirtualMachineScaleSetInstanceViewStatusesSummary + :ivar extensions: The extensions information. + :vartype extensions: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetVMExtensionsSummary] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_01.models.InstanceViewStatus] + :ivar orchestration_services: The orchestration services information. + :vartype orchestration_services: + list[~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.SubResource] + :param application_security_groups: Specifies an array of references to application security + group. + :type application_security_groups: list[~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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", "Premium_ZRS", + "StandardSSD_ZRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.DiskEncryptionSetParameters + """ + + _attribute_map = { + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'DiskEncryptionSetParameters'}, + } + + 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 enable_fpga: Specifies whether the network interface is FPGA networking-enabled. + :type enable_fpga: bool + :param network_security_group: The network security group. + :type network_security_group: ~azure.mgmt.compute.v2021_07_01.models.SubResource + :param dns_settings: The dns settings to be applied on the network interfaces. + :type dns_settings: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :param ip_configurations: Specifies the IP configurations of the network interface. + :type ip_configurations: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetIPConfiguration] + :param enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :type enable_ip_forwarding: bool + :param delete_option: Specify what happens to the network interface when the VM is deleted. + Possible values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + """ + + _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'}, + 'enable_fpga': {'key': 'properties.enableFpga', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + } + + 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.enable_fpga = kwargs.get('enable_fpga', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + self.delete_option = kwargs.get('delete_option', 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.v2021_07_01.models.ApiEntityReference + :param network_interface_configurations: The list of network configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetNetworkConfiguration] + :param network_api_version: specifies the Microsoft.Network API version used when creating + networking resources in the Network Interface Configurations for Virtual Machine Scale Set with + orchestration mode 'Flexible'. Possible values include: "2020-11-01". + :type network_api_version: str or ~azure.mgmt.compute.v2021_07_01.models.NetworkApiVersion + """ + + _attribute_map = { + 'health_probe': {'key': 'healthProbe', 'type': 'ApiEntityReference'}, + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, + 'network_api_version': {'key': 'networkApiVersion', 'type': 'str'}, + } + + 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) + self.network_api_version = kwargs.get('network_api_version', 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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.OperatingSystemTypes + :param image: Specifies information about the unmanaged user image to base the scale set on. + :type image: ~azure.mgmt.compute.v2021_07_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.v2021_07_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. + :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.v2021_07_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 + `_. + :type linux_configuration: ~azure.mgmt.compute.v2021_07_01.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed onto the virtual + machines in the scale set. To install certificates on a virtual machine it is recommended to + use the `Azure Key Vault virtual machine extension for Linux + `_ or the `Azure + Key Vault virtual machine extension for Windows + `_. + :type secrets: list[~azure.mgmt.compute.v2021_07_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 sku: Describes the public IP Sku. + :type sku: ~azure.mgmt.compute.v2021_07_01.models.PublicIPAddressSku + :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.v2021_07_01.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + :param ip_tags: The list of IP tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetIpTag] + :param public_ip_prefix: The PublicIPPrefix from which to allocate publicIP addresses. + :type public_ip_prefix: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.IPVersion + :param delete_option: Specify what happens to the public IP when the VM is deleted. Possible + values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, + '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'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetPublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = kwargs['name'] + self.sku = kwargs.get('sku', None) + 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) + self.delete_option = kwargs.get('delete_option', 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 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 VirtualMachineScaleSetReimageParameters(VirtualMachineScaleSetVMReimageParameters): + """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.v2021_07_01.models.Sku + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.Sku + :param plan: The purchase plan when deploying a virtual machine scale set from VM Marketplace + images. + :type plan: ~azure.mgmt.compute.v2021_07_01.models.Plan + :param identity: The identity of the virtual machine scale set, if configured. + :type identity: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetIdentity + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2021_07_01.models.UpgradePolicy + :param automatic_repairs_policy: Policy for automatic repairs. + :type automatic_repairs_policy: ~azure.mgmt.compute.v2021_07_01.models.AutomaticRepairsPolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.AdditionalCapabilities + :param scale_in_policy: Specifies the policies applied when scaling in Virtual Machines in the + Virtual Machine Scale Set. + :type scale_in_policy: ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.SubResource] + :param application_security_groups: Specifies an array of references to application security + group. + :type application_security_groups: list[~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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 enable_fpga: Specifies whether the network interface is FPGA networking-enabled. + :type enable_fpga: bool + :param network_security_group: The network security group. + :type network_security_group: ~azure.mgmt.compute.v2021_07_01.models.SubResource + :param dns_settings: The dns settings to be applied on the network interfaces. + :type dns_settings: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :param ip_configurations: The virtual machine scale set IP Configuration. + :type ip_configurations: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetUpdateIPConfiguration] + :param enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :type enable_ip_forwarding: bool + :param delete_option: Specify what happens to the network interface when the VM is deleted. + Possible values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + """ + + _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'}, + 'enable_fpga': {'key': 'properties.enableFpga', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetUpdateIPConfiguration]'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + } + + 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.enable_fpga = kwargs.get('enable_fpga', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + self.delete_option = kwargs.get('delete_option', 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.v2021_07_01.models.ApiEntityReference + :param network_interface_configurations: The list of network configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetUpdateNetworkConfiguration] + :param network_api_version: specifies the Microsoft.Network API version used when creating + networking resources in the Network Interface Configurations for Virtual Machine Scale Set with + orchestration mode 'Flexible'. Possible values include: "2020-11-01". + :type network_api_version: str or ~azure.mgmt.compute.v2021_07_01.models.NetworkApiVersion + """ + + _attribute_map = { + 'health_probe': {'key': 'healthProbe', 'type': 'ApiEntityReference'}, + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetUpdateNetworkConfiguration]'}, + 'network_api_version': {'key': 'networkApiVersion', 'type': 'str'}, + } + + 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) + self.network_api_version = kwargs.get('network_api_version', 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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.WindowsConfiguration + :param linux_configuration: The Linux Configuration of the OS profile. + :type linux_configuration: ~azure.mgmt.compute.v2021_07_01.models.LinuxConfiguration + :param secrets: The List of certificates for addition to the VM. + :type secrets: list[~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + :param delete_option: Specify what happens to the public IP when the VM is deleted. Possible + values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + } + + 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) + self.delete_option = kwargs.get('delete_option', 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.v2021_07_01.models.ImageReference + :param os_disk: The OS disk. + :type os_disk: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetUpdateOSDisk + :param data_disks: The data disks. + :type data_disks: list[~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetUpdateOSProfile + :param storage_profile: The virtual machine scale set storage profile. + :type storage_profile: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetUpdateStorageProfile + :param network_profile: The virtual machine scale set network profile. + :type network_profile: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetUpdateNetworkProfile + :param security_profile: The virtual machine scale set Security profile. + :type security_profile: ~azure.mgmt.compute.v2021_07_01.models.SecurityProfile + :param diagnostics_profile: The virtual machine scale set diagnostics profile. + :type diagnostics_profile: ~azure.mgmt.compute.v2021_07_01.models.DiagnosticsProfile + :param extension_profile: The virtual machine scale set extension profile. + :type extension_profile: + ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.BillingProfile + :param scheduled_events_profile: Specifies Scheduled Event related configurations. + :type scheduled_events_profile: ~azure.mgmt.compute.v2021_07_01.models.ScheduledEventsProfile + :param user_data: UserData for the VM, which must be base-64 encoded. Customer should not pass + any secrets in here. :code:`
    `:code:`
    `Minimum api-version: 2021-03-01. + :type user_data: str + """ + + _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'}, + 'user_data': {'key': 'userData', 'type': 'str'}, + } + + 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) + self.user_data = kwargs.get('user_data', 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.v2021_07_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.v2021_07_01.models.Plan + :ivar resources: The virtual machine child extension resources. + :vartype resources: list[~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetVMInstanceView + :param hardware_profile: Specifies the hardware settings for the virtual machine. + :type hardware_profile: ~azure.mgmt.compute.v2021_07_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.AdditionalCapabilities + :param os_profile: Specifies the operating system settings for the virtual machine. + :type os_profile: ~azure.mgmt.compute.v2021_07_01.models.OSProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machine. + :type security_profile: ~azure.mgmt.compute.v2021_07_01.models.SecurityProfile + :param network_profile: Specifies the network interfaces of the virtual machine. + :type network_profile: ~azure.mgmt.compute.v2021_07_01.models.NetworkProfile + :param network_profile_configuration: Specifies the network profile configuration of the + virtual machine. + :type network_profile_configuration: + ~azure.mgmt.compute.v2021_07_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.v2021_07_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 `Availability sets overview + `_. + :code:`
    `:code:`
    ` For more information on Azure planned maintenance, see `Maintenance + and updates 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.v2021_07_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. :code:`
    `:code:`
    ` Possible values for Windows Server operating system are: + :code:`
    `:code:`
    ` Windows_Client :code:`
    `:code:`
    ` Windows_Server + :code:`
    `:code:`
    ` Possible values for Linux Server operating system are: + :code:`
    `:code:`
    ` RHEL_BYOS (for RHEL) :code:`
    `:code:`
    ` SLES_BYOS (for SUSE) + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ + :code:`
    `:code:`
    ` `Azure Hybrid Use Benefit for Linux 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.v2021_07_01.models.VirtualMachineScaleSetVMProtectionPolicy + :param user_data: UserData for the VM, which must be base-64 encoded. Customer should not pass + any secrets in here. :code:`
    `:code:`
    `Minimum api-version: 2021-03-01. + :type user_data: str + """ + + _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'}, + 'user_data': {'key': 'properties.userData', 'type': 'str'}, + } + + 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) + self.user_data = kwargs.get('user_data', None) + + +class VirtualMachineScaleSetVMExtension(SubResourceReadOnly): + """Describes a VMSS VM 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: 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: any + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: any + :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.v2021_07_01.models.VirtualMachineExtensionInstanceView + :param suppress_failures: Indicates whether failures stemming from the extension will be + suppressed (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :type suppress_failures: bool + """ + + _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'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, + 'suppress_failures': {'key': 'properties.suppressFailures', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMExtension, 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.instance_view = kwargs.get('instance_view', None) + self.suppress_failures = kwargs.get('suppress_failures', None) + + +class VirtualMachineScaleSetVMExtensionsListResult(msrest.serialization.Model): + """The List VMSS VM Extension operation response. + + :param value: The list of VMSS VM extensions. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetVMExtension] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSetVMExtension]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMExtensionsListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', 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.v2021_07_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 VirtualMachineScaleSetVMExtensionUpdate(SubResourceReadOnly): + """Describes a VMSS VM 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: 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: any + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: any + :param suppress_failures: Indicates whether failures stemming from the extension will be + suppressed (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :type suppress_failures: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + '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'}, + 'suppress_failures': {'key': 'properties.suppressFailures', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMExtensionUpdate, 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.suppress_failures = kwargs.get('suppress_failures', 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.v2021_07_01.models.VirtualMachineAgentInstanceView + :param maintenance_redeploy_status: The Maintenance Operation status on the virtual machine. + :type maintenance_redeploy_status: + ~azure.mgmt.compute.v2021_07_01.models.MaintenanceRedeployStatus + :param disks: The disks information. + :type disks: list[~azure.mgmt.compute.v2021_07_01.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineExtensionInstanceView] + :ivar vm_health: The health status for the VM. + :vartype vm_health: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetOSProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetExtensionProfile + :param license_type: Specifies that the image or disk that is being used was licensed + on-premises. :code:`
    `:code:`
    ` Possible values for Windows Server operating system are: + :code:`
    `:code:`
    ` Windows_Client :code:`
    `:code:`
    ` Windows_Server + :code:`
    `:code:`
    ` Possible values for Linux Server operating system are: + :code:`
    `:code:`
    ` RHEL_BYOS (for RHEL) :code:`
    `:code:`
    ` SLES_BYOS (for SUSE) + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ + :code:`
    `:code:`
    ` `Azure Hybrid Use Benefit for Linux 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.v2021_07_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.v2021_07_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.v2021_07_01.models.BillingProfile + :param scheduled_events_profile: Specifies Scheduled Event related configurations. + :type scheduled_events_profile: ~azure.mgmt.compute.v2021_07_01.models.ScheduledEventsProfile + :param user_data: UserData for the virtual machines in the scale set, which must be base-64 + encoded. Customer should not pass any secrets in here. :code:`
    `:code:`
    `Minimum + api-version: 2021-03-01. + :type user_data: str + :param capacity_reservation: Specifies the capacity reservation related details of a scale set. + :code:`
    `:code:`
    `Minimum api-version: 2021-04-01. + :type capacity_reservation: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationProfile + :param application_profile: Specifies the gallery applications that should be made available to + the VM/VMSS. + :type application_profile: ~azure.mgmt.compute.v2021_07_01.models.ApplicationProfile + """ + + _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'}, + 'user_data': {'key': 'userData', 'type': 'str'}, + 'capacity_reservation': {'key': 'capacityReservation', 'type': 'CapacityReservationProfile'}, + 'application_profile': {'key': 'applicationProfile', 'type': 'ApplicationProfile'}, + } + + 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) + self.user_data = kwargs.get('user_data', None) + self.capacity_reservation = kwargs.get('capacity_reservation', None) + self.application_profile = kwargs.get('application_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 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. For + Constrained vCPU capable VM sizes, this number represents the total vCPUs of quota that the VM + uses. For accurate vCPU count, please refer to + https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or + https://docs.microsoft.com/rest/api/compute/resourceskus/list. + :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.v2021_07_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 kb_id: The KBID of the patch. Only applies to Windows patches. + :vartype kb_id: 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: + "Unknown", "NeverReboots", "AlwaysRequiresReboot", "CanRequestReboot". + :vartype reboot_behavior: str or + ~azure.mgmt.compute.v2021_07_01.models.VMGuestPatchRebootBehavior + :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 availability of a given patch. Possible values include: + "Unknown", "Available". + :vartype assessment_state: str or ~azure.mgmt.compute.v2021_07_01.models.PatchAssessmentState + """ + + _validation = { + 'patch_id': {'readonly': True}, + 'name': {'readonly': True}, + 'version': {'readonly': True}, + 'kb_id': {'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'}, + 'kb_id': {'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.kb_id = 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.v2021_07_01.models.Plan + :param identity: The identity of the virtual machine, if configured. + :type identity: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2021_07_01.models.StorageProfile + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + virtual machine. + :type additional_capabilities: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual machine. + :type network_profile: ~azure.mgmt.compute.v2021_07_01.models.NetworkProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machine. + :type security_profile: ~azure.mgmt.compute.v2021_07_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.v2021_07_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 `Availability sets overview + `_. + :code:`
    `:code:`
    ` For more information on Azure planned maintenance, see `Maintenance + and updates 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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used was licensed + on-premises. :code:`
    `:code:`
    ` Possible values for Windows Server operating system are: + :code:`
    `:code:`
    ` Windows_Client :code:`
    `:code:`
    ` Windows_Server + :code:`
    `:code:`
    ` Possible values for Linux Server operating system are: + :code:`
    `:code:`
    ` RHEL_BYOS (for RHEL) :code:`
    `:code:`
    ` SLES_BYOS (for SUSE) + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ + :code:`
    `:code:`
    ` `Azure Hybrid Use Benefit for Linux 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 + :param platform_fault_domain: Specifies the scale set logical fault domain into which the + Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned + to a fault domain that best maintains balance across available fault + domains.:code:`
    `:code:`
  • `This is applicable only if the 'virtualMachineScaleSet' + property of this Virtual Machine is set.:code:`
  • `The Virtual Machine Scale Set that is + referenced, must have 'platformFaultDomainCount' > 1.:code:`
  • `This property cannot be + updated once the Virtual Machine is created.:code:`
  • `Fault domain assignment can be viewed + in the Virtual Machine Instance View.:code:`
    `:code:`
    `Minimum api‐version: 2020‐12‐01. + :type platform_fault_domain: int + :param scheduled_events_profile: Specifies Scheduled Event related configurations. + :type scheduled_events_profile: ~azure.mgmt.compute.v2021_07_01.models.ScheduledEventsProfile + :param user_data: UserData for the VM, which must be base-64 encoded. Customer should not pass + any secrets in here. :code:`
    `:code:`
    `Minimum api-version: 2021-03-01. + :type user_data: str + :param capacity_reservation: Specifies information about the capacity reservation that is used + to allocate virtual machine. :code:`
    `:code:`
    `Minimum api-version: 2021-04-01. + :type capacity_reservation: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationProfile + :param application_profile: Specifies the gallery applications that should be made available to + the VM/VMSS. + :type application_profile: ~azure.mgmt.compute.v2021_07_01.models.ApplicationProfile + """ + + _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'}, + 'platform_fault_domain': {'key': 'properties.platformFaultDomain', 'type': 'int'}, + 'scheduled_events_profile': {'key': 'properties.scheduledEventsProfile', 'type': 'ScheduledEventsProfile'}, + 'user_data': {'key': 'properties.userData', 'type': 'str'}, + 'capacity_reservation': {'key': 'properties.capacityReservation', 'type': 'CapacityReservationProfile'}, + 'application_profile': {'key': 'properties.applicationProfile', 'type': 'ApplicationProfile'}, + } + + 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) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.scheduled_events_profile = kwargs.get('scheduled_events_profile', None) + self.user_data = kwargs.get('user_data', None) + self.capacity_reservation = kwargs.get('capacity_reservation', None) + self.application_profile = kwargs.get('application_profile', None) + + +class VMGalleryApplication(msrest.serialization.Model): + """Specifies the required information to reference a compute gallery application version. + + All required parameters must be populated in order to send to Azure. + + :param tags: A set of tags. Optional, Specifies a passthrough value for more generic context. + :type tags: str + :param order: Optional, Specifies the order in which the packages have to be installed. + :type order: int + :param package_reference_id: Required. Specifies the GalleryApplicationVersion resource id on + the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}. + :type package_reference_id: str + :param configuration_reference: Optional, Specifies the uri to an azure blob that will replace + the default configuration for the package if provided. + :type configuration_reference: str + """ + + _validation = { + 'package_reference_id': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'package_reference_id': {'key': 'packageReferenceId', 'type': 'str'}, + 'configuration_reference': {'key': 'configurationReference', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VMGalleryApplication, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.order = kwargs.get('order', None) + self.package_reference_id = kwargs['package_reference_id'] + self.configuration_reference = kwargs.get('configuration_reference', 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 VMSizeProperties(msrest.serialization.Model): + """Specifies VM Size Property settings on the virtual machine. + + :param v_cpus_available: Specifies the number of vCPUs available for the VM. + :code:`
    `:code:`
    ` When this property is not specified in the request body the default + behavior is to set it to the value of vCPUs available for that VM size exposed in api response + of `List all available virtual machine sizes in a region + `_ . + :type v_cpus_available: int + :param v_cpus_per_core: Specifies the vCPU to physical core ratio. :code:`
    `:code:`
    ` + When this property is not specified in the request body the default behavior is set to the + value of vCPUsPerCore for the VM Size exposed in api response of `List all available virtual + machine sizes in a region + `_ + :code:`
    `:code:`
    ` Setting this property to 1 also means that hyper-threading is + disabled. + :type v_cpus_per_core: int + """ + + _attribute_map = { + 'v_cpus_available': {'key': 'vCPUsAvailable', 'type': 'int'}, + 'v_cpus_per_core': {'key': 'vCPUsPerCore', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(VMSizeProperties, self).__init__(**kwargs) + self.v_cpus_available = kwargs.get('v_cpus_available', None) + self.v_cpus_per_core = kwargs.get('v_cpus_per_core', 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.v2021_07_01.models.AdditionalUnattendContent] + :param patch_settings: [Preview Feature] Specifies settings related to VM Guest Patching on + Windows. + :type patch_settings: ~azure.mgmt.compute.v2021_07_01.models.PatchSettings + :param win_rm: Specifies the Windows Remote Management listeners. This enables remote Windows + PowerShell. + :type win_rm: ~azure.mgmt.compute.v2021_07_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 WindowsParameters(msrest.serialization.Model): + """Input for InstallPatches on a Windows VM, as directly received by the API. + + :param classifications_to_include: The update classifications to select when installing patches + for Windows. + :type classifications_to_include: list[str or + ~azure.mgmt.compute.v2021_07_01.models.VMGuestPatchClassificationWindows] + :param kb_numbers_to_include: Kbs to include in the patch operation. + :type kb_numbers_to_include: list[str] + :param kb_numbers_to_exclude: Kbs to exclude in the patch operation. + :type kb_numbers_to_exclude: list[str] + :param exclude_kbs_requiring_reboot: Filters out Kbs that don't have an + InstallationRebootBehavior of 'NeverReboots' when this is set to true. + :type exclude_kbs_requiring_reboot: bool + :param max_patch_publish_date: This is used to install patches that were published on or before + this given max published date. + :type max_patch_publish_date: ~datetime.datetime + """ + + _attribute_map = { + 'classifications_to_include': {'key': 'classificationsToInclude', 'type': '[str]'}, + 'kb_numbers_to_include': {'key': 'kbNumbersToInclude', 'type': '[str]'}, + 'kb_numbers_to_exclude': {'key': 'kbNumbersToExclude', 'type': '[str]'}, + 'exclude_kbs_requiring_reboot': {'key': 'excludeKbsRequiringReboot', 'type': 'bool'}, + 'max_patch_publish_date': {'key': 'maxPatchPublishDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(WindowsParameters, self).__init__(**kwargs) + self.classifications_to_include = kwargs.get('classifications_to_include', None) + self.kb_numbers_to_include = kwargs.get('kb_numbers_to_include', None) + self.kb_numbers_to_exclude = kwargs.get('kb_numbers_to_exclude', None) + self.exclude_kbs_requiring_reboot = kwargs.get('exclude_kbs_requiring_reboot', None) + self.max_patch_publish_date = kwargs.get('max_patch_publish_date', 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.v2021_07_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.v2021_07_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:`
    `} :code:`
    ` To install certificates on a + virtual machine it is recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ or the + `Azure Key Vault virtual machine extension for Windows + `_. + :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/v2021_07_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py new file mode 100644 index 000000000000..e550e2f6f69c --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py @@ -0,0 +1,14182 @@ +# 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 Any, 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 + :param hibernation_enabled: The flag that enables or disables hibernation capability on the VM. + :type hibernation_enabled: bool + """ + + _attribute_map = { + 'ultra_ssd_enabled': {'key': 'ultraSSDEnabled', 'type': 'bool'}, + 'hibernation_enabled': {'key': 'hibernationEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + ultra_ssd_enabled: Optional[bool] = None, + hibernation_enabled: Optional[bool] = None, + **kwargs + ): + super(AdditionalCapabilities, self).__init__(**kwargs) + self.ultra_ssd_enabled = ultra_ssd_enabled + self.hibernation_enabled = hibernation_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. + + :param pass_name: The pass name. Currently, the only allowable value is OobeSystem. The only + acceptable values to pass in are None and "OobeSystem". The default value is None. + :type pass_name: str + :param component_name: The component name. Currently, the only allowable value is + Microsoft-Windows-Shell-Setup. The only acceptable values to pass in are None and + "Microsoft-Windows-Shell-Setup". The default value is None. + :type 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.v2021_07_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 + """ + + _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'}, + } + + def __init__( + self, + *, + pass_name: Optional[str] = None, + component_name: Optional[str] = None, + setting_name: Optional[Union[str, "SettingNames"]] = None, + content: Optional[str] = None, + **kwargs + ): + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.pass_name = pass_name + self.component_name = component_name + 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.v2021_07_01.models.ApiErrorBase] + :param innererror: The Api inner error. + :type innererror: ~azure.mgmt.compute.v2021_07_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 ApplicationProfile(msrest.serialization.Model): + """Contains the list of gallery applications that should be made available to the VM/VMSS. + + :param gallery_applications: Specifies the gallery applications that should be made available + to the VM/VMSS. + :type gallery_applications: list[~azure.mgmt.compute.v2021_07_01.models.VMGalleryApplication] + """ + + _attribute_map = { + 'gallery_applications': {'key': 'galleryApplications', 'type': '[VMGalleryApplication]'}, + } + + def __init__( + self, + *, + gallery_applications: Optional[List["VMGalleryApplication"]] = None, + **kwargs + ): + super(ApplicationProfile, self).__init__(**kwargs) + self.gallery_applications = gallery_applications + + +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 `Availability sets overview `_. :code:`
    `:code:`
    ` For more information on Azure planned maintenance, see `Maintenance and updates 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.v2021_07_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.v2021_07_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.v2021_07_01.models.SubResource + :ivar statuses: The resource status information. + :vartype statuses: list[~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.SubResource + :ivar statuses: The resource status information. + :vartype statuses: list[~azure.mgmt.compute.v2021_07_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 "Unknown", "Failed", "Succeeded", + or "CompletedWithWarnings.". Possible values include: "Unknown", "InProgress", "Failed", + "Succeeded", "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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 CapacityReservation(Resource): + """Specifies information about the capacity reservation. + + 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 resource for which capacity needs be reserved. The SKU name + and capacity is required to be set. Currently VM Skus with the capability called + 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs + in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported + values. + :type sku: ~azure.mgmt.compute.v2021_07_01.models.Sku + :param zones: Availability Zone to use for this capacity reservation. The zone has to be single + value and also should be part for the list of zones specified during the capacity reservation + group creation. The zone can be assigned only during creation. If not provided, the reservation + supports only non-zonal deployments. If provided, enforces VM/VMSS using this capacity + reservation to be in same zone. + :type zones: list[str] + :ivar reservation_id: A unique id generated and assigned to the capacity reservation by the + platform which does not change throughout the lifetime of the resource. + :vartype reservation_id: str + :ivar virtual_machines_associated: A list of all virtual machine resource ids that are + associated with the capacity reservation. + :vartype virtual_machines_associated: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + :ivar provisioning_time: The date time when the capacity reservation was last updated. + :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 Capacity reservation instance view. + :vartype instance_view: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'reservation_id': {'readonly': True}, + 'virtual_machines_associated': {'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'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'virtual_machines_associated': {'key': 'properties.virtualMachinesAssociated', 'type': '[SubResourceReadOnly]'}, + 'provisioning_time': {'key': 'properties.provisioningTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'CapacityReservationInstanceView'}, + } + + def __init__( + self, + *, + location: str, + sku: "Sku", + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + **kwargs + ): + super(CapacityReservation, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.zones = zones + self.reservation_id = None + self.virtual_machines_associated = None + self.provisioning_time = None + self.provisioning_state = None + self.instance_view = None + + +class CapacityReservationGroup(Resource): + """Specifies information about the capacity reservation group that the capacity reservations should be assigned to. :code:`
    `:code:`
    ` Currently, a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation cannot be added or moved to another capacity reservation 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 Zones to use for this capacity reservation group. The zones can be + assigned only during creation. If not provided, the group supports only regional resources in + the region. If provided, enforces each capacity reservation in the group to be in one of the + zones. + :type zones: list[str] + :ivar capacity_reservations: A list of all capacity reservation resource ids that belong to + capacity reservation group. + :vartype capacity_reservations: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + :ivar virtual_machines_associated: A list of references to all virtual machines associated to + the capacity reservation group. + :vartype virtual_machines_associated: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + :ivar instance_view: The capacity reservation group instance view which has the list of + instance views for all the capacity reservations that belong to the capacity reservation group. + :vartype instance_view: + ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroupInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'capacity_reservations': {'readonly': True}, + 'virtual_machines_associated': {'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]'}, + 'capacity_reservations': {'key': 'properties.capacityReservations', 'type': '[SubResourceReadOnly]'}, + 'virtual_machines_associated': {'key': 'properties.virtualMachinesAssociated', 'type': '[SubResourceReadOnly]'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'CapacityReservationGroupInstanceView'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + **kwargs + ): + super(CapacityReservationGroup, self).__init__(location=location, tags=tags, **kwargs) + self.zones = zones + self.capacity_reservations = None + self.virtual_machines_associated = None + self.instance_view = None + + +class CapacityReservationGroupInstanceView(msrest.serialization.Model): + """CapacityReservationGroupInstanceView. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar capacity_reservations: List of instance view of the capacity reservations under the + capacity reservation group. + :vartype capacity_reservations: + list[~azure.mgmt.compute.v2021_07_01.models.CapacityReservationInstanceViewWithName] + """ + + _validation = { + 'capacity_reservations': {'readonly': True}, + } + + _attribute_map = { + 'capacity_reservations': {'key': 'capacityReservations', 'type': '[CapacityReservationInstanceViewWithName]'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacityReservationGroupInstanceView, self).__init__(**kwargs) + self.capacity_reservations = None + + +class CapacityReservationGroupListResult(msrest.serialization.Model): + """The List capacity reservation group with resource group response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of capacity reservation groups. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroup] + :param next_link: The URI to fetch the next page of capacity reservation groups. Call + ListNext() with this URI to fetch the next page of capacity reservation groups. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CapacityReservationGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["CapacityReservationGroup"], + next_link: Optional[str] = None, + **kwargs + ): + super(CapacityReservationGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class CapacityReservationGroupUpdate(UpdateResource): + """Specifies information about the capacity reservation group. Only tags can 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] + :ivar capacity_reservations: A list of all capacity reservation resource ids that belong to + capacity reservation group. + :vartype capacity_reservations: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + :ivar virtual_machines_associated: A list of references to all virtual machines associated to + the capacity reservation group. + :vartype virtual_machines_associated: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + :ivar instance_view: The capacity reservation group instance view which has the list of + instance views for all the capacity reservations that belong to the capacity reservation group. + :vartype instance_view: + ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroupInstanceView + """ + + _validation = { + 'capacity_reservations': {'readonly': True}, + 'virtual_machines_associated': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'capacity_reservations': {'key': 'properties.capacityReservations', 'type': '[SubResourceReadOnly]'}, + 'virtual_machines_associated': {'key': 'properties.virtualMachinesAssociated', 'type': '[SubResourceReadOnly]'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'CapacityReservationGroupInstanceView'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(CapacityReservationGroupUpdate, self).__init__(tags=tags, **kwargs) + self.capacity_reservations = None + self.virtual_machines_associated = None + self.instance_view = None + + +class CapacityReservationInstanceView(msrest.serialization.Model): + """The instance view of a capacity reservation that provides as snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations. + + :param utilization_info: Unutilized capacity of the capacity reservation. + :type utilization_info: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationUtilization + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'utilization_info': {'key': 'utilizationInfo', 'type': 'CapacityReservationUtilization'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + *, + utilization_info: Optional["CapacityReservationUtilization"] = None, + statuses: Optional[List["InstanceViewStatus"]] = None, + **kwargs + ): + super(CapacityReservationInstanceView, self).__init__(**kwargs) + self.utilization_info = utilization_info + self.statuses = statuses + + +class CapacityReservationInstanceViewWithName(CapacityReservationInstanceView): + """The instance view of a capacity reservation that includes the name of the capacity reservation. It is used for the response to the instance view of a capacity reservation group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param utilization_info: Unutilized capacity of the capacity reservation. + :type utilization_info: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationUtilization + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_01.models.InstanceViewStatus] + :ivar name: The name of the capacity reservation. + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'utilization_info': {'key': 'utilizationInfo', 'type': 'CapacityReservationUtilization'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + utilization_info: Optional["CapacityReservationUtilization"] = None, + statuses: Optional[List["InstanceViewStatus"]] = None, + **kwargs + ): + super(CapacityReservationInstanceViewWithName, self).__init__(utilization_info=utilization_info, statuses=statuses, **kwargs) + self.name = None + + +class CapacityReservationListResult(msrest.serialization.Model): + """The list capacity reservation operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of capacity reservations. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.CapacityReservation] + :param next_link: The URI to fetch the next page of capacity reservations. Call ListNext() with + this URI to fetch the next page of capacity reservations. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CapacityReservation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["CapacityReservation"], + next_link: Optional[str] = None, + **kwargs + ): + super(CapacityReservationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class CapacityReservationProfile(msrest.serialization.Model): + """The parameters of a capacity reservation Profile. + + :param capacity_reservation_group: Specifies the capacity reservation group resource id that + should be used for allocating the virtual machine or scaleset vm instances provided enough + capacity has been reserved. Please refer to https://aka.ms/CapacityReservation for more + details. + :type capacity_reservation_group: ~azure.mgmt.compute.v2021_07_01.models.SubResource + """ + + _attribute_map = { + 'capacity_reservation_group': {'key': 'capacityReservationGroup', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + capacity_reservation_group: Optional["SubResource"] = None, + **kwargs + ): + super(CapacityReservationProfile, self).__init__(**kwargs) + self.capacity_reservation_group = capacity_reservation_group + + +class CapacityReservationUpdate(UpdateResource): + """Specifies information about the capacity reservation. Only tags and sku.capacity can 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 resource for which capacity needs be reserved. The SKU name and capacity + is required to be set. Currently VM Skus with the capability called + 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs + in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported + values. + :type sku: ~azure.mgmt.compute.v2021_07_01.models.Sku + :ivar reservation_id: A unique id generated and assigned to the capacity reservation by the + platform which does not change throughout the lifetime of the resource. + :vartype reservation_id: str + :ivar virtual_machines_associated: A list of all virtual machine resource ids that are + associated with the capacity reservation. + :vartype virtual_machines_associated: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + :ivar provisioning_time: The date time when the capacity reservation was last updated. + :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 Capacity reservation instance view. + :vartype instance_view: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationInstanceView + """ + + _validation = { + 'reservation_id': {'readonly': True}, + 'virtual_machines_associated': {'readonly': True}, + 'provisioning_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'virtual_machines_associated': {'key': 'properties.virtualMachinesAssociated', 'type': '[SubResourceReadOnly]'}, + 'provisioning_time': {'key': 'properties.provisioningTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'CapacityReservationInstanceView'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + **kwargs + ): + super(CapacityReservationUpdate, self).__init__(tags=tags, **kwargs) + self.sku = sku + self.reservation_id = None + self.virtual_machines_associated = None + self.provisioning_time = None + self.provisioning_state = None + self.instance_view = None + + +class CapacityReservationUtilization(msrest.serialization.Model): + """Represents the capacity reservation utilization in terms of resources allocated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar virtual_machines_allocated: A list of all virtual machines resource ids allocated against + the capacity reservation. + :vartype virtual_machines_allocated: + list[~azure.mgmt.compute.v2021_07_01.models.SubResourceReadOnly] + """ + + _validation = { + 'virtual_machines_allocated': {'readonly': True}, + } + + _attribute_map = { + 'virtual_machines_allocated': {'key': 'virtualMachinesAllocated', 'type': '[SubResourceReadOnly]'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacityReservationUtilization, self).__init__(**kwargs) + self.virtual_machines_allocated = 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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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 + :param detach_option: Specifies the detach behavior to be used while detaching a disk or which + is already in the process of detachment from the virtual machine. Supported values: + **ForceDetach**. :code:`
    `:code:`
    ` detachOption: **ForceDetach** is applicable only for + managed data disks. If a previous detachment attempt of the data disk did not complete due to + an unexpected failure from the virtual machine and the disk is still not released then use + force-detach as a last resort option to detach the disk forcibly from the VM. All writes might + not have been flushed when using this detach behavior. :code:`
    `:code:`
    ` This feature is + still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data + disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. Possible + values include: "ForceDetach". + :type detach_option: str or ~azure.mgmt.compute.v2021_07_01.models.DiskDetachOptionTypes + :param delete_option: Specifies whether data disk should be deleted or detached upon VM + deletion.:code:`
    `:code:`
    ` Possible values: :code:`
    `:code:`
    ` **Delete** If this + value is used, the data disk is deleted when VM is deleted.:code:`
    `:code:`
    ` **Detach** + If this value is used, the data disk is retained after VM is deleted.:code:`
    `:code:`
    ` + The default value is set to **detach**. Possible values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DiskDeleteOptionTypes + """ + + _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'}, + 'detach_option': {'key': 'detachOption', 'type': 'str'}, + 'delete_option': {'key': 'deleteOption', 'type': 'str'}, + } + + 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, + detach_option: Optional[Union[str, "DiskDetachOptionTypes"]] = None, + delete_option: Optional[Union[str, "DiskDeleteOptionTypes"]] = 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 + self.detach_option = detach_option + self.delete_option = delete_option + + +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 DiskImageEncryption(msrest.serialization.Model): + """This is the disk image encryption base class. + + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str + """ + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + } + + def __init__( + self, + *, + disk_encryption_set_id: Optional[str] = None, + **kwargs + ): + super(DiskImageEncryption, self).__init__(**kwargs) + self.disk_encryption_set_id = disk_encryption_set_id + + +class DataDiskImageEncryption(DiskImageEncryption): + """Contains encryption settings for a data disk image. + + All required parameters must be populated in order to send to Azure. + + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str + :param lun: Required. This property specifies the logical unit number of the data disk. This + value is used to identify data disks within the Virtual Machine and therefore must be unique + for each data disk attached to the Virtual Machine. + :type lun: int + """ + + _validation = { + 'lun': {'required': True}, + } + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + *, + lun: int, + disk_encryption_set_id: Optional[str] = None, + **kwargs + ): + super(DataDiskImageEncryption, self).__init__(disk_encryption_set_id=disk_encryption_set_id, **kwargs) + self.lun = lun + + +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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.DedicatedHostInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'platform_fault_domain': {'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.v2021_07_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.v2021_07_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.v2021_07_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 'false' 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': {'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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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 'false' when not provided. :code:`
    `:code:`
    `Minimum + api-version: 2020-06-01. + :type support_automatic_placement: bool + """ + + _validation = { + 'platform_fault_domain_count': {'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.v2021_07_01.models.DedicatedHostAvailableCapacity + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.DedicatedHostAvailableCapacity + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.DedicatedHostInstanceView + """ + + _validation = { + 'platform_fault_domain': {'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.v2021_07_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.v2021_07_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/azure/virtual-machines/windows/sizes and Linux VM at + https://docs.microsoft.com/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.v2021_07_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 Disallowed(msrest.serialization.Model): + """Describes the disallowed disk types. + + :param disk_types: A list of disk types. + :type disk_types: list[str] + """ + + _attribute_map = { + 'disk_types': {'key': 'diskTypes', 'type': '[str]'}, + } + + def __init__( + self, + *, + disk_types: Optional[List[str]] = None, + **kwargs + ): + super(Disallowed, self).__init__(**kwargs) + self.disk_types = disk_types + + +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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.DiskEncryptionSettings] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_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 EncryptionImages(msrest.serialization.Model): + """Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. + + :param os_disk_image: Contains encryption settings for an OS disk image. + :type os_disk_image: ~azure.mgmt.compute.v2021_07_01.models.OSDiskImageEncryption + :param data_disk_images: A list of encryption specifications for data disk images. + :type data_disk_images: list[~azure.mgmt.compute.v2021_07_01.models.DataDiskImageEncryption] + """ + + _attribute_map = { + 'os_disk_image': {'key': 'osDiskImage', 'type': 'OSDiskImageEncryption'}, + 'data_disk_images': {'key': 'dataDiskImages', 'type': '[DataDiskImageEncryption]'}, + } + + def __init__( + self, + *, + os_disk_image: Optional["OSDiskImageEncryption"] = None, + data_disk_images: Optional[List["DataDiskImageEncryption"]] = None, + **kwargs + ): + super(EncryptionImages, self).__init__(**kwargs) + self.os_disk_image = os_disk_image + self.data_disk_images = data_disk_images + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "ExtendedLocationTypes"]] = None, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = name + self.type = type + + +class Gallery(Resource): + """Specifies information about the Shared Image Gallery that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this Shared Image Gallery resource. This property is + updatable. + :type description: str + :param identifier: Describes the gallery unique name. + :type identifier: ~azure.mgmt.compute.v2021_07_01.models.GalleryIdentifier + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryPropertiesProvisioningState + :param sharing_profile: Profile for gallery sharing to subscription or tenant. + :type sharing_profile: ~azure.mgmt.compute.v2021_07_01.models.SharingProfile + :param soft_delete_policy: Contains information about the soft deletion policy of the gallery. + :type soft_delete_policy: ~azure.mgmt.compute.v2021_07_01.models.SoftDeletePolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, + 'soft_delete_policy': {'key': 'properties.softDeletePolicy', 'type': 'SoftDeletePolicy'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + identifier: Optional["GalleryIdentifier"] = None, + sharing_profile: Optional["SharingProfile"] = None, + soft_delete_policy: Optional["SoftDeletePolicy"] = None, + **kwargs + ): + super(Gallery, self).__init__(location=location, tags=tags, **kwargs) + self.description = description + self.identifier = identifier + self.provisioning_state = None + self.sharing_profile = sharing_profile + self.soft_delete_policy = soft_delete_policy + + +class GalleryApplication(Resource): + """Specifies information about the gallery Application Definition that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery Application Definition resource. This + property is updatable. + :type description: str + :param eula: The Eula agreement for the gallery Application Definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param end_of_life_date: The end of life date of the gallery Application Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param supported_os_type: This property allows you to specify the supported type of the OS that + application is built for. :code:`
    `:code:`
    ` Possible values are: + :code:`
    `:code:`
    ` **Windows** :code:`
    `:code:`
    ` **Linux**. Possible values + include: "Windows", "Linux". + :type supported_os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + eula: Optional[str] = None, + privacy_statement_uri: Optional[str] = None, + release_note_uri: Optional[str] = None, + end_of_life_date: Optional[datetime.datetime] = None, + supported_os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + **kwargs + ): + super(GalleryApplication, self).__init__(location=location, tags=tags, **kwargs) + self.description = description + self.eula = eula + self.privacy_statement_uri = privacy_statement_uri + self.release_note_uri = release_note_uri + self.end_of_life_date = end_of_life_date + self.supported_os_type = supported_os_type + + +class GalleryApplicationList(msrest.serialization.Model): + """The List Gallery Applications operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of Gallery Applications. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.GalleryApplication] + :param next_link: The uri to fetch the next page of Application Definitions in the Application + Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryApplication]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["GalleryApplication"], + next_link: Optional[str] = None, + **kwargs + ): + super(GalleryApplicationList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class UpdateResourceDefinition(msrest.serialization.Model): + """The Update Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(UpdateResourceDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = tags + + +class GalleryApplicationUpdate(UpdateResourceDefinition): + """Specifies information about the gallery Application Definition that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery Application Definition resource. This + property is updatable. + :type description: str + :param eula: The Eula agreement for the gallery Application Definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param end_of_life_date: The end of life date of the gallery Application Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param supported_os_type: This property allows you to specify the supported type of the OS that + application is built for. :code:`
    `:code:`
    ` Possible values are: + :code:`
    `:code:`
    ` **Windows** :code:`
    `:code:`
    ` **Linux**. Possible values + include: "Windows", "Linux". + :type supported_os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + eula: Optional[str] = None, + privacy_statement_uri: Optional[str] = None, + release_note_uri: Optional[str] = None, + end_of_life_date: Optional[datetime.datetime] = None, + supported_os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + **kwargs + ): + super(GalleryApplicationUpdate, self).__init__(tags=tags, **kwargs) + self.description = description + self.eula = eula + self.privacy_statement_uri = privacy_statement_uri + self.release_note_uri = release_note_uri + self.end_of_life_date = end_of_life_date + self.supported_os_type = supported_os_type + + +class GalleryApplicationVersion(Resource): + """Specifies information about the gallery Application Version that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image version. + :type publishing_profile: + ~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersionPropertiesProvisioningState + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2021_07_01.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + publishing_profile: Optional["GalleryApplicationVersionPublishingProfile"] = None, + **kwargs + ): + super(GalleryApplicationVersion, self).__init__(location=location, tags=tags, **kwargs) + self.publishing_profile = publishing_profile + self.provisioning_state = None + self.replication_status = None + + +class GalleryApplicationVersionList(msrest.serialization.Model): + """The List Gallery Application version operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of gallery Application Versions. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersion] + :param next_link: The uri to fetch the next page of gallery Application Versions. Call + ListNext() with this to fetch the next page of gallery Application Versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryApplicationVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["GalleryApplicationVersion"], + next_link: Optional[str] = None, + **kwargs + ): + super(GalleryApplicationVersionList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GalleryArtifactPublishingProfileBase(msrest.serialization.Model): + """Describes the basic gallery artifact publishing profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2021_07_01.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_01.models.StorageAccountType + :param replication_mode: Optional parameter which specifies the mode to be used for + replication. This property is not updatable. Possible values include: "Full", "Shallow". + :type replication_mode: str or ~azure.mgmt.compute.v2021_07_01.models.ReplicationMode + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'replication_mode': {'key': 'replicationMode', 'type': 'str'}, + } + + def __init__( + self, + *, + target_regions: Optional[List["TargetRegion"]] = None, + replica_count: Optional[int] = None, + exclude_from_latest: Optional[bool] = None, + end_of_life_date: Optional[datetime.datetime] = None, + storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + replication_mode: Optional[Union[str, "ReplicationMode"]] = None, + **kwargs + ): + super(GalleryArtifactPublishingProfileBase, self).__init__(**kwargs) + self.target_regions = target_regions + self.replica_count = replica_count + self.exclude_from_latest = exclude_from_latest + self.published_date = None + self.end_of_life_date = end_of_life_date + self.storage_account_type = storage_account_type + self.replication_mode = replication_mode + + +class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery image version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2021_07_01.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_01.models.StorageAccountType + :param replication_mode: Optional parameter which specifies the mode to be used for + replication. This property is not updatable. Possible values include: "Full", "Shallow". + :type replication_mode: str or ~azure.mgmt.compute.v2021_07_01.models.ReplicationMode + :param source: Required. The source image from which the Image Version is going to be created. + :type source: ~azure.mgmt.compute.v2021_07_01.models.UserArtifactSource + :param manage_actions: + :type manage_actions: ~azure.mgmt.compute.v2021_07_01.models.UserArtifactManage + :param enable_health_check: Optional. Whether or not this application reports health. + :type enable_health_check: bool + """ + + _validation = { + 'published_date': {'readonly': True}, + 'source': {'required': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'replication_mode': {'key': 'replicationMode', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'UserArtifactSource'}, + 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, + 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, + } + + def __init__( + self, + *, + source: "UserArtifactSource", + target_regions: Optional[List["TargetRegion"]] = None, + replica_count: Optional[int] = None, + exclude_from_latest: Optional[bool] = None, + end_of_life_date: Optional[datetime.datetime] = None, + storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + replication_mode: Optional[Union[str, "ReplicationMode"]] = None, + manage_actions: Optional["UserArtifactManage"] = None, + enable_health_check: Optional[bool] = None, + **kwargs + ): + super(GalleryApplicationVersionPublishingProfile, self).__init__(target_regions=target_regions, replica_count=replica_count, exclude_from_latest=exclude_from_latest, end_of_life_date=end_of_life_date, storage_account_type=storage_account_type, replication_mode=replication_mode, **kwargs) + self.source = source + self.manage_actions = manage_actions + self.enable_health_check = enable_health_check + + +class GalleryApplicationVersionUpdate(UpdateResourceDefinition): + """Specifies information about the gallery Application Version that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image version. + :type publishing_profile: + ~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersionPropertiesProvisioningState + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2021_07_01.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + publishing_profile: Optional["GalleryApplicationVersionPublishingProfile"] = None, + **kwargs + ): + super(GalleryApplicationVersionUpdate, self).__init__(tags=tags, **kwargs) + self.publishing_profile = publishing_profile + self.provisioning_state = None + self.replication_status = None + + +class GalleryArtifactSource(msrest.serialization.Model): + """The source image from which the Image Version is going to be created. + + All required parameters must be populated in order to send to Azure. + + :param managed_image: Required. The managed artifact. + :type managed_image: ~azure.mgmt.compute.v2021_07_01.models.ManagedArtifact + """ + + _validation = { + 'managed_image': {'required': True}, + } + + _attribute_map = { + 'managed_image': {'key': 'managedImage', 'type': 'ManagedArtifact'}, + } + + def __init__( + self, + *, + managed_image: "ManagedArtifact", + **kwargs + ): + super(GalleryArtifactSource, self).__init__(**kwargs) + self.managed_image = managed_image + + +class GalleryArtifactVersionSource(msrest.serialization.Model): + """The gallery artifact version source. + + :param id: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, + user image or storage account resource. + :type id: str + :param uri: The uri of the gallery artifact version source. Currently used to specify vhd/blob + source. + :type uri: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + uri: Optional[str] = None, + **kwargs + ): + super(GalleryArtifactVersionSource, self).__init__(**kwargs) + self.id = id + self.uri = uri + + +class GalleryDiskImage(msrest.serialization.Model): + """This is the disk image base class. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2021_07_01.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2021_07_01.models.GalleryArtifactVersionSource + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + } + + def __init__( + self, + *, + host_caching: Optional[Union[str, "HostCaching"]] = None, + source: Optional["GalleryArtifactVersionSource"] = None, + **kwargs + ): + super(GalleryDiskImage, self).__init__(**kwargs) + self.size_in_gb = None + self.host_caching = host_caching + self.source = source + + +class GalleryDataDiskImage(GalleryDiskImage): + """This is the data disk image. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2021_07_01.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2021_07_01.models.GalleryArtifactVersionSource + :param lun: Required. This property specifies the logical unit number of the data disk. This + value is used to identify data disks within the Virtual Machine and therefore must be unique + for each data disk attached to the Virtual Machine. + :type lun: int + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + 'lun': {'required': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + *, + lun: int, + host_caching: Optional[Union[str, "HostCaching"]] = None, + source: Optional["GalleryArtifactVersionSource"] = None, + **kwargs + ): + super(GalleryDataDiskImage, self).__init__(host_caching=host_caching, source=source, **kwargs) + self.lun = lun + + +class GalleryIdentifier(msrest.serialization.Model): + """Describes the gallery unique name. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unique_name: The unique name of the Shared Image Gallery. This name is generated + automatically by Azure. + :vartype unique_name: str + """ + + _validation = { + 'unique_name': {'readonly': True}, + } + + _attribute_map = { + 'unique_name': {'key': 'uniqueName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryIdentifier, self).__init__(**kwargs) + self.unique_name = None + + +class GalleryImage(Resource): + """Specifies information about the gallery image definition that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery image definition resource. This property is + updatable. + :type description: str + :param eula: The Eula agreement for the gallery image definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
    `:code:`
    ` Possible values are: + :code:`
    `:code:`
    ` **Windows** :code:`
    `:code:`
    ` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemStateTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2021_07_01.models.HyperVGeneration + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2021_07_01.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2021_07_01.models.Disallowed + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2021_07_01.models.ImagePurchasePlan + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryImagePropertiesProvisioningState + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2021_07_01.models.GalleryImageFeature] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + eula: Optional[str] = None, + privacy_statement_uri: Optional[str] = None, + release_note_uri: Optional[str] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + os_state: Optional[Union[str, "OperatingSystemStateTypes"]] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, + end_of_life_date: Optional[datetime.datetime] = None, + identifier: Optional["GalleryImageIdentifier"] = None, + recommended: Optional["RecommendedMachineConfiguration"] = None, + disallowed: Optional["Disallowed"] = None, + purchase_plan: Optional["ImagePurchasePlan"] = None, + features: Optional[List["GalleryImageFeature"]] = None, + **kwargs + ): + super(GalleryImage, self).__init__(location=location, tags=tags, **kwargs) + self.description = description + self.eula = eula + self.privacy_statement_uri = privacy_statement_uri + self.release_note_uri = release_note_uri + self.os_type = os_type + self.os_state = os_state + self.hyper_v_generation = hyper_v_generation + self.end_of_life_date = end_of_life_date + self.identifier = identifier + self.recommended = recommended + self.disallowed = disallowed + self.purchase_plan = purchase_plan + self.provisioning_state = None + self.features = features + + +class GalleryImageFeature(msrest.serialization.Model): + """A feature for gallery image. + + :param name: The name of the gallery image feature. + :type name: str + :param value: The value of the gallery image feature. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(GalleryImageFeature, self).__init__(**kwargs) + self.name = name + self.value = value + + +class GalleryImageIdentifier(msrest.serialization.Model): + """This is the gallery image definition identifier. + + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The name of the gallery image definition publisher. + :type publisher: str + :param offer: Required. The name of the gallery image definition offer. + :type offer: str + :param sku: Required. The name of the gallery image definition SKU. + :type sku: str + """ + + _validation = { + 'publisher': {'required': True}, + 'offer': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + } + + def __init__( + self, + *, + publisher: str, + offer: str, + sku: str, + **kwargs + ): + super(GalleryImageIdentifier, self).__init__(**kwargs) + self.publisher = publisher + self.offer = offer + self.sku = sku + + +class GalleryImageList(msrest.serialization.Model): + """The List Gallery Images operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of Shared Image Gallery images. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.GalleryImage] + :param next_link: The uri to fetch the next page of Image Definitions in the Shared Image + Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryImage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["GalleryImage"], + next_link: Optional[str] = None, + **kwargs + ): + super(GalleryImageList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GalleryImageUpdate(UpdateResourceDefinition): + """Specifies information about the gallery image definition that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery image definition resource. This property is + updatable. + :type description: str + :param eula: The Eula agreement for the gallery image definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
    `:code:`
    ` Possible values are: + :code:`
    `:code:`
    ` **Windows** :code:`
    `:code:`
    ` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemStateTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2021_07_01.models.HyperVGeneration + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2021_07_01.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2021_07_01.models.Disallowed + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2021_07_01.models.ImagePurchasePlan + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryImagePropertiesProvisioningState + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2021_07_01.models.GalleryImageFeature] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + eula: Optional[str] = None, + privacy_statement_uri: Optional[str] = None, + release_note_uri: Optional[str] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + os_state: Optional[Union[str, "OperatingSystemStateTypes"]] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, + end_of_life_date: Optional[datetime.datetime] = None, + identifier: Optional["GalleryImageIdentifier"] = None, + recommended: Optional["RecommendedMachineConfiguration"] = None, + disallowed: Optional["Disallowed"] = None, + purchase_plan: Optional["ImagePurchasePlan"] = None, + features: Optional[List["GalleryImageFeature"]] = None, + **kwargs + ): + super(GalleryImageUpdate, self).__init__(tags=tags, **kwargs) + self.description = description + self.eula = eula + self.privacy_statement_uri = privacy_statement_uri + self.release_note_uri = release_note_uri + self.os_type = os_type + self.os_state = os_state + self.hyper_v_generation = hyper_v_generation + self.end_of_life_date = end_of_life_date + self.identifier = identifier + self.recommended = recommended + self.disallowed = disallowed + self.purchase_plan = purchase_plan + self.provisioning_state = None + self.features = features + + +class GalleryImageVersion(Resource): + """Specifies information about the gallery image version that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image Version. + :type publishing_profile: + ~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionPropertiesProvisioningState + :param storage_profile: This is the storage profile of a Gallery Image Version. + :type storage_profile: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionStorageProfile + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2021_07_01.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryImageVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + publishing_profile: Optional["GalleryImageVersionPublishingProfile"] = None, + storage_profile: Optional["GalleryImageVersionStorageProfile"] = None, + **kwargs + ): + super(GalleryImageVersion, self).__init__(location=location, tags=tags, **kwargs) + self.publishing_profile = publishing_profile + self.provisioning_state = None + self.storage_profile = storage_profile + self.replication_status = None + + +class GalleryImageVersionList(msrest.serialization.Model): + """The List Gallery Image version operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of gallery image versions. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersion] + :param next_link: The uri to fetch the next page of gallery image versions. Call ListNext() + with this to fetch the next page of gallery image versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryImageVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["GalleryImageVersion"], + next_link: Optional[str] = None, + **kwargs + ): + super(GalleryImageVersionList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GalleryImageVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery image Version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2021_07_01.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_01.models.StorageAccountType + :param replication_mode: Optional parameter which specifies the mode to be used for + replication. This property is not updatable. Possible values include: "Full", "Shallow". + :type replication_mode: str or ~azure.mgmt.compute.v2021_07_01.models.ReplicationMode + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'replication_mode': {'key': 'replicationMode', 'type': 'str'}, + } + + def __init__( + self, + *, + target_regions: Optional[List["TargetRegion"]] = None, + replica_count: Optional[int] = None, + exclude_from_latest: Optional[bool] = None, + end_of_life_date: Optional[datetime.datetime] = None, + storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + replication_mode: Optional[Union[str, "ReplicationMode"]] = None, + **kwargs + ): + super(GalleryImageVersionPublishingProfile, self).__init__(target_regions=target_regions, replica_count=replica_count, exclude_from_latest=exclude_from_latest, end_of_life_date=end_of_life_date, storage_account_type=storage_account_type, replication_mode=replication_mode, **kwargs) + + +class GalleryImageVersionStorageProfile(msrest.serialization.Model): + """This is the storage profile of a Gallery Image Version. + + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2021_07_01.models.GalleryArtifactVersionSource + :param os_disk_image: This is the OS disk image. + :type os_disk_image: ~azure.mgmt.compute.v2021_07_01.models.GalleryOSDiskImage + :param data_disk_images: A list of data disk images. + :type data_disk_images: list[~azure.mgmt.compute.v2021_07_01.models.GalleryDataDiskImage] + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'os_disk_image': {'key': 'osDiskImage', 'type': 'GalleryOSDiskImage'}, + 'data_disk_images': {'key': 'dataDiskImages', 'type': '[GalleryDataDiskImage]'}, + } + + def __init__( + self, + *, + source: Optional["GalleryArtifactVersionSource"] = None, + os_disk_image: Optional["GalleryOSDiskImage"] = None, + data_disk_images: Optional[List["GalleryDataDiskImage"]] = None, + **kwargs + ): + super(GalleryImageVersionStorageProfile, self).__init__(**kwargs) + self.source = source + self.os_disk_image = os_disk_image + self.data_disk_images = data_disk_images + + +class GalleryImageVersionUpdate(UpdateResourceDefinition): + """Specifies information about the gallery image version that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image Version. + :type publishing_profile: + ~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionPropertiesProvisioningState + :param storage_profile: This is the storage profile of a Gallery Image Version. + :type storage_profile: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionStorageProfile + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2021_07_01.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryImageVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + publishing_profile: Optional["GalleryImageVersionPublishingProfile"] = None, + storage_profile: Optional["GalleryImageVersionStorageProfile"] = None, + **kwargs + ): + super(GalleryImageVersionUpdate, self).__init__(tags=tags, **kwargs) + self.publishing_profile = publishing_profile + self.provisioning_state = None + self.storage_profile = storage_profile + self.replication_status = None + + +class GalleryList(msrest.serialization.Model): + """The List Galleries operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of galleries. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.Gallery] + :param next_link: The uri to fetch the next page of galleries. Call ListNext() with this to + fetch the next page of galleries. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Gallery]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Gallery"], + next_link: Optional[str] = None, + **kwargs + ): + super(GalleryList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GalleryOSDiskImage(GalleryDiskImage): + """This is the OS disk image. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2021_07_01.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2021_07_01.models.GalleryArtifactVersionSource + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + } + + def __init__( + self, + *, + host_caching: Optional[Union[str, "HostCaching"]] = None, + source: Optional["GalleryArtifactVersionSource"] = None, + **kwargs + ): + super(GalleryOSDiskImage, self).__init__(host_caching=host_caching, source=source, **kwargs) + + +class GalleryUpdate(UpdateResourceDefinition): + """Specifies information about the Shared Image Gallery that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this Shared Image Gallery resource. This property is + updatable. + :type description: str + :param identifier: Describes the gallery unique name. + :type identifier: ~azure.mgmt.compute.v2021_07_01.models.GalleryIdentifier + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2021_07_01.models.GalleryPropertiesProvisioningState + :param sharing_profile: Profile for gallery sharing to subscription or tenant. + :type sharing_profile: ~azure.mgmt.compute.v2021_07_01.models.SharingProfile + :param soft_delete_policy: Contains information about the soft deletion policy of the gallery. + :type soft_delete_policy: ~azure.mgmt.compute.v2021_07_01.models.SoftDeletePolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, + 'soft_delete_policy': {'key': 'properties.softDeletePolicy', 'type': 'SoftDeletePolicy'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + identifier: Optional["GalleryIdentifier"] = None, + sharing_profile: Optional["SharingProfile"] = None, + soft_delete_policy: Optional["SoftDeletePolicy"] = None, + **kwargs + ): + super(GalleryUpdate, self).__init__(tags=tags, **kwargs) + self.description = description + self.identifier = identifier + self.provisioning_state = None + self.sharing_profile = sharing_profile + self.soft_delete_policy = soft_delete_policy + + +class HardwareProfile(msrest.serialization.Model): + """Specifies the hardware settings for the virtual machine. + + :param vm_size: Specifies the size of the virtual machine. :code:`
    `:code:`
    ` The enum + data type is currently deprecated and will be removed by December 23rd 2023. + :code:`
    `:code:`
    ` Recommended way to get the list of available sizes is using 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 + `_. For more + information about virtual machine sizes, see `Sizes for virtual machines + `_. :code:`
    `:code:`
    ` The + available VM sizes depend on region and availability set. 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.v2021_07_01.models.VirtualMachineSizeTypes + :param vm_size_properties: Specifies the properties for customizing the size of the virtual + machine. Minimum api-version: 2021-07-01. :code:`
    `:code:`
    ` This feature is still in + preview mode and is not supported for VirtualMachineScaleSet. :code:`
    `:code:`
    ` Please + follow the instructions in `VM Customization `_ for more + details. + :type vm_size_properties: ~azure.mgmt.compute.v2021_07_01.models.VMSizeProperties + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'vm_size_properties': {'key': 'vmSizeProperties', 'type': 'VMSizeProperties'}, + } + + def __init__( + self, + *, + vm_size: Optional[Union[str, "VirtualMachineSizeTypes"]] = None, + vm_size_properties: Optional["VMSizeProperties"] = None, + **kwargs + ): + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = vm_size + self.vm_size_properties = vm_size_properties + + +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 extended_location: The extended location of the Image. + :type extended_location: ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocation + :param source_virtual_machine: The source virtual machine from which Image is created. + :type source_virtual_machine: ~azure.mgmt.compute.v2021_07_01.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2021_07_01.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + :param hyper_v_generation: Specifies the HyperVGenerationType of the VirtualMachine created + from the image. From API Version 2019-03-01 if the image source is a blob, then we need the + user to specify the value, if the source is managed resource like disk or snapshot, we may + require the user to specify the property if we cannot deduce it from the source managed + resource. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2021_07_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}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + '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, + extended_location: Optional["ExtendedLocation"] = 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.extended_location = extended_location + 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.v2021_07_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2021_07_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.v2021_07_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", "Premium_ZRS", + "StandardSSD_ZRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.DiskEncryptionSetParameters + """ + + _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': 'DiskEncryptionSetParameters'}, + } + + 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["DiskEncryptionSetParameters"] = 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.v2021_07_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2021_07_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.v2021_07_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", "Premium_ZRS", + "StandardSSD_ZRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.DiskEncryptionSetParameters + :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': 'DiskEncryptionSetParameters'}, + '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["DiskEncryptionSetParameters"] = 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.v2021_07_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.v2021_07_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2021_07_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.v2021_07_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", "Premium_ZRS", + "StandardSSD_ZRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.DiskEncryptionSetParameters + :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.v2021_07_01.models.OperatingSystemTypes + :param os_state: Required. The OS State. Possible values include: "Generalized", "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2021_07_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': 'DiskEncryptionSetParameters'}, + '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["DiskEncryptionSetParameters"] = 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 ImagePurchasePlan(msrest.serialization.Model): + """Describes the gallery image definition purchase plan. This is used by marketplace images. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The product ID. + :type product: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + publisher: Optional[str] = None, + product: Optional[str] = None, + **kwargs + ): + super(ImagePurchasePlan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + + +class 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 + :param shared_gallery_image_id: Specified the shared gallery image unique id for vm deployment. + This can be fetched from shared gallery image GET call. + :type shared_gallery_image_id: 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'}, + 'shared_gallery_image_id': {'key': 'sharedGalleryImageId', '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, + shared_gallery_image_id: 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 + self.shared_gallery_image_id = shared_gallery_image_id + + +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.v2021_07_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.v2021_07_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.v2021_07_01.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2021_07_01.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + :param hyper_v_generation: Specifies the HyperVGenerationType of the VirtualMachine created + from the image. From API Version 2019-03-01 if the image source is a blob, then we need the + user to specify the value, if the source is managed resource like disk or snapshot, we may + require the user to specify the property if we cannot deduce it from the source managed + resource. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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 "Unknown", "Failed", "Succeeded", + or "CompletedWithWarnings.". Possible values include: "Unknown", "InProgress", "Failed", + "Succeeded", "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2021_07_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 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 error: The errors that were encountered during execution of the operation. The details + array contains the list of them. + :vartype error: ~azure.mgmt.compute.v2021_07_01.models.ApiError + """ + + _validation = { + 'status': {'readonly': True}, + 'installation_activity_id': {'readonly': True}, + 'maintenance_window_exceeded': {'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}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'installation_activity_id': {'key': 'installationActivityId', 'type': 'str'}, + 'maintenance_window_exceeded': {'key': 'maintenanceWindowExceeded', 'type': 'bool'}, + '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'}, + '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.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.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 `_. + + :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.v2021_07_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 + :param patch_settings: [Preview Feature] Specifies settings related to VM Guest Patching on + Linux. + :type patch_settings: ~azure.mgmt.compute.v2021_07_01.models.LinuxPatchSettings + """ + + _attribute_map = { + 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, + 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, + 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, + 'patch_settings': {'key': 'patchSettings', 'type': 'LinuxPatchSettings'}, + } + + def __init__( + self, + *, + disable_password_authentication: Optional[bool] = None, + ssh: Optional["SshConfiguration"] = None, + provision_vm_agent: Optional[bool] = None, + patch_settings: Optional["LinuxPatchSettings"] = None, + **kwargs + ): + super(LinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = disable_password_authentication + self.ssh = ssh + self.provision_vm_agent = provision_vm_agent + self.patch_settings = patch_settings + + +class LinuxParameters(msrest.serialization.Model): + """Input for InstallPatches on a Linux VM, as directly received by the API. + + :param classifications_to_include: The update classifications to select when installing patches + for Linux. + :type classifications_to_include: list[str or + ~azure.mgmt.compute.v2021_07_01.models.VMGuestPatchClassificationLinux] + :param package_name_masks_to_include: packages to include in the patch operation. Format: + packageName_packageVersion. + :type package_name_masks_to_include: list[str] + :param package_name_masks_to_exclude: packages to exclude in the patch operation. Format: + packageName_packageVersion. + :type package_name_masks_to_exclude: list[str] + :param maintenance_run_id: This is used as a maintenance run identifier for Auto VM Guest + Patching in Linux. + :type maintenance_run_id: str + """ + + _attribute_map = { + 'classifications_to_include': {'key': 'classificationsToInclude', 'type': '[str]'}, + 'package_name_masks_to_include': {'key': 'packageNameMasksToInclude', 'type': '[str]'}, + 'package_name_masks_to_exclude': {'key': 'packageNameMasksToExclude', 'type': '[str]'}, + 'maintenance_run_id': {'key': 'maintenanceRunId', 'type': 'str'}, + } + + def __init__( + self, + *, + classifications_to_include: Optional[List[Union[str, "VMGuestPatchClassificationLinux"]]] = None, + package_name_masks_to_include: Optional[List[str]] = None, + package_name_masks_to_exclude: Optional[List[str]] = None, + maintenance_run_id: Optional[str] = None, + **kwargs + ): + super(LinuxParameters, self).__init__(**kwargs) + self.classifications_to_include = classifications_to_include + self.package_name_masks_to_include = package_name_masks_to_include + self.package_name_masks_to_exclude = package_name_masks_to_exclude + self.maintenance_run_id = maintenance_run_id + + +class LinuxPatchSettings(msrest.serialization.Model): + """Specifies settings related to VM Guest Patching on Linux. + + :param patch_mode: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + machines associated to virtual machine scale set with OrchestrationMode as Flexible.:code:`
    `:code:`
    ` Possible values are::code:`
    `:code:`
    ` **ImageDefault** - The + virtual machine's default patching configuration is used. :code:`
    `:code:`
    ` + **AutomaticByPlatform** - The virtual machine will be automatically updated by the platform. + The property provisionVMAgent must be true. Possible values include: "ImageDefault", + "AutomaticByPlatform". + :type patch_mode: str or ~azure.mgmt.compute.v2021_07_01.models.LinuxVMGuestPatchMode + :param assessment_mode: Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + machine.:code:`
    `:code:`
    ` Possible values are::code:`
    `:code:`
    ` + **ImageDefault** - You control the timing of patch assessments on a virtual machine. :code:`
    `:code:`
    ` **AutomaticByPlatform** - The platform will trigger periodic patch + assessments. The property provisionVMAgent must be true. Possible values include: + "ImageDefault", "AutomaticByPlatform". + :type assessment_mode: str or ~azure.mgmt.compute.v2021_07_01.models.LinuxPatchAssessmentMode + """ + + _attribute_map = { + 'patch_mode': {'key': 'patchMode', 'type': 'str'}, + 'assessment_mode': {'key': 'assessmentMode', 'type': 'str'}, + } + + def __init__( + self, + *, + patch_mode: Optional[Union[str, "LinuxVMGuestPatchMode"]] = None, + assessment_mode: Optional[Union[str, "LinuxPatchAssessmentMode"]] = None, + **kwargs + ): + super(LinuxPatchSettings, self).__init__(**kwargs) + self.patch_mode = patch_mode + self.assessment_mode = assessment_mode + + +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.v2021_07_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 + :param group_by_client_application_id: Group query result by Client Application ID. + :type group_by_client_application_id: bool + :param group_by_user_agent: Group query result by User Agent. + :type group_by_user_agent: bool + """ + + _validation = { + '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'}, + 'group_by_client_application_id': {'key': 'groupByClientApplicationId', 'type': 'bool'}, + 'group_by_user_agent': {'key': 'groupByUserAgent', '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, + group_by_client_application_id: Optional[bool] = None, + group_by_user_agent: 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 + self.group_by_client_application_id = group_by_client_application_id + self.group_by_user_agent = group_by_user_agent + + +class LogAnalyticsOperationResult(msrest.serialization.Model): + """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.v2021_07_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.v2021_07_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 ManagedArtifact(msrest.serialization.Model): + """The managed artifact. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The managed artifact id. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: str, + **kwargs + ): + super(ManagedArtifact, self).__init__(**kwargs) + self.id = id + + +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", "Premium_ZRS", + "StandardSSD_ZRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.DiskEncryptionSetParameters + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'DiskEncryptionSetParameters'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + storage_account_type: Optional[Union[str, "StorageAccountTypes"]] = None, + disk_encryption_set: Optional["DiskEncryptionSetParameters"] = 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 + :param delete_option: Specify what happens to the network interface when the VM is deleted. + Possible values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + primary: Optional[bool] = None, + delete_option: Optional[Union[str, "DeleteOptions"]] = None, + **kwargs + ): + super(NetworkInterfaceReference, self).__init__(id=id, **kwargs) + self.primary = primary + self.delete_option = delete_option + + +class NetworkProfile(msrest.serialization.Model): + """Specifies the network interfaces or the networking configuration 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.v2021_07_01.models.NetworkInterfaceReference] + :param network_api_version: specifies the Microsoft.Network API version used when creating + networking resources in the Network Interface Configurations. Possible values include: + "2020-11-01". + :type network_api_version: str or ~azure.mgmt.compute.v2021_07_01.models.NetworkApiVersion + :param network_interface_configurations: Specifies the networking configurations that will be + used to create the virtual machine networking resources. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineNetworkInterfaceConfiguration] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, + 'network_api_version': {'key': 'networkApiVersion', 'type': 'str'}, + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineNetworkInterfaceConfiguration]'}, + } + + def __init__( + self, + *, + network_interfaces: Optional[List["NetworkInterfaceReference"]] = None, + network_api_version: Optional[Union[str, "NetworkApiVersion"]] = None, + network_interface_configurations: Optional[List["VirtualMachineNetworkInterfaceConfiguration"]] = None, + **kwargs + ): + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = network_interfaces + self.network_api_version = network_api_version + self.network_interface_configurations = network_interface_configurations + + +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.v2021_07_01.models.OrchestrationServiceNames + :param action: Required. The action to be performed. Possible values include: "Resume", + "Suspend". + :type action: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.DiskEncryptionSettings + :param name: The disk name. + :type name: str + :param vhd: The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.ManagedDiskParameters + :param delete_option: Specifies whether OS Disk should be deleted or detached upon VM deletion. + :code:`
    `:code:`
    ` Possible values: :code:`
    `:code:`
    ` **Delete** If this value is + used, the OS disk is deleted when VM is deleted.:code:`
    `:code:`
    ` **Detach** If this + value is used, the os disk is retained after VM is deleted. :code:`
    `:code:`
    ` The + default value is set to **detach**. For an ephemeral OS Disk, the default value is set to + **Delete**. User cannot change the delete option for ephemeral OS Disk. Possible values + include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DiskDeleteOptionTypes + """ + + _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'}, + 'delete_option': {'key': 'deleteOption', 'type': 'str'}, + } + + 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, + delete_option: Optional[Union[str, "DiskDeleteOptionTypes"]] = 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 + self.delete_option = delete_option + + +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.v2021_07_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 OSDiskImageEncryption(DiskImageEncryption): + """Contains encryption settings for an OS disk image. + + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str + """ + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + } + + def __init__( + self, + *, + disk_encryption_set_id: Optional[str] = None, + **kwargs + ): + super(OSDiskImageEncryption, self).__init__(disk_encryption_set_id=disk_encryption_set_id, **kwargs) + + +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. + :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.v2021_07_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 + `_. + :type linux_configuration: ~azure.mgmt.compute.v2021_07_01.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed onto the virtual + machine. To install certificates on a virtual machine it is recommended to use the `Azure Key + Vault virtual machine extension for Linux + `_ or the `Azure + Key Vault virtual machine extension for Windows + `_. + :type secrets: list[~azure.mgmt.compute.v2021_07_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 PatchInstallationDetail(msrest.serialization.Model): + """Information about a specific patch that was encountered during an installation action. + + 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 string of the package. It may conform to Semantic Versioning. Only + applies to Linux. + :vartype version: str + :ivar kb_id: The KBID of the patch. Only applies to Windows patches. + :vartype kb_id: str + :ivar classifications: The classification(s) of the patch as provided by the patch publisher. + :vartype classifications: list[str] + :ivar installation_state: The state of the patch after the installation operation completed. + Possible values include: "Unknown", "Installed", "Failed", "Excluded", "NotSelected", + "Pending". + :vartype installation_state: str or + ~azure.mgmt.compute.v2021_07_01.models.PatchInstallationState + """ + + _validation = { + 'patch_id': {'readonly': True}, + 'name': {'readonly': True}, + 'version': {'readonly': True}, + 'kb_id': {'readonly': True}, + 'classifications': {'readonly': True}, + 'installation_state': {'readonly': True}, + } + + _attribute_map = { + 'patch_id': {'key': 'patchId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'kb_id': {'key': 'kbId', 'type': 'str'}, + 'classifications': {'key': 'classifications', 'type': '[str]'}, + 'installation_state': {'key': 'installationState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PatchInstallationDetail, self).__init__(**kwargs) + self.patch_id = None + self.name = None + self.version = None + self.kb_id = None + self.classifications = None + self.installation_state = None + + +class PatchSettings(msrest.serialization.Model): + """Specifies settings related to VM Guest Patching on Windows. + + :param patch_mode: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + machines associated to virtual machine scale set with OrchestrationMode as Flexible.: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.v2021_07_01.models.WindowsVMGuestPatchMode + :param enable_hotpatching: Enables customers to patch their Azure VMs without requiring a + reboot. For enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must + be set to 'AutomaticByPlatform'. + :type enable_hotpatching: bool + :param assessment_mode: Specifies the mode of VM Guest patch assessment for the IaaS virtual + machine.:code:`
    `:code:`
    ` Possible values are::code:`
    `:code:`
    ` + **ImageDefault** - You control the timing of patch assessments on a virtual machine.:code:`
    `:code:`
    ` **AutomaticByPlatform** - The platform will trigger periodic patch + assessments. The property provisionVMAgent must be true. Possible values include: + "ImageDefault", "AutomaticByPlatform". + :type assessment_mode: str or ~azure.mgmt.compute.v2021_07_01.models.WindowsPatchAssessmentMode + """ + + _attribute_map = { + 'patch_mode': {'key': 'patchMode', 'type': 'str'}, + 'enable_hotpatching': {'key': 'enableHotpatching', 'type': 'bool'}, + 'assessment_mode': {'key': 'assessmentMode', 'type': 'str'}, + } + + def __init__( + self, + *, + patch_mode: Optional[Union[str, "WindowsVMGuestPatchMode"]] = None, + enable_hotpatching: Optional[bool] = None, + assessment_mode: Optional[Union[str, "WindowsPatchAssessmentMode"]] = None, + **kwargs + ): + super(PatchSettings, self).__init__(**kwargs) + self.patch_mode = patch_mode + self.enable_hotpatching = enable_hotpatching + self.assessment_mode = assessment_mode + + +class PirResource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PirResource, self).__init__(**kwargs) + self.name = None + self.location = None + + +class PirSharedGalleryResource(PirResource): + """Base information about the shared gallery resource in pir. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + } + + def __init__( + self, + *, + unique_id: Optional[str] = None, + **kwargs + ): + super(PirSharedGalleryResource, self).__init__(**kwargs) + self.unique_id = unique_id + + +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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.SubResourceWithColocationStatus] + :param colocation_status: Describes colocation status of the Proximity Placement Group. + :type colocation_status: ~azure.mgmt.compute.v2021_07_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.v2021_07_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 ProxyResource(msrest.serialization.Model): + """The resource model definition for an Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class PublicIPAddressSku(msrest.serialization.Model): + """Describes the public IP Sku. + + :param name: Specify public IP sku name. Possible values include: "Basic", "Standard". + :type name: str or ~azure.mgmt.compute.v2021_07_01.models.PublicIPAddressSkuName + :param tier: Specify public IP sku tier. Possible values include: "Regional", "Global". + :type tier: str or ~azure.mgmt.compute.v2021_07_01.models.PublicIPAddressSkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "PublicIPAddressSkuName"]] = None, + tier: Optional[Union[str, "PublicIPAddressSkuTier"]] = None, + **kwargs + ): + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +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 RecommendedMachineConfiguration(msrest.serialization.Model): + """The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. + + :param v_cp_us: Describes the resource range. + :type v_cp_us: ~azure.mgmt.compute.v2021_07_01.models.ResourceRange + :param memory: Describes the resource range. + :type memory: ~azure.mgmt.compute.v2021_07_01.models.ResourceRange + """ + + _attribute_map = { + 'v_cp_us': {'key': 'vCPUs', 'type': 'ResourceRange'}, + 'memory': {'key': 'memory', 'type': 'ResourceRange'}, + } + + def __init__( + self, + *, + v_cp_us: Optional["ResourceRange"] = None, + memory: Optional["ResourceRange"] = None, + **kwargs + ): + super(RecommendedMachineConfiguration, self).__init__(**kwargs) + self.v_cp_us = v_cp_us + self.memory = memory + + +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 RegionalReplicationStatus(msrest.serialization.Model): + """This is the regional replication status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar region: The region to which the gallery image version is being replicated to. + :vartype region: str + :ivar state: This is the regional replication state. Possible values include: "Unknown", + "Replicating", "Completed", "Failed". + :vartype state: str or ~azure.mgmt.compute.v2021_07_01.models.ReplicationState + :ivar details: The details of the replication status. + :vartype details: str + :ivar progress: It indicates progress of the replication job. + :vartype progress: int + """ + + _validation = { + 'region': {'readonly': True}, + 'state': {'readonly': True}, + 'details': {'readonly': True}, + 'progress': {'readonly': True}, + } + + _attribute_map = { + 'region': {'key': 'region', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + 'progress': {'key': 'progress', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RegionalReplicationStatus, self).__init__(**kwargs) + self.region = None + self.state = None + self.details = None + self.progress = None + + +class ReplicationStatus(msrest.serialization.Model): + """This is the replication status of the gallery image version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar aggregated_state: This is the aggregated replication status based on all the regional + replication status flags. Possible values include: "Unknown", "InProgress", "Completed", + "Failed". + :vartype aggregated_state: str or + ~azure.mgmt.compute.v2021_07_01.models.AggregatedReplicationState + :ivar summary: This is a summary of replication status for each region. + :vartype summary: list[~azure.mgmt.compute.v2021_07_01.models.RegionalReplicationStatus] + """ + + _validation = { + 'aggregated_state': {'readonly': True}, + 'summary': {'readonly': True}, + } + + _attribute_map = { + 'aggregated_state': {'key': 'aggregatedState', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': '[RegionalReplicationStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(ReplicationStatus, self).__init__(**kwargs) + self.aggregated_state = None + self.summary = 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 group_by_client_application_id: Group query result by Client Application ID. + :type group_by_client_application_id: bool + :param group_by_user_agent: Group query result by User Agent. + :type group_by_user_agent: bool + :param interval_length: Required. Interval value in minutes used to create LogAnalytics call + rate logs. Possible values include: "ThreeMins", "FiveMins", "ThirtyMins", "SixtyMins". + :type interval_length: str or ~azure.mgmt.compute.v2021_07_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'}, + 'group_by_client_application_id': {'key': 'groupByClientApplicationId', 'type': 'bool'}, + 'group_by_user_agent': {'key': 'groupByUserAgent', '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, + group_by_client_application_id: Optional[bool] = None, + group_by_user_agent: Optional[bool] = None, + **kwargs + ): + super(RequestRateByIntervalInput, self).__init__(blob_container_sas_uri=blob_container_sas_uri, from_time=from_time, to_time=to_time, group_by_throttle_policy=group_by_throttle_policy, group_by_operation_name=group_by_operation_name, group_by_resource_name=group_by_resource_name, group_by_client_application_id=group_by_client_application_id, group_by_user_agent=group_by_user_agent, **kwargs) + self.interval_length = interval_length + + +class ResourceRange(msrest.serialization.Model): + """Describes the resource range. + + :param min: The minimum number of the resource. + :type min: int + :param max: The maximum number of the resource. + :type max: int + """ + + _attribute_map = { + 'min': {'key': 'min', 'type': 'int'}, + 'max': {'key': 'max', 'type': 'int'}, + } + + def __init__( + self, + *, + min: Optional[int] = None, + max: Optional[int] = None, + **kwargs + ): + super(ResourceRange, self).__init__(**kwargs) + self.min = min + self.max = max + + +class ResourceSku(msrest.serialization.Model): + """Describes an available Compute 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 name: The name of SKU. + :vartype name: str + :ivar tier: Specifies the tier of virtual machines in a scale set.:code:`
    `:code:`
    ` + Possible Values::code:`
    `:code:`
    ` **Standard**\ :code:`
    `:code:`
    ` + **Basic**. + :vartype tier: str + :ivar size: The Size of the SKU. + :vartype size: str + :ivar family: The Family of this particular SKU. + :vartype family: str + :ivar kind: The Kind of resources that are supported in this SKU. + :vartype kind: str + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: ~azure.mgmt.compute.v2021_07_01.models.ResourceSkuCapacity + :ivar locations: The set of locations that the SKU is available. + :vartype locations: list[str] + :ivar location_info: A list of locations and availability zones in those locations where the + SKU is available. + :vartype location_info: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSkuLocationInfo] + :ivar api_versions: The api versions that support this SKU. + :vartype api_versions: list[str] + :ivar costs: Metadata for retrieving price info. + :vartype costs: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSkuCosts] + :ivar capabilities: A name value pair to describe the capability. + :vartype capabilities: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSkuCapabilities] + :ivar restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :vartype restrictions: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSkuRestrictions] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'kind': {'readonly': True}, + 'capacity': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'costs': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'ResourceSkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'costs': {'key': 'costs', 'type': '[ResourceSkuCosts]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.size = None + self.family = None + self.kind = None + self.capacity = None + self.locations = None + self.location_info = None + self.api_versions = None + self.costs = None + self.capabilities = None + self.restrictions = None + + +class ResourceSkuCapabilities(msrest.serialization.Model): + """Describes The SKU capabilities object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: An invariant to describe the feature. + :vartype name: str + :ivar value: An invariant if the feature is measured by quantity. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuCapabilities, self).__init__(**kwargs) + self.name = None + self.value = None + + +class ResourceSkuCapacity(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: The default capacity. + :vartype default: long + :ivar scale_type: The scale type applicable to the sku. Possible values include: "Automatic", + "Manual", "None". + :vartype scale_type: str or ~azure.mgmt.compute.v2021_07_01.models.ResourceSkuCapacityScaleType + """ + + _validation = { + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'default': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'long'}, + 'maximum': {'key': 'maximum', 'type': 'long'}, + 'default': {'key': 'default', 'type': 'long'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default = None + self.scale_type = None + + +class ResourceSkuCosts(msrest.serialization.Model): + """Describes metadata for retrieving price info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar meter_id: Used for querying price from commerce. + :vartype meter_id: str + :ivar quantity: The multiplier is needed to extend the base metered cost. + :vartype quantity: long + :ivar extended_unit: An invariant to show the extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterID', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuCosts, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class ResourceSkuLocationInfo(msrest.serialization.Model): + """Describes an available Compute SKU Location Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Location of the SKU. + :vartype location: str + :ivar zones: List of availability zones where the SKU is supported. + :vartype zones: list[str] + :ivar zone_details: Details of capabilities available to a SKU in specific zones. + :vartype zone_details: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSkuZoneDetails] + :ivar extended_locations: The names of extended locations. + :vartype extended_locations: list[str] + :ivar type: The type of the extended location. Possible values include: "EdgeZone". + :vartype type: str or ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocationType + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'zone_details': {'readonly': True}, + 'extended_locations': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + 'extended_locations': {'key': 'extendedLocations', 'type': '[str]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.zone_details = None + self.extended_locations = None + self.type = None + + +class ResourceSkuRestrictionInfo(msrest.serialization.Model): + """Describes an available Compute SKU Restriction Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar locations: Locations where the SKU is restricted. + :vartype locations: list[str] + :ivar zones: List of availability zones where the SKU is restricted. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None + + +class ResourceSkuRestrictions(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 type: The type of restrictions. Possible values include: "Location", "Zone". + :vartype type: str or ~azure.mgmt.compute.v2021_07_01.models.ResourceSkuRestrictionsType + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :ivar restriction_info: The information about the restriction where the SKU cannot be used. + :vartype restriction_info: ~azure.mgmt.compute.v2021_07_01.models.ResourceSkuRestrictionInfo + :ivar reason_code: The reason for restriction. Possible values include: "QuotaId", + "NotAvailableForSubscription". + :vartype reason_code: str or + ~azure.mgmt.compute.v2021_07_01.models.ResourceSkuRestrictionsReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'restriction_info': {'readonly': True}, + 'reason_code': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.restriction_info = None + self.reason_code = None + + +class ResourceSkusResult(msrest.serialization.Model): + """The List Resource 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 subscription. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSku] + :param next_link: The URI to fetch the next page of Resource Skus. Call ListNext() with this + URI to fetch the next page of Resource Skus. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ResourceSku"], + next_link: Optional[str] = None, + **kwargs + ): + super(ResourceSkusResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ResourceSkuZoneDetails(msrest.serialization.Model): + """Describes The zonal capabilities of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The set of zones that the SKU is available in with the specified capabilities. + :vartype name: list[str] + :ivar capabilities: A list of capabilities that are available for the SKU in the specified list + of zones. + :vartype capabilities: list[~azure.mgmt.compute.v2021_07_01.models.ResourceSkuCapabilities] + """ + + _validation = { + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = None + self.capabilities = None + + +class RestorePoint(ProxyResource): + """Restore Point details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param exclude_disks: List of disk resource ids that the customer wishes to exclude from the + restore point. If no disks are specified, all disks will be included. + :type exclude_disks: list[~azure.mgmt.compute.v2021_07_01.models.ApiEntityReference] + :ivar source_metadata: Gets the details of the VM captured at the time of the restore point + creation. + :vartype source_metadata: ~azure.mgmt.compute.v2021_07_01.models.RestorePointSourceMetadata + :ivar provisioning_state: Gets the provisioning state of the restore point. + :vartype provisioning_state: str + :ivar consistency_mode: Gets the consistency mode for the restore point. Please refer to + https://aka.ms/RestorePoints for more details. Possible values include: "CrashConsistent", + "FileSystemConsistent", "ApplicationConsistent". + :vartype consistency_mode: str or ~azure.mgmt.compute.v2021_07_01.models.ConsistencyModeTypes + :ivar provisioning_details: Gets the provisioning details set by the server during Create + restore point operation. + :vartype provisioning_details: + ~azure.mgmt.compute.v2021_07_01.models.RestorePointProvisioningDetails + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'source_metadata': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'consistency_mode': {'readonly': True}, + 'provisioning_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'exclude_disks': {'key': 'properties.excludeDisks', 'type': '[ApiEntityReference]'}, + 'source_metadata': {'key': 'properties.sourceMetadata', 'type': 'RestorePointSourceMetadata'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'consistency_mode': {'key': 'properties.consistencyMode', 'type': 'str'}, + 'provisioning_details': {'key': 'properties.provisioningDetails', 'type': 'RestorePointProvisioningDetails'}, + } + + def __init__( + self, + *, + exclude_disks: Optional[List["ApiEntityReference"]] = None, + **kwargs + ): + super(RestorePoint, self).__init__(**kwargs) + self.exclude_disks = exclude_disks + self.source_metadata = None + self.provisioning_state = None + self.consistency_mode = None + self.provisioning_details = None + + +class RestorePointCollection(Resource): + """Create or update Restore Point collection parameters. + + 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: The properties of the source resource that this restore point collection is + created from. + :type source: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollectionSourceProperties + :ivar provisioning_state: The provisioning state of the restore point collection. + :vartype provisioning_state: str + :ivar restore_point_collection_id: The unique id of the restore point collection. + :vartype restore_point_collection_id: str + :ivar restore_points: A list containing all restore points created under this restore point + collection. + :vartype restore_points: list[~azure.mgmt.compute.v2021_07_01.models.RestorePoint] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'restore_point_collection_id': {'readonly': True}, + 'restore_points': {'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': {'key': 'properties.source', 'type': 'RestorePointCollectionSourceProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'restore_point_collection_id': {'key': 'properties.restorePointCollectionId', 'type': 'str'}, + 'restore_points': {'key': 'properties.restorePoints', 'type': '[RestorePoint]'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + source: Optional["RestorePointCollectionSourceProperties"] = None, + **kwargs + ): + super(RestorePointCollection, self).__init__(location=location, tags=tags, **kwargs) + self.source = source + self.provisioning_state = None + self.restore_point_collection_id = None + self.restore_points = None + + +class RestorePointCollectionListResult(msrest.serialization.Model): + """The List restore point collection operation response. + + :param value: Gets the list of restore point collections. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.RestorePointCollection] + :param next_link: The uri to fetch the next page of RestorePointCollections. Call ListNext() + with this to fetch the next page of RestorePointCollections. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RestorePointCollection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["RestorePointCollection"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(RestorePointCollectionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class RestorePointCollectionSourceProperties(msrest.serialization.Model): + """The properties of the source resource that this restore point collection is created from. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Location of the source resource used to create this restore point collection. + :vartype location: str + :param id: Resource Id of the source resource used to create this restore point collection. + :type id: str + """ + + _validation = { + 'location': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(RestorePointCollectionSourceProperties, self).__init__(**kwargs) + self.location = None + self.id = id + + +class RestorePointCollectionUpdate(UpdateResource): + """Update Restore Point collection parameters. + + 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: The properties of the source resource that this restore point collection is + created from. + :type source: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollectionSourceProperties + :ivar provisioning_state: The provisioning state of the restore point collection. + :vartype provisioning_state: str + :ivar restore_point_collection_id: The unique id of the restore point collection. + :vartype restore_point_collection_id: str + :ivar restore_points: A list containing all restore points created under this restore point + collection. + :vartype restore_points: list[~azure.mgmt.compute.v2021_07_01.models.RestorePoint] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'restore_point_collection_id': {'readonly': True}, + 'restore_points': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'RestorePointCollectionSourceProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'restore_point_collection_id': {'key': 'properties.restorePointCollectionId', 'type': 'str'}, + 'restore_points': {'key': 'properties.restorePoints', 'type': '[RestorePoint]'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + source: Optional["RestorePointCollectionSourceProperties"] = None, + **kwargs + ): + super(RestorePointCollectionUpdate, self).__init__(tags=tags, **kwargs) + self.source = source + self.provisioning_state = None + self.restore_point_collection_id = None + self.restore_points = None + + +class RestorePointProvisioningDetails(msrest.serialization.Model): + """Restore Point Provisioning details. + + :param creation_time: Gets the creation time of the restore point. + :type creation_time: ~datetime.datetime + :param total_used_size_in_bytes: Gets the total size of the data in all the disks which are + part of the restore point. + :type total_used_size_in_bytes: long + :param status_code: Gets the status of the Create restore point operation. + :type status_code: int + :param status_message: Gets the status message of the Create restore point operation. + :type status_message: str + """ + + _attribute_map = { + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'total_used_size_in_bytes': {'key': 'totalUsedSizeInBytes', 'type': 'long'}, + 'status_code': {'key': 'statusCode', 'type': 'int'}, + 'status_message': {'key': 'statusMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + creation_time: Optional[datetime.datetime] = None, + total_used_size_in_bytes: Optional[int] = None, + status_code: Optional[int] = None, + status_message: Optional[str] = None, + **kwargs + ): + super(RestorePointProvisioningDetails, self).__init__(**kwargs) + self.creation_time = creation_time + self.total_used_size_in_bytes = total_used_size_in_bytes + self.status_code = status_code + self.status_message = status_message + + +class RestorePointSourceMetadata(msrest.serialization.Model): + """Describes the properties of the Virtual Machine for which the restore point was created. The properties provided are a subset and the snapshot of the overall Virtual Machine properties captured at the time of the restore point creation. + + :param hardware_profile: Gets the hardware profile. + :type hardware_profile: ~azure.mgmt.compute.v2021_07_01.models.HardwareProfile + :param storage_profile: Gets the storage profile. + :type storage_profile: + ~azure.mgmt.compute.v2021_07_01.models.RestorePointSourceVMStorageProfile + :param os_profile: Gets the OS profile. + :type os_profile: ~azure.mgmt.compute.v2021_07_01.models.OSProfile + :param diagnostics_profile: Gets the diagnostics profile. + :type diagnostics_profile: ~azure.mgmt.compute.v2021_07_01.models.DiagnosticsProfile + :param license_type: Gets the license type, which is for bring your own license scenario. + :type license_type: str + :param vm_id: Gets the virtual machine unique id. + :type vm_id: str + :param security_profile: Gets the security profile. + :type security_profile: ~azure.mgmt.compute.v2021_07_01.models.SecurityProfile + :param location: Location of the VM from which the restore point was created. + :type location: str + """ + + _attribute_map = { + 'hardware_profile': {'key': 'hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'RestorePointSourceVMStorageProfile'}, + 'os_profile': {'key': 'osProfile', 'type': 'OSProfile'}, + 'diagnostics_profile': {'key': 'diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'security_profile': {'key': 'securityProfile', 'type': 'SecurityProfile'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + hardware_profile: Optional["HardwareProfile"] = None, + storage_profile: Optional["RestorePointSourceVMStorageProfile"] = None, + os_profile: Optional["OSProfile"] = None, + diagnostics_profile: Optional["DiagnosticsProfile"] = None, + license_type: Optional[str] = None, + vm_id: Optional[str] = None, + security_profile: Optional["SecurityProfile"] = None, + location: Optional[str] = None, + **kwargs + ): + super(RestorePointSourceMetadata, self).__init__(**kwargs) + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.os_profile = os_profile + self.diagnostics_profile = diagnostics_profile + self.license_type = license_type + self.vm_id = vm_id + self.security_profile = security_profile + self.location = location + + +class RestorePointSourceVMDataDisk(msrest.serialization.Model): + """Describes a data disk. + + :param lun: Gets the logical unit number. + :type lun: int + :param name: Gets the disk name. + :type name: str + :param caching: Gets the caching type. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2021_07_01.models.CachingTypes + :param disk_size_gb: Gets the initial disk size in GB for blank data disks, and the new desired + size for existing OS and Data disks. + :type disk_size_gb: int + :param managed_disk: Gets the managed disk details. + :type managed_disk: ~azure.mgmt.compute.v2021_07_01.models.ManagedDiskParameters + :param disk_restore_point: Gets the disk restore point Id. + :type disk_restore_point: ~azure.mgmt.compute.v2021_07_01.models.ApiEntityReference + """ + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, + 'disk_restore_point': {'key': 'diskRestorePoint', 'type': 'ApiEntityReference'}, + } + + def __init__( + self, + *, + lun: Optional[int] = None, + name: Optional[str] = None, + caching: Optional[Union[str, "CachingTypes"]] = None, + disk_size_gb: Optional[int] = None, + managed_disk: Optional["ManagedDiskParameters"] = None, + disk_restore_point: Optional["ApiEntityReference"] = None, + **kwargs + ): + super(RestorePointSourceVMDataDisk, self).__init__(**kwargs) + self.lun = lun + self.name = name + self.caching = caching + self.disk_size_gb = disk_size_gb + self.managed_disk = managed_disk + self.disk_restore_point = disk_restore_point + + +class RestorePointSourceVMOSDisk(msrest.serialization.Model): + """Describes an Operating System disk. + + :param os_type: Gets the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemType + :param encryption_settings: Gets the disk encryption settings. + :type encryption_settings: ~azure.mgmt.compute.v2021_07_01.models.DiskEncryptionSettings + :param name: Gets the disk name. + :type name: str + :param caching: Gets the caching type. Possible values include: "None", "ReadOnly", + "ReadWrite". + :type caching: str or ~azure.mgmt.compute.v2021_07_01.models.CachingTypes + :param disk_size_gb: Gets the disk size in GB. + :type disk_size_gb: int + :param managed_disk: Gets the managed disk details. + :type managed_disk: ~azure.mgmt.compute.v2021_07_01.models.ManagedDiskParameters + :param disk_restore_point: Gets the disk restore point Id. + :type disk_restore_point: ~azure.mgmt.compute.v2021_07_01.models.ApiEntityReference + """ + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'str'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': 'DiskEncryptionSettings'}, + 'name': {'key': 'name', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, + 'disk_restore_point': {'key': 'diskRestorePoint', 'type': 'ApiEntityReference'}, + } + + def __init__( + self, + *, + os_type: Optional[Union[str, "OperatingSystemType"]] = None, + encryption_settings: Optional["DiskEncryptionSettings"] = None, + name: Optional[str] = None, + caching: Optional[Union[str, "CachingTypes"]] = None, + disk_size_gb: Optional[int] = None, + managed_disk: Optional["ManagedDiskParameters"] = None, + disk_restore_point: Optional["ApiEntityReference"] = None, + **kwargs + ): + super(RestorePointSourceVMOSDisk, self).__init__(**kwargs) + self.os_type = os_type + self.encryption_settings = encryption_settings + self.name = name + self.caching = caching + self.disk_size_gb = disk_size_gb + self.managed_disk = managed_disk + self.disk_restore_point = disk_restore_point + + +class RestorePointSourceVMStorageProfile(msrest.serialization.Model): + """Describes the storage profile. + + :param os_disk: Gets the OS disk of the VM captured at the time of the restore point creation. + :type os_disk: ~azure.mgmt.compute.v2021_07_01.models.RestorePointSourceVMOSDisk + :param data_disks: Gets the data disks of the VM captured at the time of the restore point + creation. + :type data_disks: list[~azure.mgmt.compute.v2021_07_01.models.RestorePointSourceVMDataDisk] + """ + + _attribute_map = { + 'os_disk': {'key': 'osDisk', 'type': 'RestorePointSourceVMOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[RestorePointSourceVMDataDisk]'}, + } + + def __init__( + self, + *, + os_disk: Optional["RestorePointSourceVMOSDisk"] = None, + data_disks: Optional[List["RestorePointSourceVMDataDisk"]] = None, + **kwargs + ): + super(RestorePointSourceVMStorageProfile, self).__init__(**kwargs) + self.os_disk = os_disk + self.data_disks = data_disks + + +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.v2021_07_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 + :param enable_cross_zone_upgrade: Allow VMSS to ignore AZ boundaries when constructing upgrade + batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the + batch size. + :type enable_cross_zone_upgrade: bool + :param prioritize_unhealthy_instances: Upgrade all unhealthy instances in a scale set before + any healthy instances. + :type prioritize_unhealthy_instances: bool + """ + + _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'}, + 'enable_cross_zone_upgrade': {'key': 'enableCrossZoneUpgrade', 'type': 'bool'}, + 'prioritize_unhealthy_instances': {'key': 'prioritizeUnhealthyInstances', 'type': 'bool'}, + } + + 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, + enable_cross_zone_upgrade: Optional[bool] = None, + prioritize_unhealthy_instances: Optional[bool] = 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 + self.enable_cross_zone_upgrade = enable_cross_zone_upgrade + self.prioritize_unhealthy_instances = prioritize_unhealthy_instances + + +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.v2021_07_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.v2021_07_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.v2021_07_01.models.RollingUpgradePolicy + :ivar running_status: Information about the current running state of the overall upgrade. + :vartype running_status: ~azure.mgmt.compute.v2021_07_01.models.RollingUpgradeRunningStatus + :ivar progress: Information about the number of virtual machine instances in each upgrade + state. + :vartype progress: ~azure.mgmt.compute.v2021_07_01.models.RollingUpgradeProgressInfo + :ivar error: Error details for this upgrade, if there are any. + :vartype error: ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetScaleInRules] + :param force_deletion: This property allows you to specify if virtual machines chosen for + removal have to be force deleted when a virtual machine scale set is being scaled-in.(Feature + in Preview). + :type force_deletion: bool + """ + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[str]'}, + 'force_deletion': {'key': 'forceDeletion', 'type': 'bool'}, + } + + def __init__( + self, + *, + rules: Optional[List[Union[str, "VirtualMachineScaleSetScaleInRules"]]] = None, + force_deletion: Optional[bool] = None, + **kwargs + ): + super(ScaleInPolicy, self).__init__(**kwargs) + self.rules = rules + self.force_deletion = force_deletion + + +class ScheduledEventsProfile(msrest.serialization.Model): + """ScheduledEventsProfile. + + :param terminate_notification_profile: Specifies Terminate Scheduled Event related + configurations. + :type terminate_notification_profile: + ~azure.mgmt.compute.v2021_07_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 uefi_settings: Specifies the security settings like secure boot and vTPM used while + creating the virtual machine. :code:`
    `:code:`
    `Minimum api-version: 2020-12-01. + :type uefi_settings: ~azure.mgmt.compute.v2021_07_01.models.UefiSettings + :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 + :param security_type: Specifies the SecurityType of the virtual machine. It is set as + TrustedLaunch to enable UefiSettings. :code:`
    `:code:`
    ` Default: UefiSettings will not + be enabled unless this property is set as TrustedLaunch. Possible values include: + "TrustedLaunch". + :type security_type: str or ~azure.mgmt.compute.v2021_07_01.models.SecurityTypes + """ + + _attribute_map = { + 'uefi_settings': {'key': 'uefiSettings', 'type': 'UefiSettings'}, + 'encryption_at_host': {'key': 'encryptionAtHost', 'type': 'bool'}, + 'security_type': {'key': 'securityType', 'type': 'str'}, + } + + def __init__( + self, + *, + uefi_settings: Optional["UefiSettings"] = None, + encryption_at_host: Optional[bool] = None, + security_type: Optional[Union[str, "SecurityTypes"]] = None, + **kwargs + ): + super(SecurityProfile, self).__init__(**kwargs) + self.uefi_settings = uefi_settings + self.encryption_at_host = encryption_at_host + self.security_type = security_type + + +class SharedGallery(PirSharedGalleryResource): + """Specifies information about the Shared Gallery that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + } + + def __init__( + self, + *, + unique_id: Optional[str] = None, + **kwargs + ): + super(SharedGallery, self).__init__(unique_id=unique_id, **kwargs) + + +class SharedGalleryImage(PirSharedGalleryResource): + """Specifies information about the gallery image definition that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
    `:code:`
    ` Possible values are: + :code:`
    `:code:`
    ` **Windows** :code:`
    `:code:`
    ` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemStateTypes + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2021_07_01.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2021_07_01.models.Disallowed + :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.v2021_07_01.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2021_07_01.models.GalleryImageFeature] + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2021_07_01.models.ImagePurchasePlan + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + } + + def __init__( + self, + *, + unique_id: Optional[str] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + os_state: Optional[Union[str, "OperatingSystemStateTypes"]] = None, + end_of_life_date: Optional[datetime.datetime] = None, + identifier: Optional["GalleryImageIdentifier"] = None, + recommended: Optional["RecommendedMachineConfiguration"] = None, + disallowed: Optional["Disallowed"] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, + features: Optional[List["GalleryImageFeature"]] = None, + purchase_plan: Optional["ImagePurchasePlan"] = None, + **kwargs + ): + super(SharedGalleryImage, self).__init__(unique_id=unique_id, **kwargs) + self.os_type = os_type + self.os_state = os_state + self.end_of_life_date = end_of_life_date + self.identifier = identifier + self.recommended = recommended + self.disallowed = disallowed + self.hyper_v_generation = hyper_v_generation + self.features = features + self.purchase_plan = purchase_plan + + +class SharedGalleryImageList(msrest.serialization.Model): + """The List Shared Gallery Images operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of shared gallery images. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.SharedGalleryImage] + :param next_link: The uri to fetch the next page of shared gallery images. Call ListNext() with + this to fetch the next page of shared gallery images. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedGalleryImage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SharedGalleryImage"], + next_link: Optional[str] = None, + **kwargs + ): + super(SharedGalleryImageList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SharedGalleryImageVersion(PirSharedGalleryResource): + """Specifies information about the gallery image version that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + :param published_date: The published date of the gallery image version Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'published_date': {'key': 'properties.publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + unique_id: Optional[str] = None, + published_date: Optional[datetime.datetime] = None, + end_of_life_date: Optional[datetime.datetime] = None, + **kwargs + ): + super(SharedGalleryImageVersion, self).__init__(unique_id=unique_id, **kwargs) + self.published_date = published_date + self.end_of_life_date = end_of_life_date + + +class SharedGalleryImageVersionList(msrest.serialization.Model): + """The List Shared Gallery Image versions operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of shared gallery images versions. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.SharedGalleryImageVersion] + :param next_link: The uri to fetch the next page of shared gallery image versions. Call + ListNext() with this to fetch the next page of shared gallery image versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedGalleryImageVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SharedGalleryImageVersion"], + next_link: Optional[str] = None, + **kwargs + ): + super(SharedGalleryImageVersionList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SharedGalleryList(msrest.serialization.Model): + """The List Shared Galleries operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of shared galleries. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.SharedGallery] + :param next_link: The uri to fetch the next page of shared galleries. Call ListNext() with this + to fetch the next page of shared galleries. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedGallery]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SharedGallery"], + next_link: Optional[str] = None, + **kwargs + ): + super(SharedGalleryList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SharingProfile(msrest.serialization.Model): + """Profile for gallery sharing to subscription or tenant. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param permissions: This property allows you to specify the permission of sharing gallery. + :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` **Private** + :code:`
    `:code:`
    ` **Groups**. Possible values include: "Private", "Groups". + :type permissions: str or ~azure.mgmt.compute.v2021_07_01.models.GallerySharingPermissionTypes + :ivar groups: A list of sharing profile groups. + :vartype groups: list[~azure.mgmt.compute.v2021_07_01.models.SharingProfileGroup] + """ + + _validation = { + 'groups': {'readonly': True}, + } + + _attribute_map = { + 'permissions': {'key': 'permissions', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[SharingProfileGroup]'}, + } + + def __init__( + self, + *, + permissions: Optional[Union[str, "GallerySharingPermissionTypes"]] = None, + **kwargs + ): + super(SharingProfile, self).__init__(**kwargs) + self.permissions = permissions + self.groups = None + + +class SharingProfileGroup(msrest.serialization.Model): + """Group of the gallery sharing profile. + + :param type: This property allows you to specify the type of sharing group. + :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` **Subscriptions** + :code:`
    `:code:`
    ` **AADTenants**. Possible values include: "Subscriptions", + "AADTenants". + :type type: str or ~azure.mgmt.compute.v2021_07_01.models.SharingProfileGroupTypes + :param ids: A list of subscription/tenant ids the gallery is aimed to be shared to. + :type ids: list[str] + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'ids': {'key': 'ids', 'type': '[str]'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "SharingProfileGroupTypes"]] = None, + ids: Optional[List[str]] = None, + **kwargs + ): + super(SharingProfileGroup, self).__init__(**kwargs) + self.type = type + self.ids = ids + + +class SharingUpdate(msrest.serialization.Model): + """Specifies information about the gallery sharing profile update. + + All required parameters must be populated in order to send to Azure. + + :param operation_type: Required. This property allows you to specify the operation type of + gallery sharing update. :code:`
    `:code:`
    ` Possible values are: :code:`
    `:code:`
    ` + **Add** :code:`
    `:code:`
    ` **Remove** :code:`
    `:code:`
    ` **Reset**. Possible values + include: "Add", "Remove", "Reset". + :type operation_type: str or ~azure.mgmt.compute.v2021_07_01.models.SharingUpdateOperationTypes + :param groups: A list of sharing profile groups. + :type groups: list[~azure.mgmt.compute.v2021_07_01.models.SharingProfileGroup] + """ + + _validation = { + 'operation_type': {'required': True}, + } + + _attribute_map = { + 'operation_type': {'key': 'operationType', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[SharingProfileGroup]'}, + } + + def __init__( + self, + *, + operation_type: Union[str, "SharingUpdateOperationTypes"], + groups: Optional[List["SharingProfileGroup"]] = None, + **kwargs + ): + super(SharingUpdate, self).__init__(**kwargs) + self.operation_type = operation_type + self.groups = groups + + +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 SoftDeletePolicy(msrest.serialization.Model): + """Contains information about the soft deletion policy of the gallery. + + :param is_soft_delete_enabled: Enables soft-deletion for resources in this gallery, allowing + them to be recovered within retention time. + :type is_soft_delete_enabled: bool + """ + + _attribute_map = { + 'is_soft_delete_enabled': {'key': 'isSoftDeleteEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + is_soft_delete_enabled: Optional[bool] = None, + **kwargs + ): + super(SoftDeletePolicy, self).__init__(**kwargs) + self.is_soft_delete_enabled = is_soft_delete_enabled + + +class SpotRestorePolicy(msrest.serialization.Model): + """Specifies the Spot-Try-Restore properties for the virtual machine scale set. :code:`
    `:code:`
    ` With this property customer can enable or disable automatic restore of the evicted Spot VMSS VM instances opportunistically based on capacity availability and pricing constraint. + + :param enabled: Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be + tried to be restored opportunistically based on capacity availability and pricing constraints. + :type enabled: bool + :param restore_timeout: Timeout value expressed as an ISO 8601 time duration after which the + platform will not try to restore the VMSS SPOT instances. + :type restore_timeout: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'restore_timeout': {'key': 'restoreTimeout', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + restore_timeout: Optional[str] = None, + **kwargs + ): + super(SpotRestorePolicy, self).__init__(**kwargs) + self.enabled = enabled + self.restore_timeout = restore_timeout + + +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.v2021_07_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]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + :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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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 TargetRegion(msrest.serialization.Model): + """Describes the target region information. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the region. + :type name: str + :param regional_replica_count: The number of replicas of the Image Version to be created per + region. This property is updatable. + :type regional_replica_count: int + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_01.models.StorageAccountType + :param encryption: Optional. Allows users to provide customer managed keys for encrypting the + OS and data disks in the gallery artifact. + :type encryption: ~azure.mgmt.compute.v2021_07_01.models.EncryptionImages + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'regional_replica_count': {'key': 'regionalReplicaCount', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'encryption': {'key': 'encryption', 'type': 'EncryptionImages'}, + } + + def __init__( + self, + *, + name: str, + regional_replica_count: Optional[int] = None, + storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + encryption: Optional["EncryptionImages"] = None, + **kwargs + ): + super(TargetRegion, self).__init__(**kwargs) + self.name = name + self.regional_replica_count = regional_replica_count + self.storage_account_type = storage_account_type + self.encryption = encryption + + +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 + :param group_by_client_application_id: Group query result by Client Application ID. + :type group_by_client_application_id: bool + :param group_by_user_agent: Group query result by User Agent. + :type group_by_user_agent: bool + """ + + _validation = { + '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'}, + 'group_by_client_application_id': {'key': 'groupByClientApplicationId', 'type': 'bool'}, + 'group_by_user_agent': {'key': 'groupByUserAgent', '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, + group_by_client_application_id: Optional[bool] = None, + group_by_user_agent: Optional[bool] = None, + **kwargs + ): + super(ThrottledRequestsInput, self).__init__(blob_container_sas_uri=blob_container_sas_uri, from_time=from_time, to_time=to_time, group_by_throttle_policy=group_by_throttle_policy, group_by_operation_name=group_by_operation_name, group_by_resource_name=group_by_resource_name, group_by_client_application_id=group_by_client_application_id, group_by_user_agent=group_by_user_agent, **kwargs) + + +class UefiSettings(msrest.serialization.Model): + """Specifies the security settings like secure boot and vTPM used while creating the virtual machine. :code:`
    `:code:`
    `Minimum api-version: 2020-12-01. + + :param secure_boot_enabled: Specifies whether secure boot should be enabled on the virtual + machine. :code:`
    `:code:`
    `Minimum api-version: 2020-12-01. + :type secure_boot_enabled: bool + :param v_tpm_enabled: Specifies whether vTPM should be enabled on the virtual machine. + :code:`
    `:code:`
    `Minimum api-version: 2020-12-01. + :type v_tpm_enabled: bool + """ + + _attribute_map = { + 'secure_boot_enabled': {'key': 'secureBootEnabled', 'type': 'bool'}, + 'v_tpm_enabled': {'key': 'vTpmEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + secure_boot_enabled: Optional[bool] = None, + v_tpm_enabled: Optional[bool] = None, + **kwargs + ): + super(UefiSettings, self).__init__(**kwargs) + self.secure_boot_enabled = secure_boot_enabled + self.v_tpm_enabled = v_tpm_enabled + + +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.v2021_07_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.v2021_07_01.models.UpgradeOperationHistoryStatus + :ivar progress: Counts of the VMs in each state. + :vartype progress: ~azure.mgmt.compute.v2021_07_01.models.RollingUpgradeProgressInfo + :ivar error: Error Details for this upgrade if there are any. + :vartype error: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.UpgradeOperationInvoker + :ivar target_image_reference: Image Reference details. + :vartype target_image_reference: ~azure.mgmt.compute.v2021_07_01.models.ImageReference + :ivar rollback_info: Information about OS rollback if performed. + :vartype rollback_info: ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_01.models.UpgradeMode + :param rolling_upgrade_policy: The configuration parameters used while performing a rolling + upgrade. + :type rolling_upgrade_policy: ~azure.mgmt.compute.v2021_07_01.models.RollingUpgradePolicy + :param automatic_os_upgrade_policy: Configuration parameters used for performing automatic OS + Upgrade. + :type automatic_os_upgrade_policy: + ~azure.mgmt.compute.v2021_07_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: An enum describing the unit of usage measurement. Has constant 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.v2021_07_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 UserArtifactManage(msrest.serialization.Model): + """UserArtifactManage. + + All required parameters must be populated in order to send to Azure. + + :param install: Required. Required. The path and arguments to install the gallery application. + This is limited to 4096 characters. + :type install: str + :param remove: Required. Required. The path and arguments to remove the gallery application. + This is limited to 4096 characters. + :type remove: str + :param update: Optional. The path and arguments to update the gallery application. If not + present, then update operation will invoke remove command on the previous version and install + command on the current version of the gallery application. This is limited to 4096 characters. + :type update: str + """ + + _validation = { + 'install': {'required': True}, + 'remove': {'required': True}, + } + + _attribute_map = { + 'install': {'key': 'install', 'type': 'str'}, + 'remove': {'key': 'remove', 'type': 'str'}, + 'update': {'key': 'update', 'type': 'str'}, + } + + def __init__( + self, + *, + install: str, + remove: str, + update: Optional[str] = None, + **kwargs + ): + super(UserArtifactManage, self).__init__(**kwargs) + self.install = install + self.remove = remove + self.update = update + + +class UserArtifactSource(msrest.serialization.Model): + """The source image from which the Image Version is going to be created. + + All required parameters must be populated in order to send to Azure. + + :param media_link: Required. Required. The mediaLink of the artifact, must be a readable + storage page blob. + :type media_link: str + :param default_configuration_link: Optional. The defaultConfigurationLink of the artifact, must + be a readable storage page blob. + :type default_configuration_link: str + """ + + _validation = { + 'media_link': {'required': True}, + } + + _attribute_map = { + 'media_link': {'key': 'mediaLink', 'type': 'str'}, + 'default_configuration_link': {'key': 'defaultConfigurationLink', 'type': 'str'}, + } + + def __init__( + self, + *, + media_link: str, + default_configuration_link: Optional[str] = None, + **kwargs + ): + super(UserArtifactSource, self).__init__(**kwargs) + self.media_link = media_link + self.default_configuration_link = default_configuration_link + + +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + 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(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = 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:`
    `} :code:`
    ` To install certificates on a + virtual machine it is recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ or the + `Azure Key Vault virtual machine extension for Windows + `_. + :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.v2021_07_01.models.SubResource + :param vault_certificates: The list of key vault references in SourceVault which contain + certificates. + :type vault_certificates: list[~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.Plan + :ivar resources: The virtual machine child extension resources. + :vartype resources: list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineExtension] + :param identity: The identity of the virtual machine, if configured. + :type identity: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineIdentity + :param zones: The virtual machine zones. + :type zones: list[str] + :param extended_location: The extended location of the Virtual Machine. + :type extended_location: ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocation + :param hardware_profile: Specifies the hardware settings for the virtual machine. + :type hardware_profile: ~azure.mgmt.compute.v2021_07_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2021_07_01.models.StorageProfile + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + virtual machine. + :type additional_capabilities: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual machine. + :type network_profile: ~azure.mgmt.compute.v2021_07_01.models.NetworkProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machine. + :type security_profile: ~azure.mgmt.compute.v2021_07_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.v2021_07_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 `Availability sets overview + `_. + :code:`
    `:code:`
    ` For more information on Azure planned maintenance, see `Maintenance + and updates 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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used was licensed + on-premises. :code:`
    `:code:`
    ` Possible values for Windows Server operating system are: + :code:`
    `:code:`
    ` Windows_Client :code:`
    `:code:`
    ` Windows_Server + :code:`
    `:code:`
    ` Possible values for Linux Server operating system are: + :code:`
    `:code:`
    ` RHEL_BYOS (for RHEL) :code:`
    `:code:`
    ` SLES_BYOS (for SUSE) + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ + :code:`
    `:code:`
    ` `Azure Hybrid Use Benefit for Linux 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 + :param platform_fault_domain: Specifies the scale set logical fault domain into which the + Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned + to a fault domain that best maintains balance across available fault + domains.:code:`
    `:code:`
  • `This is applicable only if the 'virtualMachineScaleSet' + property of this Virtual Machine is set.:code:`
  • `The Virtual Machine Scale Set that is + referenced, must have 'platformFaultDomainCount' > 1.:code:`
  • `This property cannot be + updated once the Virtual Machine is created.:code:`
  • `Fault domain assignment can be viewed + in the Virtual Machine Instance View.:code:`
    `:code:`
    `Minimum api‐version: 2020‐12‐01. + :type platform_fault_domain: int + :param scheduled_events_profile: Specifies Scheduled Event related configurations. + :type scheduled_events_profile: ~azure.mgmt.compute.v2021_07_01.models.ScheduledEventsProfile + :param user_data: UserData for the VM, which must be base-64 encoded. Customer should not pass + any secrets in here. :code:`
    `:code:`
    `Minimum api-version: 2021-03-01. + :type user_data: str + :param capacity_reservation: Specifies information about the capacity reservation that is used + to allocate virtual machine. :code:`
    `:code:`
    `Minimum api-version: 2021-04-01. + :type capacity_reservation: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationProfile + :param application_profile: Specifies the gallery applications that should be made available to + the VM/VMSS. + :type application_profile: ~azure.mgmt.compute.v2021_07_01.models.ApplicationProfile + """ + + _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]'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + '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'}, + 'platform_fault_domain': {'key': 'properties.platformFaultDomain', 'type': 'int'}, + 'scheduled_events_profile': {'key': 'properties.scheduledEventsProfile', 'type': 'ScheduledEventsProfile'}, + 'user_data': {'key': 'properties.userData', 'type': 'str'}, + 'capacity_reservation': {'key': 'properties.capacityReservation', 'type': 'CapacityReservationProfile'}, + 'application_profile': {'key': 'properties.applicationProfile', 'type': 'ApplicationProfile'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + plan: Optional["Plan"] = None, + identity: Optional["VirtualMachineIdentity"] = None, + zones: Optional[List[str]] = None, + extended_location: Optional["ExtendedLocation"] = 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, + platform_fault_domain: Optional[int] = None, + scheduled_events_profile: Optional["ScheduledEventsProfile"] = None, + user_data: Optional[str] = None, + capacity_reservation: Optional["CapacityReservationProfile"] = None, + application_profile: Optional["ApplicationProfile"] = None, + **kwargs + ): + super(VirtualMachine, self).__init__(location=location, tags=tags, **kwargs) + self.plan = plan + self.resources = None + self.identity = identity + self.zones = zones + self.extended_location = extended_location + 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 + self.platform_fault_domain = platform_fault_domain + self.scheduled_events_profile = scheduled_events_profile + self.user_data = user_data + self.capacity_reservation = capacity_reservation + self.application_profile = application_profile + + +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.v2021_07_01.models.VirtualMachineExtensionHandlerInstanceView] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_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 "Unknown", "Failed", "Succeeded", + or "CompletedWithWarnings.". Possible values include: "Unknown", "InProgress", "Failed", + "Succeeded", "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2021_07_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 available_patches: The list of patches that have been detected as available for + installation. + :vartype available_patches: + list[~azure.mgmt.compute.v2021_07_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.v2021_07_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}, + 'available_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'}, + 'available_patches': {'key': 'availablePatches', '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.available_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: any + :ivar resources: a list of resource items of the captured virtual machine. + :vartype resources: list[any] + """ + + _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: any + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: any + :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.v2021_07_01.models.VirtualMachineExtensionInstanceView + :param suppress_failures: Indicates whether failures stemming from the extension will be + suppressed (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :type suppress_failures: bool + """ + + _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'}, + 'suppress_failures': {'key': 'properties.suppressFailures', 'type': 'bool'}, + } + + 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[Any] = None, + protected_settings: Optional[Any] = None, + instance_view: Optional["VirtualMachineExtensionInstanceView"] = None, + suppress_failures: Optional[bool] = 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 + self.suppress_failures = suppress_failures + + +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.v2021_07_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.v2021_07_01.models.InstanceViewStatus] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_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.v2021_07_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: any + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: any + :param suppress_failures: Indicates whether failures stemming from the extension will be + suppressed (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :type suppress_failures: bool + """ + + _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'}, + 'suppress_failures': {'key': 'properties.suppressFailures', 'type': 'bool'}, + } + + 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[Any] = None, + protected_settings: Optional[Any] = None, + suppress_failures: Optional[bool] = 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 + self.suppress_failures = suppress_failures + + +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.v2021_07_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.v2021_07_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.v2021_07_01.models.UserAssignedIdentitiesValue] + """ + + _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': '{UserAssignedIdentitiesValue}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentitiesValue"]] = 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] + :param extended_location: The extended location of the Virtual Machine. + :type extended_location: ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocation + """ + + _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}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + } + + def __init__( + self, + *, + name: str, + location: str, + id: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["ExtendedLocation"] = None, + **kwargs + ): + super(VirtualMachineImageResource, self).__init__(id=id, **kwargs) + self.name = name + self.location = location + self.tags = tags + self.extended_location = extended_location + + +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 extended_location: The extended location of the Virtual Machine. + :type extended_location: ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocation + :param plan: Used for establishing the purchase context of any 3rd Party artifact through + MarketPlace. + :type plan: ~azure.mgmt.compute.v2021_07_01.models.PurchasePlan + :param os_disk_image: Contains the os disk image information. + :type os_disk_image: ~azure.mgmt.compute.v2021_07_01.models.OSDiskImage + :param data_disk_images: + :type data_disk_images: list[~azure.mgmt.compute.v2021_07_01.models.DataDiskImage] + :param automatic_os_upgrade_properties: Describes automatic OS upgrade properties on the image. + :type automatic_os_upgrade_properties: + ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.HyperVGenerationTypes + :param disallowed: Specifies disallowed configuration for the VirtualMachine created from the + image. + :type disallowed: ~azure.mgmt.compute.v2021_07_01.models.DisallowedConfiguration + :param features: + :type features: list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineImageFeature] + """ + + _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}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + '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'}, + 'features': {'key': 'properties.features', 'type': '[VirtualMachineImageFeature]'}, + } + + def __init__( + self, + *, + name: str, + location: str, + id: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["ExtendedLocation"] = 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, + features: Optional[List["VirtualMachineImageFeature"]] = None, + **kwargs + ): + super(VirtualMachineImage, self).__init__(id=id, name=name, location=location, tags=tags, extended_location=extended_location, **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 + self.features = features + + +class VirtualMachineImageFeature(msrest.serialization.Model): + """Specifies additional capabilities supported by the image. + + :param name: The name of the feature. + :type name: str + :param value: The corresponding value for the feature. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(VirtualMachineImageFeature, self).__init__(**kwargs) + self.name = name + self.value = value + + +class VirtualMachineInstallPatchesParameters(msrest.serialization.Model): + """Input for InstallPatches as directly received by the API. + + All required parameters must be populated in order to send to Azure. + + :param maximum_duration: Specifies the maximum amount of time that the operation will run. It + must be an ISO 8601-compliant duration string such as PT4H (4 hours). + :type maximum_duration: str + :param reboot_setting: Required. Defines when it is acceptable to reboot a VM during a software + update operation. Possible values include: "IfRequired", "Never", "Always". + :type reboot_setting: str or ~azure.mgmt.compute.v2021_07_01.models.VMGuestPatchRebootSetting + :param windows_parameters: Input for InstallPatches on a Windows VM, as directly received by + the API. + :type windows_parameters: ~azure.mgmt.compute.v2021_07_01.models.WindowsParameters + :param linux_parameters: Input for InstallPatches on a Linux VM, as directly received by the + API. + :type linux_parameters: ~azure.mgmt.compute.v2021_07_01.models.LinuxParameters + """ + + _validation = { + 'reboot_setting': {'required': True}, + } + + _attribute_map = { + 'maximum_duration': {'key': 'maximumDuration', 'type': 'str'}, + 'reboot_setting': {'key': 'rebootSetting', 'type': 'str'}, + 'windows_parameters': {'key': 'windowsParameters', 'type': 'WindowsParameters'}, + 'linux_parameters': {'key': 'linuxParameters', 'type': 'LinuxParameters'}, + } + + def __init__( + self, + *, + reboot_setting: Union[str, "VMGuestPatchRebootSetting"], + maximum_duration: Optional[str] = None, + windows_parameters: Optional["WindowsParameters"] = None, + linux_parameters: Optional["LinuxParameters"] = None, + **kwargs + ): + super(VirtualMachineInstallPatchesParameters, self).__init__(**kwargs) + self.maximum_duration = maximum_duration + self.reboot_setting = reboot_setting + self.windows_parameters = windows_parameters + self.linux_parameters = linux_parameters + + +class VirtualMachineInstallPatchesResult(msrest.serialization.Model): + """The result summary of an installation operation. + + 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", "Unknown" or + "CompletedWithWarnings.". Possible values include: "Unknown", "InProgress", "Failed", + "Succeeded", "CompletedWithWarnings". + :vartype status: str or ~azure.mgmt.compute.v2021_07_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 reboot_status: The reboot state of the VM following completion of the operation. Possible + values include: "Unknown", "NotNeeded", "Required", "Started", "Failed", "Completed". + :vartype reboot_status: str or ~azure.mgmt.compute.v2021_07_01.models.VMGuestPatchRebootStatus + :ivar maintenance_window_exceeded: Whether the operation ran out of time before it completed + all its intended actions. + :vartype maintenance_window_exceeded: bool + :ivar excluded_patch_count: The number of patches that were not installed due to the user + blocking their installation. + :vartype excluded_patch_count: int + :ivar not_selected_patch_count: The number of patches that were detected as available for + install, but did not meet the operation's criteria. + :vartype not_selected_patch_count: int + :ivar pending_patch_count: The number of patches that were identified as meeting the + installation criteria, but were not able to be installed. Typically this happens when + maintenanceWindowExceeded == true. + :vartype pending_patch_count: int + :ivar installed_patch_count: The number of patches successfully installed. + :vartype installed_patch_count: int + :ivar failed_patch_count: The number of patches that could not be installed due to some issue. + See errors for details. + :vartype failed_patch_count: int + :ivar patches: The patches that were installed during the operation. + :vartype patches: list[~azure.mgmt.compute.v2021_07_01.models.PatchInstallationDetail] + :ivar start_date_time: The UTC timestamp when the operation began. + :vartype start_date_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.v2021_07_01.models.ApiError + """ + + _validation = { + 'status': {'readonly': True}, + 'installation_activity_id': {'readonly': True}, + 'reboot_status': {'readonly': True}, + 'maintenance_window_exceeded': {'readonly': True}, + 'excluded_patch_count': {'readonly': True}, + 'not_selected_patch_count': {'readonly': True}, + 'pending_patch_count': {'readonly': True}, + 'installed_patch_count': {'readonly': True}, + 'failed_patch_count': {'readonly': True}, + 'patches': {'readonly': True}, + 'start_date_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'installation_activity_id': {'key': 'installationActivityId', 'type': 'str'}, + 'reboot_status': {'key': 'rebootStatus', 'type': 'str'}, + 'maintenance_window_exceeded': {'key': 'maintenanceWindowExceeded', 'type': 'bool'}, + 'excluded_patch_count': {'key': 'excludedPatchCount', 'type': 'int'}, + 'not_selected_patch_count': {'key': 'notSelectedPatchCount', 'type': 'int'}, + 'pending_patch_count': {'key': 'pendingPatchCount', 'type': 'int'}, + 'installed_patch_count': {'key': 'installedPatchCount', 'type': 'int'}, + 'failed_patch_count': {'key': 'failedPatchCount', 'type': 'int'}, + 'patches': {'key': 'patches', 'type': '[PatchInstallationDetail]'}, + 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineInstallPatchesResult, self).__init__(**kwargs) + self.status = None + self.installation_activity_id = None + self.reboot_status = None + self.maintenance_window_exceeded = None + self.excluded_patch_count = None + self.not_selected_patch_count = None + self.pending_patch_count = None + self.installed_patch_count = None + self.failed_patch_count = None + self.patches = None + self.start_date_time = None + self.error = 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.v2021_07_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.v2021_07_01.models.VirtualMachineAgentInstanceView + :param maintenance_redeploy_status: The Maintenance Operation status on the virtual machine. + :type maintenance_redeploy_status: + ~azure.mgmt.compute.v2021_07_01.models.MaintenanceRedeployStatus + :param disks: The virtual machine disk information. + :type disks: list[~azure.mgmt.compute.v2021_07_01.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineExtensionInstanceView] + :ivar vm_health: The health status for the VM. + :vartype vm_health: ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_01.models.InstanceViewStatus] + :param patch_status: [Preview Feature] The status of virtual machine patch operations. + :type patch_status: ~azure.mgmt.compute.v2021_07_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 VirtualMachineIpTag(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(VirtualMachineIpTag, self).__init__(**kwargs) + self.ip_tag_type = ip_tag_type + self.tag = tag + + +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.v2021_07_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 VirtualMachineNetworkInterfaceConfiguration(msrest.serialization.Model): + """Describes a virtual machine network interface configurations. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The network interface 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 delete_option: Specify what happens to the network interface when the VM is deleted. + Possible values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + :param enable_accelerated_networking: Specifies whether the network interface is accelerated + networking-enabled. + :type enable_accelerated_networking: bool + :param enable_fpga: Specifies whether the network interface is FPGA networking-enabled. + :type enable_fpga: bool + :param enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :type enable_ip_forwarding: bool + :param network_security_group: The network security group. + :type network_security_group: ~azure.mgmt.compute.v2021_07_01.models.SubResource + :param dns_settings: The dns settings to be applied on the network interfaces. + :type dns_settings: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration + :param ip_configurations: Specifies the IP configurations of the network interface. + :type ip_configurations: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineNetworkInterfaceIPConfiguration] + :param dscp_configuration: + :type dscp_configuration: ~azure.mgmt.compute.v2021_07_01.models.SubResource + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_fpga': {'key': 'properties.enableFpga', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineNetworkInterfaceDnsSettingsConfiguration'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineNetworkInterfaceIPConfiguration]'}, + 'dscp_configuration': {'key': 'properties.dscpConfiguration', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + name: str, + primary: Optional[bool] = None, + delete_option: Optional[Union[str, "DeleteOptions"]] = None, + enable_accelerated_networking: Optional[bool] = None, + enable_fpga: Optional[bool] = None, + enable_ip_forwarding: Optional[bool] = None, + network_security_group: Optional["SubResource"] = None, + dns_settings: Optional["VirtualMachineNetworkInterfaceDnsSettingsConfiguration"] = None, + ip_configurations: Optional[List["VirtualMachineNetworkInterfaceIPConfiguration"]] = None, + dscp_configuration: Optional["SubResource"] = None, + **kwargs + ): + super(VirtualMachineNetworkInterfaceConfiguration, self).__init__(**kwargs) + self.name = name + self.primary = primary + self.delete_option = delete_option + self.enable_accelerated_networking = enable_accelerated_networking + self.enable_fpga = enable_fpga + self.enable_ip_forwarding = enable_ip_forwarding + self.network_security_group = network_security_group + self.dns_settings = dns_settings + self.ip_configurations = ip_configurations + self.dscp_configuration = dscp_configuration + + +class VirtualMachineNetworkInterfaceDnsSettingsConfiguration(msrest.serialization.Model): + """Describes a virtual machines 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(VirtualMachineNetworkInterfaceDnsSettingsConfiguration, self).__init__(**kwargs) + self.dns_servers = dns_servers + + +class VirtualMachineNetworkInterfaceIPConfiguration(msrest.serialization.Model): + """Describes a virtual machine network profile's IP configuration. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The IP configuration name. + :type name: str + :param subnet: Specifies the identifier of the subnet. + :type subnet: ~azure.mgmt.compute.v2021_07_01.models.SubResource + :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.v2021_07_01.models.VirtualMachinePublicIPAddressConfiguration + :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.v2021_07_01.models.IPVersions + :param application_security_groups: Specifies an array of references to application security + group. + :type application_security_groups: list[~azure.mgmt.compute.v2021_07_01.models.SubResource] + :param application_gateway_backend_address_pools: Specifies an array of references to backend + address pools of application gateways. A virtual machine can reference backend address pools of + multiple application gateways. Multiple virtual machines cannot use the same application + gateway. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.compute.v2021_07_01.models.SubResource] + :param load_balancer_backend_address_pools: Specifies an array of references to backend address + pools of load balancers. A virtual machine can reference backend address pools of one public + and one internal load balancer. [Multiple virtual machines cannot use the same basic sku load + balancer]. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.compute.v2021_07_01.models.SubResource] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address_configuration': {'key': 'properties.publicIPAddressConfiguration', 'type': 'VirtualMachinePublicIPAddressConfiguration'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'application_security_groups': {'key': 'properties.applicationSecurityGroups', 'type': '[SubResource]'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'}, + } + + def __init__( + self, + *, + name: str, + subnet: Optional["SubResource"] = None, + primary: Optional[bool] = None, + public_ip_address_configuration: Optional["VirtualMachinePublicIPAddressConfiguration"] = None, + private_ip_address_version: Optional[Union[str, "IPVersions"]] = None, + application_security_groups: Optional[List["SubResource"]] = None, + application_gateway_backend_address_pools: Optional[List["SubResource"]] = None, + load_balancer_backend_address_pools: Optional[List["SubResource"]] = None, + **kwargs + ): + super(VirtualMachineNetworkInterfaceIPConfiguration, self).__init__(**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_security_groups = application_security_groups + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + + +class VirtualMachinePatchStatus(msrest.serialization.Model): + """The status of virtual machine patch operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param available_patch_summary: The available patch summary of the latest assessment operation + for the virtual machine. + :type available_patch_summary: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.LastPatchInstallationSummary + :ivar configuration_statuses: The enablement status of the specified patchMode. + :vartype configuration_statuses: + list[~azure.mgmt.compute.v2021_07_01.models.InstanceViewStatus] + """ + + _validation = { + 'configuration_statuses': {'readonly': True}, + } + + _attribute_map = { + 'available_patch_summary': {'key': 'availablePatchSummary', 'type': 'AvailablePatchSummary'}, + 'last_patch_installation_summary': {'key': 'lastPatchInstallationSummary', 'type': 'LastPatchInstallationSummary'}, + 'configuration_statuses': {'key': 'configurationStatuses', 'type': '[InstanceViewStatus]'}, + } + + 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 + self.configuration_statuses = None + + +class VirtualMachinePublicIPAddressConfiguration(msrest.serialization.Model): + """Describes a virtual machines 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 sku: Describes the public IP Sku. + :type sku: ~azure.mgmt.compute.v2021_07_01.models.PublicIPAddressSku + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param delete_option: Specify what happens to the public IP address when the VM is deleted. + Possible values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + :param dns_settings: The dns settings to be applied on the publicIP addresses . + :type dns_settings: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration + :param ip_tags: The list of IP tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineIpTag] + :param public_ip_prefix: The PublicIPPrefix from which to allocate publicIP addresses. + :type public_ip_prefix: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.IPVersions + :param public_ip_allocation_method: Specify the public IP allocation type. Possible values + include: "Dynamic", "Static". + :type public_ip_allocation_method: str or + ~azure.mgmt.compute.v2021_07_01.models.PublicIPAllocationMethod + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachinePublicIPAddressDnsSettingsConfiguration'}, + 'ip_tags': {'key': 'properties.ipTags', 'type': '[VirtualMachineIpTag]'}, + 'public_ip_prefix': {'key': 'properties.publicIPPrefix', 'type': 'SubResource'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + sku: Optional["PublicIPAddressSku"] = None, + idle_timeout_in_minutes: Optional[int] = None, + delete_option: Optional[Union[str, "DeleteOptions"]] = None, + dns_settings: Optional["VirtualMachinePublicIPAddressDnsSettingsConfiguration"] = None, + ip_tags: Optional[List["VirtualMachineIpTag"]] = None, + public_ip_prefix: Optional["SubResource"] = None, + public_ip_address_version: Optional[Union[str, "IPVersions"]] = None, + public_ip_allocation_method: Optional[Union[str, "PublicIPAllocationMethod"]] = None, + **kwargs + ): + super(VirtualMachinePublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = name + self.sku = sku + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.delete_option = delete_option + 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 + self.public_ip_allocation_method = public_ip_allocation_method + + +class VirtualMachinePublicIPAddressDnsSettingsConfiguration(msrest.serialization.Model): + """Describes a virtual machines 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 prefix of the PublicIPAddress + resources that will be created. The generated name label is the concatenation of the domain + name label and vm network profile unique ID. + :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(VirtualMachinePublicIPAddressDnsSettingsConfiguration, self).__init__(**kwargs) + self.domain_name_label = domain_name_label + + +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 VirtualMachineRunCommand(Resource): + """Describes a Virtual Machine run command. + + 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: The source of the run command script. + :type source: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandScriptSource + :param parameters: The parameters used by the script. + :type parameters: list[~azure.mgmt.compute.v2021_07_01.models.RunCommandInputParameter] + :param protected_parameters: The parameters used by the script. + :type protected_parameters: + list[~azure.mgmt.compute.v2021_07_01.models.RunCommandInputParameter] + :param async_execution: Optional. If set to true, provisioning will complete as soon as the + script starts and will not wait for script to complete. + :type async_execution: bool + :param run_as_user: Specifies the user account on the VM when executing the run command. + :type run_as_user: str + :param run_as_password: Specifies the user account password on the VM when executing the run + command. + :type run_as_password: str + :param timeout_in_seconds: The timeout in seconds to execute the run command. + :type timeout_in_seconds: int + :param output_blob_uri: Specifies the Azure storage blob where script output stream will be + uploaded. + :type output_blob_uri: str + :param error_blob_uri: Specifies the Azure storage blob where script error stream will be + uploaded. + :type error_blob_uri: str + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine run command instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + 'source': {'key': 'properties.source', 'type': 'VirtualMachineRunCommandScriptSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '[RunCommandInputParameter]'}, + 'protected_parameters': {'key': 'properties.protectedParameters', 'type': '[RunCommandInputParameter]'}, + 'async_execution': {'key': 'properties.asyncExecution', 'type': 'bool'}, + 'run_as_user': {'key': 'properties.runAsUser', 'type': 'str'}, + 'run_as_password': {'key': 'properties.runAsPassword', 'type': 'str'}, + 'timeout_in_seconds': {'key': 'properties.timeoutInSeconds', 'type': 'int'}, + 'output_blob_uri': {'key': 'properties.outputBlobUri', 'type': 'str'}, + 'error_blob_uri': {'key': 'properties.errorBlobUri', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineRunCommandInstanceView'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + source: Optional["VirtualMachineRunCommandScriptSource"] = None, + parameters: Optional[List["RunCommandInputParameter"]] = None, + protected_parameters: Optional[List["RunCommandInputParameter"]] = None, + async_execution: Optional[bool] = False, + run_as_user: Optional[str] = None, + run_as_password: Optional[str] = None, + timeout_in_seconds: Optional[int] = None, + output_blob_uri: Optional[str] = None, + error_blob_uri: Optional[str] = None, + **kwargs + ): + super(VirtualMachineRunCommand, self).__init__(location=location, tags=tags, **kwargs) + self.source = source + self.parameters = parameters + self.protected_parameters = protected_parameters + self.async_execution = async_execution + self.run_as_user = run_as_user + self.run_as_password = run_as_password + self.timeout_in_seconds = timeout_in_seconds + self.output_blob_uri = output_blob_uri + self.error_blob_uri = error_blob_uri + self.provisioning_state = None + self.instance_view = None + + +class VirtualMachineRunCommandInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine run command. + + :param execution_state: Script execution status. Possible values include: "Unknown", "Pending", + "Running", "Failed", "Succeeded", "TimedOut", "Canceled". + :type execution_state: str or ~azure.mgmt.compute.v2021_07_01.models.ExecutionState + :param execution_message: Communicate script configuration errors or execution messages. + :type execution_message: str + :param exit_code: Exit code returned from script execution. + :type exit_code: int + :param output: Script output stream. + :type output: str + :param error: Script error stream. + :type error: str + :param start_time: Script start time. + :type start_time: ~datetime.datetime + :param end_time: Script end time. + :type end_time: ~datetime.datetime + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'execution_state': {'key': 'executionState', 'type': 'str'}, + 'execution_message': {'key': 'executionMessage', 'type': 'str'}, + 'exit_code': {'key': 'exitCode', 'type': 'int'}, + 'output': {'key': 'output', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + *, + execution_state: Optional[Union[str, "ExecutionState"]] = None, + execution_message: Optional[str] = None, + exit_code: Optional[int] = None, + output: Optional[str] = None, + error: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + statuses: Optional[List["InstanceViewStatus"]] = None, + **kwargs + ): + super(VirtualMachineRunCommandInstanceView, self).__init__(**kwargs) + self.execution_state = execution_state + self.execution_message = execution_message + self.exit_code = exit_code + self.output = output + self.error = error + self.start_time = start_time + self.end_time = end_time + self.statuses = statuses + + +class VirtualMachineRunCommandScriptSource(msrest.serialization.Model): + """Describes the script sources for run command. + + :param script: Specifies the script content to be executed on the VM. + :type script: str + :param script_uri: Specifies the script download location. + :type script_uri: str + :param command_id: Specifies a commandId of predefined built-in script. + :type command_id: str + """ + + _attribute_map = { + 'script': {'key': 'script', 'type': 'str'}, + 'script_uri': {'key': 'scriptUri', 'type': 'str'}, + 'command_id': {'key': 'commandId', 'type': 'str'}, + } + + def __init__( + self, + *, + script: Optional[str] = None, + script_uri: Optional[str] = None, + command_id: Optional[str] = None, + **kwargs + ): + super(VirtualMachineRunCommandScriptSource, self).__init__(**kwargs) + self.script = script + self.script_uri = script_uri + self.command_id = command_id + + +class VirtualMachineRunCommandsListResult(msrest.serialization.Model): + """The List run command operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of run commands. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand] + :param next_link: The uri to fetch the next page of run commands. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineRunCommand]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["VirtualMachineRunCommand"], + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualMachineRunCommandsListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualMachineRunCommandUpdate(UpdateResource): + """Describes a Virtual Machine run command. + + 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: The source of the run command script. + :type source: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandScriptSource + :param parameters: The parameters used by the script. + :type parameters: list[~azure.mgmt.compute.v2021_07_01.models.RunCommandInputParameter] + :param protected_parameters: The parameters used by the script. + :type protected_parameters: + list[~azure.mgmt.compute.v2021_07_01.models.RunCommandInputParameter] + :param async_execution: Optional. If set to true, provisioning will complete as soon as the + script starts and will not wait for script to complete. + :type async_execution: bool + :param run_as_user: Specifies the user account on the VM when executing the run command. + :type run_as_user: str + :param run_as_password: Specifies the user account password on the VM when executing the run + command. + :type run_as_password: str + :param timeout_in_seconds: The timeout in seconds to execute the run command. + :type timeout_in_seconds: int + :param output_blob_uri: Specifies the Azure storage blob where script output stream will be + uploaded. + :type output_blob_uri: str + :param error_blob_uri: Specifies the Azure storage blob where script error stream will be + uploaded. + :type error_blob_uri: str + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine run command instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandInstanceView + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'VirtualMachineRunCommandScriptSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '[RunCommandInputParameter]'}, + 'protected_parameters': {'key': 'properties.protectedParameters', 'type': '[RunCommandInputParameter]'}, + 'async_execution': {'key': 'properties.asyncExecution', 'type': 'bool'}, + 'run_as_user': {'key': 'properties.runAsUser', 'type': 'str'}, + 'run_as_password': {'key': 'properties.runAsPassword', 'type': 'str'}, + 'timeout_in_seconds': {'key': 'properties.timeoutInSeconds', 'type': 'int'}, + 'output_blob_uri': {'key': 'properties.outputBlobUri', 'type': 'str'}, + 'error_blob_uri': {'key': 'properties.errorBlobUri', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineRunCommandInstanceView'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + source: Optional["VirtualMachineRunCommandScriptSource"] = None, + parameters: Optional[List["RunCommandInputParameter"]] = None, + protected_parameters: Optional[List["RunCommandInputParameter"]] = None, + async_execution: Optional[bool] = False, + run_as_user: Optional[str] = None, + run_as_password: Optional[str] = None, + timeout_in_seconds: Optional[int] = None, + output_blob_uri: Optional[str] = None, + error_blob_uri: Optional[str] = None, + **kwargs + ): + super(VirtualMachineRunCommandUpdate, self).__init__(tags=tags, **kwargs) + self.source = source + self.parameters = parameters + self.protected_parameters = protected_parameters + self.async_execution = async_execution + self.run_as_user = run_as_user + self.run_as_password = run_as_password + self.timeout_in_seconds = timeout_in_seconds + self.output_blob_uri = output_blob_uri + self.error_blob_uri = error_blob_uri + self.provisioning_state = None + self.instance_view = 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.v2021_07_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.v2021_07_01.models.Plan + :param identity: The identity of the virtual machine scale set, if configured. + :type identity: ~azure.mgmt.compute.v2021_07_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 extended_location: The extended location of the Virtual Machine Scale Set. + :type extended_location: ~azure.mgmt.compute.v2021_07_01.models.ExtendedLocation + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2021_07_01.models.UpgradePolicy + :param automatic_repairs_policy: Policy for automatic repairs. + :type automatic_repairs_policy: ~azure.mgmt.compute.v2021_07_01.models.AutomaticRepairsPolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2021_07_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. zoneBalance property can only be set if the zones property of the + scale set contains more than one zone. If there are no zones or only one zone specified, then + zoneBalance property should not be set. + :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.v2021_07_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.v2021_07_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.v2021_07_01.models.AdditionalCapabilities + :param scale_in_policy: Specifies the policies applied when scaling in Virtual Machines in the + Virtual Machine Scale Set. + :type scale_in_policy: ~azure.mgmt.compute.v2021_07_01.models.ScaleInPolicy + :param orchestration_mode: Specifies the orchestration mode for the virtual machine scale set. + Possible values include: "Uniform", "Flexible". + :type orchestration_mode: str or ~azure.mgmt.compute.v2021_07_01.models.OrchestrationMode + :param spot_restore_policy: Specifies the Spot Restore properties for the virtual machine scale + set. + :type spot_restore_policy: ~azure.mgmt.compute.v2021_07_01.models.SpotRestorePolicy + """ + + _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]'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + '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'}, + 'orchestration_mode': {'key': 'properties.orchestrationMode', 'type': 'str'}, + 'spot_restore_policy': {'key': 'properties.spotRestorePolicy', 'type': 'SpotRestorePolicy'}, + } + + 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, + extended_location: Optional["ExtendedLocation"] = 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, + orchestration_mode: Optional[Union[str, "OrchestrationMode"]] = None, + spot_restore_policy: Optional["SpotRestorePolicy"] = None, + **kwargs + ): + super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.plan = plan + self.identity = identity + self.zones = zones + self.extended_location = extended_location + 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 + self.orchestration_mode = orchestration_mode + self.spot_restore_policy = spot_restore_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.v2021_07_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.v2021_07_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.v2021_07_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: any + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: any + :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] + :param suppress_failures: Indicates whether failures stemming from the extension will be + suppressed (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :type suppress_failures: bool + """ + + _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]'}, + 'suppress_failures': {'key': 'properties.suppressFailures', 'type': 'bool'}, + } + + 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[Any] = None, + protected_settings: Optional[Any] = None, + provision_after_extensions: Optional[List[str]] = None, + suppress_failures: Optional[bool] = 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 + self.suppress_failures = suppress_failures + + +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.v2021_07_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.v2021_07_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: any + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: any + :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] + :param suppress_failures: Indicates whether failures stemming from the extension will be + suppressed (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :type suppress_failures: bool + """ + + _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]'}, + 'suppress_failures': {'key': 'properties.suppressFailures', 'type': 'bool'}, + } + + 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[Any] = None, + protected_settings: Optional[Any] = None, + provision_after_extensions: Optional[List[str]] = None, + suppress_failures: Optional[bool] = 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 + self.suppress_failures = suppress_failures + + +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.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] + """ + + _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': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue"]] = 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 VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + 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(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = 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.v2021_07_01.models.VirtualMachineScaleSetInstanceViewStatusesSummary + :ivar extensions: The extensions information. + :vartype extensions: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetVMExtensionsSummary] + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_01.models.InstanceViewStatus] + :ivar orchestration_services: The orchestration services information. + :vartype orchestration_services: + list[~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.SubResource] + :param application_security_groups: Specifies an array of references to application security + group. + :type application_security_groups: list[~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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", "Premium_ZRS", + "StandardSSD_ZRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.DiskEncryptionSetParameters + """ + + _attribute_map = { + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'disk_encryption_set': {'key': 'diskEncryptionSet', 'type': 'DiskEncryptionSetParameters'}, + } + + def __init__( + self, + *, + storage_account_type: Optional[Union[str, "StorageAccountTypes"]] = None, + disk_encryption_set: Optional["DiskEncryptionSetParameters"] = 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 enable_fpga: Specifies whether the network interface is FPGA networking-enabled. + :type enable_fpga: bool + :param network_security_group: The network security group. + :type network_security_group: ~azure.mgmt.compute.v2021_07_01.models.SubResource + :param dns_settings: The dns settings to be applied on the network interfaces. + :type dns_settings: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :param ip_configurations: Specifies the IP configurations of the network interface. + :type ip_configurations: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetIPConfiguration] + :param enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :type enable_ip_forwarding: bool + :param delete_option: Specify what happens to the network interface when the VM is deleted. + Possible values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + """ + + _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'}, + 'enable_fpga': {'key': 'properties.enableFpga', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + id: Optional[str] = None, + primary: Optional[bool] = None, + enable_accelerated_networking: Optional[bool] = None, + enable_fpga: Optional[bool] = None, + network_security_group: Optional["SubResource"] = None, + dns_settings: Optional["VirtualMachineScaleSetNetworkConfigurationDnsSettings"] = None, + ip_configurations: Optional[List["VirtualMachineScaleSetIPConfiguration"]] = None, + enable_ip_forwarding: Optional[bool] = None, + delete_option: Optional[Union[str, "DeleteOptions"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.enable_fpga = enable_fpga + self.network_security_group = network_security_group + self.dns_settings = dns_settings + self.ip_configurations = ip_configurations + self.enable_ip_forwarding = enable_ip_forwarding + self.delete_option = delete_option + + +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.v2021_07_01.models.ApiEntityReference + :param network_interface_configurations: The list of network configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetNetworkConfiguration] + :param network_api_version: specifies the Microsoft.Network API version used when creating + networking resources in the Network Interface Configurations for Virtual Machine Scale Set with + orchestration mode 'Flexible'. Possible values include: "2020-11-01". + :type network_api_version: str or ~azure.mgmt.compute.v2021_07_01.models.NetworkApiVersion + """ + + _attribute_map = { + 'health_probe': {'key': 'healthProbe', 'type': 'ApiEntityReference'}, + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, + 'network_api_version': {'key': 'networkApiVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + health_probe: Optional["ApiEntityReference"] = None, + network_interface_configurations: Optional[List["VirtualMachineScaleSetNetworkConfiguration"]] = None, + network_api_version: Optional[Union[str, "NetworkApiVersion"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetNetworkProfile, self).__init__(**kwargs) + self.health_probe = health_probe + self.network_interface_configurations = network_interface_configurations + self.network_api_version = network_api_version + + +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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.OperatingSystemTypes + :param image: Specifies information about the unmanaged user image to base the scale set on. + :type image: ~azure.mgmt.compute.v2021_07_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.v2021_07_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. + :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.v2021_07_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 + `_. + :type linux_configuration: ~azure.mgmt.compute.v2021_07_01.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed onto the virtual + machines in the scale set. To install certificates on a virtual machine it is recommended to + use the `Azure Key Vault virtual machine extension for Linux + `_ or the `Azure + Key Vault virtual machine extension for Windows + `_. + :type secrets: list[~azure.mgmt.compute.v2021_07_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 sku: Describes the public IP Sku. + :type sku: ~azure.mgmt.compute.v2021_07_01.models.PublicIPAddressSku + :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.v2021_07_01.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + :param ip_tags: The list of IP tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetIpTag] + :param public_ip_prefix: The PublicIPPrefix from which to allocate publicIP addresses. + :type public_ip_prefix: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.IPVersion + :param delete_option: Specify what happens to the public IP when the VM is deleted. Possible + values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, + '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'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + sku: Optional["PublicIPAddressSku"] = None, + 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, + delete_option: Optional[Union[str, "DeleteOptions"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetPublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = name + self.sku = sku + 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 + self.delete_option = delete_option + + +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 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 VirtualMachineScaleSetReimageParameters(VirtualMachineScaleSetVMReimageParameters): + """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.v2021_07_01.models.Sku + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.Sku + :param plan: The purchase plan when deploying a virtual machine scale set from VM Marketplace + images. + :type plan: ~azure.mgmt.compute.v2021_07_01.models.Plan + :param identity: The identity of the virtual machine scale set, if configured. + :type identity: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetIdentity + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2021_07_01.models.UpgradePolicy + :param automatic_repairs_policy: Policy for automatic repairs. + :type automatic_repairs_policy: ~azure.mgmt.compute.v2021_07_01.models.AutomaticRepairsPolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.AdditionalCapabilities + :param scale_in_policy: Specifies the policies applied when scaling in Virtual Machines in the + Virtual Machine Scale Set. + :type scale_in_policy: ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.SubResource] + :param application_security_groups: Specifies an array of references to application security + group. + :type application_security_groups: list[~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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 enable_fpga: Specifies whether the network interface is FPGA networking-enabled. + :type enable_fpga: bool + :param network_security_group: The network security group. + :type network_security_group: ~azure.mgmt.compute.v2021_07_01.models.SubResource + :param dns_settings: The dns settings to be applied on the network interfaces. + :type dns_settings: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :param ip_configurations: The virtual machine scale set IP Configuration. + :type ip_configurations: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetUpdateIPConfiguration] + :param enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :type enable_ip_forwarding: bool + :param delete_option: Specify what happens to the network interface when the VM is deleted. + Possible values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + """ + + _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'}, + 'enable_fpga': {'key': 'properties.enableFpga', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetUpdateIPConfiguration]'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + primary: Optional[bool] = None, + enable_accelerated_networking: Optional[bool] = None, + enable_fpga: Optional[bool] = None, + network_security_group: Optional["SubResource"] = None, + dns_settings: Optional["VirtualMachineScaleSetNetworkConfigurationDnsSettings"] = None, + ip_configurations: Optional[List["VirtualMachineScaleSetUpdateIPConfiguration"]] = None, + enable_ip_forwarding: Optional[bool] = None, + delete_option: Optional[Union[str, "DeleteOptions"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetUpdateNetworkConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.enable_fpga = enable_fpga + self.network_security_group = network_security_group + self.dns_settings = dns_settings + self.ip_configurations = ip_configurations + self.enable_ip_forwarding = enable_ip_forwarding + self.delete_option = delete_option + + +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.v2021_07_01.models.ApiEntityReference + :param network_interface_configurations: The list of network configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetUpdateNetworkConfiguration] + :param network_api_version: specifies the Microsoft.Network API version used when creating + networking resources in the Network Interface Configurations for Virtual Machine Scale Set with + orchestration mode 'Flexible'. Possible values include: "2020-11-01". + :type network_api_version: str or ~azure.mgmt.compute.v2021_07_01.models.NetworkApiVersion + """ + + _attribute_map = { + 'health_probe': {'key': 'healthProbe', 'type': 'ApiEntityReference'}, + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetUpdateNetworkConfiguration]'}, + 'network_api_version': {'key': 'networkApiVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + health_probe: Optional["ApiEntityReference"] = None, + network_interface_configurations: Optional[List["VirtualMachineScaleSetUpdateNetworkConfiguration"]] = None, + network_api_version: Optional[Union[str, "NetworkApiVersion"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetUpdateNetworkProfile, self).__init__(**kwargs) + self.health_probe = health_probe + self.network_interface_configurations = network_interface_configurations + self.network_api_version = network_api_version + + +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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.WindowsConfiguration + :param linux_configuration: The Linux Configuration of the OS profile. + :type linux_configuration: ~azure.mgmt.compute.v2021_07_01.models.LinuxConfiguration + :param secrets: The List of certificates for addition to the VM. + :type secrets: list[~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + :param delete_option: Specify what happens to the public IP when the VM is deleted. Possible + values include: "Delete", "Detach". + :type delete_option: str or ~azure.mgmt.compute.v2021_07_01.models.DeleteOptions + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, + 'delete_option': {'key': 'properties.deleteOption', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + idle_timeout_in_minutes: Optional[int] = None, + dns_settings: Optional["VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings"] = None, + delete_option: Optional[Union[str, "DeleteOptions"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = name + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.dns_settings = dns_settings + self.delete_option = delete_option + + +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.v2021_07_01.models.ImageReference + :param os_disk: The OS disk. + :type os_disk: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetUpdateOSDisk + :param data_disks: The data disks. + :type data_disks: list[~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetUpdateOSProfile + :param storage_profile: The virtual machine scale set storage profile. + :type storage_profile: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetUpdateStorageProfile + :param network_profile: The virtual machine scale set network profile. + :type network_profile: + ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetUpdateNetworkProfile + :param security_profile: The virtual machine scale set Security profile. + :type security_profile: ~azure.mgmt.compute.v2021_07_01.models.SecurityProfile + :param diagnostics_profile: The virtual machine scale set diagnostics profile. + :type diagnostics_profile: ~azure.mgmt.compute.v2021_07_01.models.DiagnosticsProfile + :param extension_profile: The virtual machine scale set extension profile. + :type extension_profile: + ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.BillingProfile + :param scheduled_events_profile: Specifies Scheduled Event related configurations. + :type scheduled_events_profile: ~azure.mgmt.compute.v2021_07_01.models.ScheduledEventsProfile + :param user_data: UserData for the VM, which must be base-64 encoded. Customer should not pass + any secrets in here. :code:`
    `:code:`
    `Minimum api-version: 2021-03-01. + :type user_data: str + """ + + _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'}, + 'user_data': {'key': 'userData', 'type': 'str'}, + } + + 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, + user_data: Optional[str] = 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 + self.user_data = user_data + + +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.v2021_07_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.v2021_07_01.models.Plan + :ivar resources: The virtual machine child extension resources. + :vartype resources: list[~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetVMInstanceView + :param hardware_profile: Specifies the hardware settings for the virtual machine. + :type hardware_profile: ~azure.mgmt.compute.v2021_07_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.AdditionalCapabilities + :param os_profile: Specifies the operating system settings for the virtual machine. + :type os_profile: ~azure.mgmt.compute.v2021_07_01.models.OSProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machine. + :type security_profile: ~azure.mgmt.compute.v2021_07_01.models.SecurityProfile + :param network_profile: Specifies the network interfaces of the virtual machine. + :type network_profile: ~azure.mgmt.compute.v2021_07_01.models.NetworkProfile + :param network_profile_configuration: Specifies the network profile configuration of the + virtual machine. + :type network_profile_configuration: + ~azure.mgmt.compute.v2021_07_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.v2021_07_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 `Availability sets overview + `_. + :code:`
    `:code:`
    ` For more information on Azure planned maintenance, see `Maintenance + and updates 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.v2021_07_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. :code:`
    `:code:`
    ` Possible values for Windows Server operating system are: + :code:`
    `:code:`
    ` Windows_Client :code:`
    `:code:`
    ` Windows_Server + :code:`
    `:code:`
    ` Possible values for Linux Server operating system are: + :code:`
    `:code:`
    ` RHEL_BYOS (for RHEL) :code:`
    `:code:`
    ` SLES_BYOS (for SUSE) + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ + :code:`
    `:code:`
    ` `Azure Hybrid Use Benefit for Linux 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.v2021_07_01.models.VirtualMachineScaleSetVMProtectionPolicy + :param user_data: UserData for the VM, which must be base-64 encoded. Customer should not pass + any secrets in here. :code:`
    `:code:`
    `Minimum api-version: 2021-03-01. + :type user_data: str + """ + + _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'}, + 'user_data': {'key': 'properties.userData', 'type': 'str'}, + } + + 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, + user_data: Optional[str] = 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 + self.user_data = user_data + + +class VirtualMachineScaleSetVMExtension(SubResourceReadOnly): + """Describes a VMSS VM 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: 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: any + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: any + :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.v2021_07_01.models.VirtualMachineExtensionInstanceView + :param suppress_failures: Indicates whether failures stemming from the extension will be + suppressed (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :type suppress_failures: bool + """ + + _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'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, + 'suppress_failures': {'key': 'properties.suppressFailures', 'type': 'bool'}, + } + + 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[Any] = None, + protected_settings: Optional[Any] = None, + instance_view: Optional["VirtualMachineExtensionInstanceView"] = None, + suppress_failures: Optional[bool] = None, + **kwargs + ): + super(VirtualMachineScaleSetVMExtension, 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.instance_view = instance_view + self.suppress_failures = suppress_failures + + +class VirtualMachineScaleSetVMExtensionsListResult(msrest.serialization.Model): + """The List VMSS VM Extension operation response. + + :param value: The list of VMSS VM extensions. + :type value: list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetVMExtension] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSetVMExtension]'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualMachineScaleSetVMExtension"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetVMExtensionsListResult, self).__init__(**kwargs) + self.value = value + + +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.v2021_07_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 VirtualMachineScaleSetVMExtensionUpdate(SubResourceReadOnly): + """Describes a VMSS VM 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: 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: any + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: any + :param suppress_failures: Indicates whether failures stemming from the extension will be + suppressed (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :type suppress_failures: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + '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'}, + 'suppress_failures': {'key': 'properties.suppressFailures', 'type': 'bool'}, + } + + 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[Any] = None, + protected_settings: Optional[Any] = None, + suppress_failures: Optional[bool] = None, + **kwargs + ): + super(VirtualMachineScaleSetVMExtensionUpdate, 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.suppress_failures = suppress_failures + + +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.v2021_07_01.models.VirtualMachineAgentInstanceView + :param maintenance_redeploy_status: The Maintenance Operation status on the virtual machine. + :type maintenance_redeploy_status: + ~azure.mgmt.compute.v2021_07_01.models.MaintenanceRedeployStatus + :param disks: The disks information. + :type disks: list[~azure.mgmt.compute.v2021_07_01.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineExtensionInstanceView] + :ivar vm_health: The health status for the VM. + :vartype vm_health: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetOSProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.VirtualMachineScaleSetExtensionProfile + :param license_type: Specifies that the image or disk that is being used was licensed + on-premises. :code:`
    `:code:`
    ` Possible values for Windows Server operating system are: + :code:`
    `:code:`
    ` Windows_Client :code:`
    `:code:`
    ` Windows_Server + :code:`
    `:code:`
    ` Possible values for Linux Server operating system are: + :code:`
    `:code:`
    ` RHEL_BYOS (for RHEL) :code:`
    `:code:`
    ` SLES_BYOS (for SUSE) + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ + :code:`
    `:code:`
    ` `Azure Hybrid Use Benefit for Linux 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.v2021_07_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.v2021_07_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.v2021_07_01.models.BillingProfile + :param scheduled_events_profile: Specifies Scheduled Event related configurations. + :type scheduled_events_profile: ~azure.mgmt.compute.v2021_07_01.models.ScheduledEventsProfile + :param user_data: UserData for the virtual machines in the scale set, which must be base-64 + encoded. Customer should not pass any secrets in here. :code:`
    `:code:`
    `Minimum + api-version: 2021-03-01. + :type user_data: str + :param capacity_reservation: Specifies the capacity reservation related details of a scale set. + :code:`
    `:code:`
    `Minimum api-version: 2021-04-01. + :type capacity_reservation: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationProfile + :param application_profile: Specifies the gallery applications that should be made available to + the VM/VMSS. + :type application_profile: ~azure.mgmt.compute.v2021_07_01.models.ApplicationProfile + """ + + _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'}, + 'user_data': {'key': 'userData', 'type': 'str'}, + 'capacity_reservation': {'key': 'capacityReservation', 'type': 'CapacityReservationProfile'}, + 'application_profile': {'key': 'applicationProfile', 'type': 'ApplicationProfile'}, + } + + 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, + user_data: Optional[str] = None, + capacity_reservation: Optional["CapacityReservationProfile"] = None, + application_profile: Optional["ApplicationProfile"] = 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 + self.user_data = user_data + self.capacity_reservation = capacity_reservation + self.application_profile = application_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 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. For + Constrained vCPU capable VM sizes, this number represents the total vCPUs of quota that the VM + uses. For accurate vCPU count, please refer to + https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or + https://docs.microsoft.com/rest/api/compute/resourceskus/list. + :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.v2021_07_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 kb_id: The KBID of the patch. Only applies to Windows patches. + :vartype kb_id: 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: + "Unknown", "NeverReboots", "AlwaysRequiresReboot", "CanRequestReboot". + :vartype reboot_behavior: str or + ~azure.mgmt.compute.v2021_07_01.models.VMGuestPatchRebootBehavior + :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 availability of a given patch. Possible values include: + "Unknown", "Available". + :vartype assessment_state: str or ~azure.mgmt.compute.v2021_07_01.models.PatchAssessmentState + """ + + _validation = { + 'patch_id': {'readonly': True}, + 'name': {'readonly': True}, + 'version': {'readonly': True}, + 'kb_id': {'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'}, + 'kb_id': {'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.kb_id = 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.v2021_07_01.models.Plan + :param identity: The identity of the virtual machine, if configured. + :type identity: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual machine disks. + :type storage_profile: ~azure.mgmt.compute.v2021_07_01.models.StorageProfile + :param additional_capabilities: Specifies additional capabilities enabled or disabled on the + virtual machine. + :type additional_capabilities: ~azure.mgmt.compute.v2021_07_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.v2021_07_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual machine. + :type network_profile: ~azure.mgmt.compute.v2021_07_01.models.NetworkProfile + :param security_profile: Specifies the Security related profile settings for the virtual + machine. + :type security_profile: ~azure.mgmt.compute.v2021_07_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.v2021_07_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 `Availability sets overview + `_. + :code:`
    `:code:`
    ` For more information on Azure planned maintenance, see `Maintenance + and updates 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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_01.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used was licensed + on-premises. :code:`
    `:code:`
    ` Possible values for Windows Server operating system are: + :code:`
    `:code:`
    ` Windows_Client :code:`
    `:code:`
    ` Windows_Server + :code:`
    `:code:`
    ` Possible values for Linux Server operating system are: + :code:`
    `:code:`
    ` RHEL_BYOS (for RHEL) :code:`
    `:code:`
    ` SLES_BYOS (for SUSE) + :code:`
    `:code:`
    ` For more information, see `Azure Hybrid Use Benefit for Windows Server + `_ + :code:`
    `:code:`
    ` `Azure Hybrid Use Benefit for Linux 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 + :param platform_fault_domain: Specifies the scale set logical fault domain into which the + Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned + to a fault domain that best maintains balance across available fault + domains.:code:`
    `:code:`
  • `This is applicable only if the 'virtualMachineScaleSet' + property of this Virtual Machine is set.:code:`
  • `The Virtual Machine Scale Set that is + referenced, must have 'platformFaultDomainCount' > 1.:code:`
  • `This property cannot be + updated once the Virtual Machine is created.:code:`
  • `Fault domain assignment can be viewed + in the Virtual Machine Instance View.:code:`
    `:code:`
    `Minimum api‐version: 2020‐12‐01. + :type platform_fault_domain: int + :param scheduled_events_profile: Specifies Scheduled Event related configurations. + :type scheduled_events_profile: ~azure.mgmt.compute.v2021_07_01.models.ScheduledEventsProfile + :param user_data: UserData for the VM, which must be base-64 encoded. Customer should not pass + any secrets in here. :code:`
    `:code:`
    `Minimum api-version: 2021-03-01. + :type user_data: str + :param capacity_reservation: Specifies information about the capacity reservation that is used + to allocate virtual machine. :code:`
    `:code:`
    `Minimum api-version: 2021-04-01. + :type capacity_reservation: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationProfile + :param application_profile: Specifies the gallery applications that should be made available to + the VM/VMSS. + :type application_profile: ~azure.mgmt.compute.v2021_07_01.models.ApplicationProfile + """ + + _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'}, + 'platform_fault_domain': {'key': 'properties.platformFaultDomain', 'type': 'int'}, + 'scheduled_events_profile': {'key': 'properties.scheduledEventsProfile', 'type': 'ScheduledEventsProfile'}, + 'user_data': {'key': 'properties.userData', 'type': 'str'}, + 'capacity_reservation': {'key': 'properties.capacityReservation', 'type': 'CapacityReservationProfile'}, + 'application_profile': {'key': 'properties.applicationProfile', 'type': 'ApplicationProfile'}, + } + + 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, + platform_fault_domain: Optional[int] = None, + scheduled_events_profile: Optional["ScheduledEventsProfile"] = None, + user_data: Optional[str] = None, + capacity_reservation: Optional["CapacityReservationProfile"] = None, + application_profile: Optional["ApplicationProfile"] = 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 + self.platform_fault_domain = platform_fault_domain + self.scheduled_events_profile = scheduled_events_profile + self.user_data = user_data + self.capacity_reservation = capacity_reservation + self.application_profile = application_profile + + +class VMGalleryApplication(msrest.serialization.Model): + """Specifies the required information to reference a compute gallery application version. + + All required parameters must be populated in order to send to Azure. + + :param tags: A set of tags. Optional, Specifies a passthrough value for more generic context. + :type tags: str + :param order: Optional, Specifies the order in which the packages have to be installed. + :type order: int + :param package_reference_id: Required. Specifies the GalleryApplicationVersion resource id on + the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}. + :type package_reference_id: str + :param configuration_reference: Optional, Specifies the uri to an azure blob that will replace + the default configuration for the package if provided. + :type configuration_reference: str + """ + + _validation = { + 'package_reference_id': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'package_reference_id': {'key': 'packageReferenceId', 'type': 'str'}, + 'configuration_reference': {'key': 'configurationReference', 'type': 'str'}, + } + + def __init__( + self, + *, + package_reference_id: str, + tags: Optional[str] = None, + order: Optional[int] = None, + configuration_reference: Optional[str] = None, + **kwargs + ): + super(VMGalleryApplication, self).__init__(**kwargs) + self.tags = tags + self.order = order + self.package_reference_id = package_reference_id + self.configuration_reference = configuration_reference + + +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 VMSizeProperties(msrest.serialization.Model): + """Specifies VM Size Property settings on the virtual machine. + + :param v_cpus_available: Specifies the number of vCPUs available for the VM. + :code:`
    `:code:`
    ` When this property is not specified in the request body the default + behavior is to set it to the value of vCPUs available for that VM size exposed in api response + of `List all available virtual machine sizes in a region + `_ . + :type v_cpus_available: int + :param v_cpus_per_core: Specifies the vCPU to physical core ratio. :code:`
    `:code:`
    ` + When this property is not specified in the request body the default behavior is set to the + value of vCPUsPerCore for the VM Size exposed in api response of `List all available virtual + machine sizes in a region + `_ + :code:`
    `:code:`
    ` Setting this property to 1 also means that hyper-threading is + disabled. + :type v_cpus_per_core: int + """ + + _attribute_map = { + 'v_cpus_available': {'key': 'vCPUsAvailable', 'type': 'int'}, + 'v_cpus_per_core': {'key': 'vCPUsPerCore', 'type': 'int'}, + } + + def __init__( + self, + *, + v_cpus_available: Optional[int] = None, + v_cpus_per_core: Optional[int] = None, + **kwargs + ): + super(VMSizeProperties, self).__init__(**kwargs) + self.v_cpus_available = v_cpus_available + self.v_cpus_per_core = v_cpus_per_core + + +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.v2021_07_01.models.AdditionalUnattendContent] + :param patch_settings: [Preview Feature] Specifies settings related to VM Guest Patching on + Windows. + :type patch_settings: ~azure.mgmt.compute.v2021_07_01.models.PatchSettings + :param win_rm: Specifies the Windows Remote Management listeners. This enables remote Windows + PowerShell. + :type win_rm: ~azure.mgmt.compute.v2021_07_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 WindowsParameters(msrest.serialization.Model): + """Input for InstallPatches on a Windows VM, as directly received by the API. + + :param classifications_to_include: The update classifications to select when installing patches + for Windows. + :type classifications_to_include: list[str or + ~azure.mgmt.compute.v2021_07_01.models.VMGuestPatchClassificationWindows] + :param kb_numbers_to_include: Kbs to include in the patch operation. + :type kb_numbers_to_include: list[str] + :param kb_numbers_to_exclude: Kbs to exclude in the patch operation. + :type kb_numbers_to_exclude: list[str] + :param exclude_kbs_requiring_reboot: Filters out Kbs that don't have an + InstallationRebootBehavior of 'NeverReboots' when this is set to true. + :type exclude_kbs_requiring_reboot: bool + :param max_patch_publish_date: This is used to install patches that were published on or before + this given max published date. + :type max_patch_publish_date: ~datetime.datetime + """ + + _attribute_map = { + 'classifications_to_include': {'key': 'classificationsToInclude', 'type': '[str]'}, + 'kb_numbers_to_include': {'key': 'kbNumbersToInclude', 'type': '[str]'}, + 'kb_numbers_to_exclude': {'key': 'kbNumbersToExclude', 'type': '[str]'}, + 'exclude_kbs_requiring_reboot': {'key': 'excludeKbsRequiringReboot', 'type': 'bool'}, + 'max_patch_publish_date': {'key': 'maxPatchPublishDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + classifications_to_include: Optional[List[Union[str, "VMGuestPatchClassificationWindows"]]] = None, + kb_numbers_to_include: Optional[List[str]] = None, + kb_numbers_to_exclude: Optional[List[str]] = None, + exclude_kbs_requiring_reboot: Optional[bool] = None, + max_patch_publish_date: Optional[datetime.datetime] = None, + **kwargs + ): + super(WindowsParameters, self).__init__(**kwargs) + self.classifications_to_include = classifications_to_include + self.kb_numbers_to_include = kb_numbers_to_include + self.kb_numbers_to_exclude = kb_numbers_to_exclude + self.exclude_kbs_requiring_reboot = exclude_kbs_requiring_reboot + self.max_patch_publish_date = max_patch_publish_date + + +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.v2021_07_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.v2021_07_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:`
    `} :code:`
    ` To install certificates on a + virtual machine it is recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ or the + `Azure Key Vault virtual machine extension for Windows + `_. + :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/v2021_07_01/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/__init__.py new file mode 100644 index 000000000000..af63734f01ef --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/__init__.py @@ -0,0 +1,83 @@ +# 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 ._virtual_machine_images_edge_zone_operations import VirtualMachineImagesEdgeZoneOperations +from ._usage_operations import UsageOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_scale_sets_operations import VirtualMachineScaleSetsOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._images_operations import ImagesOperations +from ._restore_point_collections_operations import RestorePointCollectionsOperations +from ._restore_points_operations import RestorePointsOperations +from ._capacity_reservation_groups_operations import CapacityReservationGroupsOperations +from ._capacity_reservations_operations import CapacityReservationsOperations +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 ._virtual_machine_scale_set_vm_run_commands_operations import VirtualMachineScaleSetVMRunCommandsOperations +from ._resource_skus_operations import ResourceSkusOperations +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 ._gallery_sharing_profile_operations import GallerySharingProfileOperations +from ._shared_galleries_operations import SharedGalleriesOperations +from ._shared_gallery_images_operations import SharedGalleryImagesOperations +from ._shared_gallery_image_versions_operations import SharedGalleryImageVersionsOperations + +__all__ = [ + 'Operations', + 'AvailabilitySetsOperations', + 'ProximityPlacementGroupsOperations', + 'DedicatedHostGroupsOperations', + 'DedicatedHostsOperations', + 'SshPublicKeysOperations', + 'VirtualMachineExtensionImagesOperations', + 'VirtualMachineExtensionsOperations', + 'VirtualMachineImagesOperations', + 'VirtualMachineImagesEdgeZoneOperations', + 'UsageOperations', + 'VirtualMachinesOperations', + 'VirtualMachineScaleSetsOperations', + 'VirtualMachineSizesOperations', + 'ImagesOperations', + 'RestorePointCollectionsOperations', + 'RestorePointsOperations', + 'CapacityReservationGroupsOperations', + 'CapacityReservationsOperations', + 'VirtualMachineScaleSetExtensionsOperations', + 'VirtualMachineScaleSetRollingUpgradesOperations', + 'VirtualMachineScaleSetVMExtensionsOperations', + 'VirtualMachineScaleSetVMsOperations', + 'LogAnalyticsOperations', + 'VirtualMachineRunCommandsOperations', + 'VirtualMachineScaleSetVMRunCommandsOperations', + 'ResourceSkusOperations', + 'GalleriesOperations', + 'GalleryImagesOperations', + 'GalleryImageVersionsOperations', + 'GalleryApplicationsOperations', + 'GalleryApplicationVersionsOperations', + 'GallerySharingProfileOperations', + 'SharedGalleriesOperations', + 'SharedGalleryImagesOperations', + 'SharedGalleryImageVersionsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_availability_sets_operations.py new file mode 100644 index 000000000000..f8785d221e70 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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.v2021_07_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.v2021_07_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 = "2021-07-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.v2021_07_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.v2021_07_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 = "2021-07-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 = "2021-07-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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-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 + 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.v2021_07_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 = "2021-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 + 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.v2021_07_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 = "2021-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 + 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/v2021_07_01/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservation_groups_operations.py new file mode 100644 index 000000000000..74de4b67fd15 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservation_groups_operations.py @@ -0,0 +1,467 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CapacityReservationGroupsOperations(object): + """CapacityReservationGroupsOperations 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.v2021_07_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 + capacity_reservation_group_name, # type: str + parameters, # type: "_models.CapacityReservationGroup" + **kwargs # type: Any + ): + # type: (...) -> "_models.CapacityReservationGroup" + """The operation to create or update a capacity reservation group. When updating a capacity + reservation group, only tags may be modified. Please refer to + https://aka.ms/CapacityReservation for more details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param parameters: Parameters supplied to the Create capacity reservation Group. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CapacityReservationGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_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, 'CapacityReservationGroup') + 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('CapacityReservationGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + capacity_reservation_group_name, # type: str + parameters, # type: "_models.CapacityReservationGroupUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.CapacityReservationGroup" + """The operation to update a capacity reservation group. When updating a capacity reservation + group, only tags may be modified. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param parameters: Parameters supplied to the Update capacity reservation Group operation. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroupUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CapacityReservationGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_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, 'CapacityReservationGroupUpdate') + 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('CapacityReservationGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + capacity_reservation_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """The operation to delete a capacity reservation group. This operation is allowed only if all the + associated resources are disassociated from the reservation group and all capacity reservations + under the reservation group have also been deleted. Please refer to + https://aka.ms/CapacityReservation for more details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_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 = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_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['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, 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/capacityReservationGroups/{capacityReservationGroupName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + capacity_reservation_group_name, # type: str + expand=None, # type: Optional[Union[str, "_models.CapacityReservationGroupInstanceViewTypes"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.CapacityReservationGroup" + """The operation that retrieves information about a capacity reservation group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param expand: The expand expression to apply on the operation. 'InstanceView' will retrieve + the list of instance views of the capacity reservations under the capacity reservation group + which is a snapshot of the runtime properties of a capacity reservation that is managed by the + platform and can change outside of control plane operations. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroupInstanceViewTypes + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CapacityReservationGroup, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_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('CapacityReservationGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + expand=None, # type: Optional[Union[str, "_models.ExpandTypesForGetCapacityReservationGroups"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CapacityReservationGroupListResult"] + """Lists all of the capacity reservation groups in the specified resource group. Use the nextLink + property in the response to get the next page of capacity reservation groups. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param expand: The expand expression to apply on the operation. Based on the expand param(s) + specified we return Virtual Machine or ScaleSet VM Instance or both resource Ids which are + associated to capacity reservation group in the response. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.ExpandTypesForGetCapacityReservationGroups + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CapacityReservationGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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') + 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('CapacityReservationGroupListResult', 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/capacityReservationGroups'} # type: ignore + + def list_by_subscription( + self, + expand=None, # type: Optional[Union[str, "_models.ExpandTypesForGetCapacityReservationGroups"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CapacityReservationGroupListResult"] + """Lists all of the capacity reservation groups in the subscription. Use the nextLink property in + the response to get the next page of capacity reservation groups. + + :param expand: The expand expression to apply on the operation. Based on the expand param(s) + specified we return Virtual Machine or ScaleSet VM Instance or both resource Ids which are + associated to capacity reservation group in the response. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.ExpandTypesForGetCapacityReservationGroups + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CapacityReservationGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.CapacityReservationGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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('CapacityReservationGroupListResult', 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/capacityReservationGroups'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservations_operations.py new file mode 100644 index 000000000000..9ba716035455 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservations_operations.py @@ -0,0 +1,587 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CapacityReservationsOperations(object): + """CapacityReservationsOperations 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.v2021_07_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 + capacity_reservation_group_name, # type: str + capacity_reservation_name, # type: str + parameters, # type: "_models.CapacityReservation" + **kwargs # type: Any + ): + # type: (...) -> "_models.CapacityReservation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_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, 'CapacityReservation') + 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('CapacityReservation', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CapacityReservation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + capacity_reservation_group_name, # type: str + capacity_reservation_name, # type: str + parameters, # type: "_models.CapacityReservation" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.CapacityReservation"] + """The operation to create or update a capacity reservation. Please note some properties can be + set only during capacity reservation creation. Please refer to + https://aka.ms/CapacityReservation for more details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param capacity_reservation_name: The name of the capacity reservation. + :type capacity_reservation_name: str + :param parameters: Parameters supplied to the Create capacity reservation. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservation + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 CapacityReservation or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.CapacityReservation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservation"] + 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, + capacity_reservation_group_name=capacity_reservation_group_name, + capacity_reservation_name=capacity_reservation_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('CapacityReservation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + capacity_reservation_group_name, # type: str + capacity_reservation_name, # type: str + parameters, # type: "_models.CapacityReservationUpdate" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.CapacityReservation"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CapacityReservation"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_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, 'CapacityReservationUpdate') + 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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CapacityReservation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + capacity_reservation_group_name, # type: str + capacity_reservation_name, # type: str + parameters, # type: "_models.CapacityReservationUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.CapacityReservation"] + """The operation to update a capacity reservation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param capacity_reservation_name: The name of the capacity reservation. + :type capacity_reservation_name: str + :param parameters: Parameters supplied to the Update capacity reservation operation. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 CapacityReservation or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.CapacityReservation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservation"] + 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, + capacity_reservation_group_name=capacity_reservation_group_name, + capacity_reservation_name=capacity_reservation_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('CapacityReservation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + capacity_reservation_group_name, # type: str + capacity_reservation_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 = "2021-07-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'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_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/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + capacity_reservation_group_name, # type: str + capacity_reservation_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to delete a capacity reservation. This operation is allowed only when all the + associated resources are disassociated from the capacity reservation. Please refer to + https://aka.ms/CapacityReservation for more details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param capacity_reservation_name: The name of the capacity reservation. + :type capacity_reservation_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + capacity_reservation_group_name=capacity_reservation_group_name, + capacity_reservation_name=capacity_reservation_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + capacity_reservation_group_name, # type: str + capacity_reservation_name, # type: str + expand=None, # type: Optional[Union[str, "_models.CapacityReservationInstanceViewTypes"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.CapacityReservation" + """The operation that retrieves information about the capacity reservation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_group_name: str + :param capacity_reservation_name: The name of the capacity reservation. + :type capacity_reservation_name: str + :param expand: The expand expression to apply on the operation. 'InstanceView' retrieves a + snapshot of the runtime properties of the capacity reservation that is managed by the platform + and can change outside of control plane operations. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.CapacityReservationInstanceViewTypes + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CapacityReservation, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CapacityReservation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_group_name, 'str'), + 'capacityReservationName': self._serialize.url("capacity_reservation_name", capacity_reservation_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('CapacityReservation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}'} # type: ignore + + def list_by_capacity_reservation_group( + self, + resource_group_name, # type: str + capacity_reservation_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CapacityReservationListResult"] + """Lists all of the capacity reservations in the specified capacity reservation group. Use the + nextLink property in the response to get the next page of capacity reservations. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param capacity_reservation_group_name: The name of the capacity reservation group. + :type capacity_reservation_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 CapacityReservationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.CapacityReservationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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_capacity_reservation_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'capacityReservationGroupName': self._serialize.url("capacity_reservation_group_name", capacity_reservation_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('CapacityReservationListResult', 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_capacity_reservation_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_host_groups_operations.py new file mode 100644 index 000000000000..dccc95da7350 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_host_groups_operations.py @@ -0,0 +1,446 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, 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.v2021_07_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.v2021_07_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.v2021_07_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 = "2021-07-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.v2021_07_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.v2021_07_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 = "2021-07-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 = "2021-07-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=None, # type: Optional[Union[str, "_models.InstanceViewTypes"]] + **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. 'InstanceView' will retrieve + the list of instance views of the dedicated hosts under the dedicated host group. 'UserData' is + not supported for dedicated host group. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.InstanceViewTypes + :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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-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 + 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.v2021_07_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 = "2021-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 + 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/v2021_07_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_hosts_operations.py new file mode 100644 index 000000000000..1c9bac974eb7 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_hosts_operations.py @@ -0,0 +1,579 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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 = "2021-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 + 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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + host_group_name, # type: str + host_name, # type: str + expand=None, # type: Optional[Union[str, "_models.InstanceViewTypes"]] + **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. 'InstanceView' will retrieve + the list of instance views of the dedicated host. 'UserData' is not supported for dedicated + host. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.InstanceViewTypes + :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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-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 + 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/v2021_07_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_galleries_operations.py new file mode 100644 index 000000000000..e9c66691d7a3 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_galleries_operations.py @@ -0,0 +1,621 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GalleriesOperations(object): + """GalleriesOperations 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.v2021_07_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 + gallery_name, # type: str + gallery, # type: "_models.Gallery" + **kwargs # type: Any + ): + # type: (...) -> "_models.Gallery" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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(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 + + if response.status_code not in [200, 201, 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('Gallery', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Gallery', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery, # type: "_models.Gallery" + **kwargs # type: Any + ): + # 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. + :type gallery_name: str + :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. + :type gallery: ~azure.mgmt.compute.v2021_07_01.models.Gallery + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 Gallery or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.Gallery] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + 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, + gallery_name=gallery_name, + gallery=gallery, + 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('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery, # type: "_models.GalleryUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.Gallery" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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(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 + + 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('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery, # type: "_models.GalleryUpdate" + **kwargs # type: Any + ): + # 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. + :type gallery_name: str + :param gallery: Parameters supplied to the update Shared Image Gallery operation. + :type gallery: ~azure.mgmt.compute.v2021_07_01.models.GalleryUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 Gallery or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.Gallery] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + 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, + gallery_name=gallery_name, + gallery=gallery, + 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('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + gallery_name, # type: str + select=None, # type: Optional[Union[str, "_models.SelectPermissions"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.Gallery" + """Retrieves information about 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. + :type gallery_name: str + :param select: The select expression to apply on the operation. + :type select: str or ~azure.mgmt.compute.v2021_07_01.models.SelectPermissions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Gallery, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.Gallery + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, '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('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + gallery_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 = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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/galleries/{galleryName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + gallery_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete 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 to be deleted. + :type gallery_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + gallery_name=gallery_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GalleryList"] + """List galleries 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 GalleryList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.GalleryList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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('GalleryList', 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/galleries'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GalleryList"] + """List galleries 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 GalleryList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.GalleryList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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('GalleryList', 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/galleries'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_application_versions_operations.py new file mode 100644 index 000000000000..edab37e5f88d --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_application_versions_operations.py @@ -0,0 +1,630 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GalleryApplicationVersionsOperations(object): + """GalleryApplicationVersionsOperations 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.v2021_07_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 + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_name, # type: str + gallery_application_version, # type: "_models.GalleryApplicationVersion" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryApplicationVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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(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 + + if response.status_code not in [200, 201, 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('GalleryApplicationVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_name, # type: str + gallery_application_version, # type: "_models.GalleryApplicationVersion" + **kwargs # type: Any + ): + # 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. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + 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:``. + :type gallery_application_version_name: str + :param gallery_application_version: Parameters supplied to the create or update gallery + Application Version operation. + :type gallery_application_version: ~azure.mgmt.compute.v2021_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. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 GalleryApplicationVersion or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_name, + gallery_application_version=gallery_application_version, + 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('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_name, # type: str + gallery_application_version, # type: "_models.GalleryApplicationVersionUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryApplicationVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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(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 + + 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('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_name, # type: str + gallery_application_version, # type: "_models.GalleryApplicationVersionUpdate" + **kwargs # type: Any + ): + # 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. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + 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:``. + :type gallery_application_version_name: str + :param gallery_application_version: Parameters supplied to the update gallery Application + Version operation. + :type gallery_application_version: ~azure.mgmt.compute.v2021_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. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 GalleryApplicationVersion or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_name, + gallery_application_version=gallery_application_version, + 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('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_name, # type: str + expand=None, # type: Optional[Union[str, "_models.ReplicationStatusTypes"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryApplicationVersion" + """Retrieves information about 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. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + Application Version resides. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery Application Version to be + retrieved. + :type gallery_application_version_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str or ~azure.mgmt.compute.v2021_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.v2021_07_01.models.GalleryApplicationVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_name, '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('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_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 = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_name, # type: str + **kwargs # type: Any + ): + # 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. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + Application Version resides. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery Application Version to be + 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. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def list_by_gallery_application( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GalleryApplicationVersionList"] + """List gallery Application Versions in 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 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. + :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) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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('GalleryApplicationVersionList', 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_gallery_application.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_applications_operations.py new file mode 100644 index 000000000000..921d01cc4e86 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_applications_operations.py @@ -0,0 +1,587 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GalleryApplicationsOperations(object): + """GalleryApplicationsOperations 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.v2021_07_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 + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application, # type: "_models.GalleryApplication" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryApplication" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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(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 + + if response.status_code not in [200, 201, 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('GalleryApplication', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application, # type: "_models.GalleryApplication" + **kwargs # type: Any + ): + # 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. + :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. + :type gallery_application_name: str + :param gallery_application: Parameters supplied to the create or update gallery Application + operation. + :type gallery_application: ~azure.mgmt.compute.v2021_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. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 GalleryApplication or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application=gallery_application, + 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('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application, # type: "_models.GalleryApplicationUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryApplication" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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(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 + + 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('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application, # type: "_models.GalleryApplicationUpdate" + **kwargs # type: Any + ): + # 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. + :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. + :type gallery_application_name: str + :param gallery_application: Parameters supplied to the update gallery Application operation. + :type gallery_application: ~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 GalleryApplication or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application=gallery_application, + 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('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryApplication" + """Retrieves information about 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 from which the Application + Definitions are to be retrieved. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition to be + retrieved. + :type gallery_application_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GalleryApplication, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.GalleryApplication + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_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 = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + **kwargs # type: Any + ): + # 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. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition to be deleted. + :type gallery_application_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def list_by_gallery( + self, + resource_group_name, # type: str + gallery_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GalleryApplicationList"] + """List gallery Application Definitions in a 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. + :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) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.GalleryApplicationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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('GalleryApplicationList', 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_gallery.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_image_versions_operations.py new file mode 100644 index 000000000000..baee0a78d36a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_image_versions_operations.py @@ -0,0 +1,628 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GalleryImageVersionsOperations(object): + """GalleryImageVersionsOperations 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.v2021_07_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 + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + gallery_image_version, # type: "_models.GalleryImageVersion" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryImageVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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(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 + + if response.status_code not in [200, 201, 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('GalleryImageVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + gallery_image_version, # type: "_models.GalleryImageVersion" + **kwargs # type: Any + ): + # 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. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + 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:``. + :type gallery_image_version_name: str + :param gallery_image_version: Parameters supplied to the create or update gallery image version + operation. + :type gallery_image_version: ~azure.mgmt.compute.v2021_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. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image_version_name=gallery_image_version_name, + gallery_image_version=gallery_image_version, + 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('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + gallery_image_version, # type: "_models.GalleryImageVersionUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryImageVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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(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 + + 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('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + gallery_image_version, # type: "_models.GalleryImageVersionUpdate" + **kwargs # type: Any + ): + # 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. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + 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:``. + :type gallery_image_version_name: str + :param gallery_image_version: Parameters supplied to the update gallery image version + operation. + :type gallery_image_version: ~azure.mgmt.compute.v2021_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. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image_version_name=gallery_image_version_name, + gallery_image_version=gallery_image_version, + 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('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + expand=None, # type: Optional[Union[str, "_models.ReplicationStatusTypes"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryImageVersion" + """Retrieves information about 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. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + resides. + :type gallery_image_name: str + :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 or ~azure.mgmt.compute.v2021_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.v2021_07_01.models.GalleryImageVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_name, '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('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_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 = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + **kwargs # type: Any + ): + # 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. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + 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 + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image_version_name=gallery_image_version_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def list_by_gallery_image( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GalleryImageVersionList"] + """List gallery image versions in 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 + 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. + :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) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.GalleryImageVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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('GalleryImageVersionList', 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_gallery_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_images_operations.py new file mode 100644 index 000000000000..b9a2b21e8b12 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_images_operations.py @@ -0,0 +1,585 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GalleryImagesOperations(object): + """GalleryImagesOperations 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.v2021_07_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 + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image, # type: "_models.GalleryImage" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryImage" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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(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 + + if response.status_code not in [200, 201, 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('GalleryImage', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image, # type: "_models.GalleryImage" + **kwargs # type: Any + ): + # 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. + :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. + :type gallery_image_name: str + :param gallery_image: Parameters supplied to the create or update gallery image operation. + :type gallery_image: ~azure.mgmt.compute.v2021_07_01.models.GalleryImage + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryImage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image=gallery_image, + 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('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image, # type: "_models.GalleryImageUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryImage" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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(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 + + 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('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image, # type: "_models.GalleryImageUpdate" + **kwargs # type: Any + ): + # 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. + :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. + :type gallery_image_name: str + :param gallery_image: Parameters supplied to the update gallery image operation. + :type gallery_image: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.GalleryImage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image=gallery_image, + 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('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryImage" + """Retrieves information about 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 from which the Image Definitions are + to be retrieved. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition to be retrieved. + :type gallery_image_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GalleryImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.GalleryImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_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 = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + **kwargs # type: Any + ): + # 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. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition to be deleted. + :type gallery_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + gallery_name=gallery_name, + gallery_image_name=gallery_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, {}) + + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def list_by_gallery( + self, + resource_group_name, # type: str + gallery_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GalleryImageList"] + """List gallery image definitions in a 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. + :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) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.GalleryImageList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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('GalleryImageList', 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_gallery.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_sharing_profile_operations.py new file mode 100644 index 000000000000..26c36521106a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_sharing_profile_operations.py @@ -0,0 +1,177 @@ +# 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 as _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 GallerySharingProfileOperations(object): + """GallerySharingProfileOperations 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.v2021_07_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 _update_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + sharing_update, # type: "_models.SharingUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.SharingUpdate" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharingUpdate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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(sharing_update, 'SharingUpdate') + 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 response.status_code == 200: + deserialized = self._deserialize('SharingUpdate', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SharingUpdate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + sharing_update, # type: "_models.SharingUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SharingUpdate"] + """Update sharing profile of a 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. + :type gallery_name: str + :param sharing_update: Parameters supplied to the update gallery sharing profile. + :type sharing_update: ~azure.mgmt.compute.v2021_07_01.models.SharingUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 SharingUpdate or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.SharingUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharingUpdate"] + 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, + gallery_name=gallery_name, + sharing_update=sharing_update, + 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('SharingUpdate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_images_operations.py new file mode 100644 index 000000000000..4f037373b8f6 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_images_operations.py @@ -0,0 +1,619 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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 = "2021-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 + 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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-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 + 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.v2021_07_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 = "2021-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 + 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/v2021_07_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_log_analytics_operations.py new file mode 100644 index 000000000000..9493cd90ad2c --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_log_analytics_operations.py @@ -0,0 +1,291 @@ +# 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 as _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.v2021_07_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 = "2021-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 + 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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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.ThrottledRequestsInput" + **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 = "2021-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 + 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, 'ThrottledRequestsInput') + 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.ThrottledRequestsInput" + **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.v2021_07_01.models.ThrottledRequestsInput + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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/v2021_07_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_operations.py new file mode 100644 index 000000000000..449d65f51fb9 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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.v2021_07_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 = "2021-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 + # 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/v2021_07_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_proximity_placement_groups_operations.py new file mode 100644 index 000000000000..d37a24972b34 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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.v2021_07_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.v2021_07_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 = "2021-07-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.ProximityPlacementGroupUpdate" + **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.v2021_07_01.models.ProximityPlacementGroupUpdate + :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.v2021_07_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 = "2021-07-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, 'ProximityPlacementGroupUpdate') + 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 = "2021-07-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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-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 + 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.v2021_07_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 = "2021-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 + 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/v2021_07_01/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_resource_skus_operations.py new file mode 100644 index 000000000000..79098e40c5c8 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_resource_skus_operations.py @@ -0,0 +1,125 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ResourceSkusOperations(object): + """ResourceSkusOperations 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.v2021_07_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, + filter=None, # type: Optional[str] + include_extended_locations=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceSkusResult"] + """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. + :type filter: str + :param include_extended_locations: To Include Extended Locations information or not in the + response. + :type include_extended_locations: 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) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.ResourceSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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 filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if include_extended_locations is not None: + query_parameters['includeExtendedLocations'] = self._serialize.query("include_extended_locations", include_extended_locations, '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('ResourceSkusResult', 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/skus'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_point_collections_operations.py new file mode 100644 index 000000000000..0036c84702c6 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_point_collections_operations.py @@ -0,0 +1,505 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RestorePointCollectionsOperations(object): + """RestorePointCollectionsOperations 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.v2021_07_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 + restore_point_collection_name, # type: str + parameters, # type: "_models.RestorePointCollection" + **kwargs # type: Any + ): + # type: (...) -> "_models.RestorePointCollection" + """The operation to create or update the restore point collection. Please refer to + https://aka.ms/RestorePoints for more details. When updating a restore point collection, only + tags may be modified. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection. + :type restore_point_collection_name: str + :param parameters: Parameters supplied to the Create or Update restore point collection + operation. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestorePointCollection, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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 = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # 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, 'RestorePointCollection') + 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('RestorePointCollection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RestorePointCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + restore_point_collection_name, # type: str + parameters, # type: "_models.RestorePointCollectionUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.RestorePointCollection" + """The operation to update the restore point collection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection. + :type restore_point_collection_name: str + :param parameters: Parameters supplied to the Update restore point collection operation. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollectionUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestorePointCollection, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # 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, 'RestorePointCollectionUpdate') + 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('RestorePointCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + restore_point_collection_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 = "2021-07-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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_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/restorePointCollections/{restorePointCollectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + restore_point_collection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to delete the restore point collection. This operation will also delete all the + contained restore points. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the Restore Point Collection. + :type restore_point_collection_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + restore_point_collection_name=restore_point_collection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + restore_point_collection_name, # type: str + expand=None, # type: Optional[Union[str, "_models.RestorePointCollectionExpandOptions"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.RestorePointCollection" + """The operation to get the restore point collection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection. + :type restore_point_collection_name: str + :param expand: The expand expression to apply on the operation. If expand=restorePoints, server + will return all contained restore points in the restorePointCollection. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollectionExpandOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestorePointCollection, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.RestorePointCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, '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('RestorePointCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RestorePointCollectionListResult"] + """Gets the list of restore point collections 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 RestorePointCollectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.RestorePointCollectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePointCollectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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('RestorePointCollectionListResult', 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/restorePointCollections'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RestorePointCollectionListResult"] + """Gets the list of restore point collections in the subscription. Use nextLink property in the + response to get the next page of restore point collections. Do this till nextLink is not null + to fetch all the restore point collections. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RestorePointCollectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.RestorePointCollectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePointCollectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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('RestorePointCollectionListResult', 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/restorePointCollections'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_points_operations.py new file mode 100644 index 000000000000..f834a110d1df --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_points_operations.py @@ -0,0 +1,361 @@ +# 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 as _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 RestorePointsOperations(object): + """RestorePointsOperations 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.v2021_07_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_initial( + self, + resource_group_name, # type: str + restore_point_collection_name, # type: str + restore_point_name, # type: str + parameters, # type: "_models.RestorePoint" + **kwargs # type: Any + ): + # type: (...) -> "_models.RestorePoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'restorePointName': self._serialize.url("restore_point_name", restore_point_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['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, 'RestorePoint') + 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 [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestorePoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + restore_point_collection_name, # type: str + restore_point_name, # type: str + parameters, # type: "_models.RestorePoint" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RestorePoint"] + """The operation to create the restore point. Updating properties of an existing restore point is + not allowed. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection. + :type restore_point_collection_name: str + :param restore_point_name: The name of the restore point. + :type restore_point_name: str + :param parameters: Parameters supplied to the Create restore point operation. + :type parameters: ~azure.mgmt.compute.v2021_07_01.models.RestorePoint + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 RestorePoint or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.RestorePoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePoint"] + 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_initial( + resource_group_name=resource_group_name, + restore_point_collection_name=restore_point_collection_name, + restore_point_name=restore_point_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('RestorePoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'restorePointName': self._serialize.url("restore_point_name", restore_point_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + restore_point_collection_name, # type: str + restore_point_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 = "2021-07-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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'restorePointName': self._serialize.url("restore_point_name", restore_point_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + restore_point_collection_name, # type: str + restore_point_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to delete the restore point. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the Restore Point Collection. + :type restore_point_collection_name: str + :param restore_point_name: The name of the restore point. + :type restore_point_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + restore_point_collection_name=restore_point_collection_name, + restore_point_name=restore_point_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'restorePointName': self._serialize.url("restore_point_name", restore_point_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + restore_point_collection_name, # type: str + restore_point_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RestorePoint" + """The operation to get the restore point. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection. + :type restore_point_collection_name: str + :param restore_point_name: The name of the restore point. + :type restore_point_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestorePoint, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.RestorePoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestorePoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'restorePointName': self._serialize.url("restore_point_name", restore_point_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestorePoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_galleries_operations.py new file mode 100644 index 000000000000..6917433a7bf2 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_galleries_operations.py @@ -0,0 +1,182 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SharedGalleriesOperations(object): + """SharedGalleriesOperations 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.v2021_07_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 + shared_to=None, # type: Optional[Union[str, "_models.SharedToValues"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SharedGalleryList"] + """List shared galleries by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param shared_to: The query parameter to decide what shared galleries to fetch when doing + listing operations. + :type shared_to: str or ~azure.mgmt.compute.v2021_07_01.models.SharedToValues + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedGalleryList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.SharedGalleryList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(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 shared_to is not None: + query_parameters['sharedTo'] = self._serialize.query("shared_to", shared_to, '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('SharedGalleryList', 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}/sharedGalleries'} # type: ignore + + def get( + self, + location, # type: str + gallery_unique_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SharedGallery" + """Get a shared gallery by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SharedGallery, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.SharedGallery + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_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('SharedGallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_image_versions_operations.py new file mode 100644 index 000000000000..1297376e4300 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_image_versions_operations.py @@ -0,0 +1,203 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SharedGalleryImageVersionsOperations(object): + """SharedGalleryImageVersionsOperations 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.v2021_07_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 + gallery_unique_name, # type: str + gallery_image_name, # type: str + shared_to=None, # type: Optional[Union[str, "_models.SharedToValues"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SharedGalleryImageVersionList"] + """List shared gallery image versions by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image + Versions are to be listed. + :type gallery_image_name: str + :param shared_to: The query parameter to decide what shared galleries to fetch when doing + listing operations. + :type shared_to: str or ~azure.mgmt.compute.v2021_07_01.models.SharedToValues + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedGalleryImageVersionList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.SharedGalleryImageVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImageVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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') + if shared_to is not None: + query_parameters['sharedTo'] = self._serialize.query("shared_to", shared_to, '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('SharedGalleryImageVersionList', 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}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions'} # type: ignore + + def get( + self, + location, # type: str + gallery_unique_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SharedGalleryImageVersion" + """Get a shared gallery image version by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image + Versions are to be listed. + :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:``. + :type gallery_image_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SharedGalleryImageVersion, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.SharedGalleryImageVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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('SharedGalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_images_operations.py new file mode 100644 index 000000000000..3c0c1ec4af7a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_images_operations.py @@ -0,0 +1,191 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SharedGalleryImagesOperations(object): + """SharedGalleryImagesOperations 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.v2021_07_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 + gallery_unique_name, # type: str + shared_to=None, # type: Optional[Union[str, "_models.SharedToValues"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SharedGalleryImageList"] + """List shared gallery images by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param shared_to: The query parameter to decide what shared galleries to fetch when doing + listing operations. + :type shared_to: str or ~azure.mgmt.compute.v2021_07_01.models.SharedToValues + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedGalleryImageList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.SharedGalleryImageList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImageList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_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') + if shared_to is not None: + query_parameters['sharedTo'] = self._serialize.query("shared_to", shared_to, '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('SharedGalleryImageList', 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}/sharedGalleries/{galleryUniqueName}/images'} # type: ignore + + def get( + self, + location, # type: str + gallery_unique_name, # type: str + gallery_image_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SharedGalleryImage" + """Get a shared gallery image by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param gallery_image_name: The name of the Shared Gallery Image Definition from which the 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: SharedGalleryImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.SharedGalleryImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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('SharedGalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_ssh_public_keys_operations.py new file mode 100644 index 000000000000..1d7054a2c8ee --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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.v2021_07_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 = "2021-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 + 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.v2021_07_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 = "2021-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 + 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.v2021_07_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.v2021_07_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 = "2021-07-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.v2021_07_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.v2021_07_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 = "2021-07-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 = "2021-07-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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-07-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/v2021_07_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_usage_operations.py new file mode 100644 index 000000000000..3b4a0e776074 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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.v2021_07_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 = "2021-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 + 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/v2021_07_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extension_images_operations.py new file mode 100644 index 000000000000..bfe885ef1913 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _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.v2021_07_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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-07-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/v2021_07_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extensions_operations.py new file mode 100644 index 000000000000..0f937ffa0bde --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extensions_operations.py @@ -0,0 +1,567 @@ +# 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 as _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.v2021_07_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 = "2021-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 + 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.v2021_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. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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 = "2021-07-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.v2021_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. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-07-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/v2021_07_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_edge_zone_operations.py new file mode 100644 index 000000000000..88f378aa8454 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -0,0 +1,399 @@ +# 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 as _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 VirtualMachineImagesEdgeZoneOperations(object): + """VirtualMachineImagesEdgeZoneOperations 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.v2021_07_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 + edge_zone, # 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 in an edge zone. + + :param location: The name of a supported Azure region. + :type location: str + :param edge_zone: The name of the edge zone. + :type edge_zone: 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.v2021_07_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 = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'edgeZone': self._serialize.url("edge_zone", edge_zone, '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}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}'} # type: ignore + + def list( + self, + location, # type: str + edge_zone, # 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, edge zone, + publisher, offer, and SKU. + + :param location: The name of a supported Azure region. + :type location: str + :param edge_zone: The name of the edge zone. + :type edge_zone: 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: An integer value specifying the number of images to return that matches supplied + values. + :type top: int + :param orderby: Specifies the order of the results returned. Formatted as an OData query. + :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.v2021_07_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 = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'edgeZone': self._serialize.url("edge_zone", edge_zone, '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}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions'} # type: ignore + + def list_offers( + self, + location, # type: str + edge_zone, # 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, edge zone and + publisher. + + :param location: The name of a supported Azure region. + :type location: str + :param edge_zone: The name of the edge zone. + :type edge_zone: 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.v2021_07_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 = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list_offers.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'edgeZone': self._serialize.url("edge_zone", edge_zone, '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}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers'} # type: ignore + + def list_publishers( + self, + location, # type: str + edge_zone, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VirtualMachineImageResource"] + """Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + + :param location: The name of a supported Azure region. + :type location: str + :param edge_zone: The name of the edge zone. + :type edge_zone: 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.v2021_07_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 = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list_publishers.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'edgeZone': self._serialize.url("edge_zone", edge_zone, '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}/edgeZones/{edgeZone}/publishers'} # type: ignore + + def list_skus( + self, + location, # type: str + edge_zone, # 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, edge zone, publisher, and + offer. + + :param location: The name of a supported Azure region. + :type location: str + :param edge_zone: The name of the edge zone. + :type edge_zone: 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.v2021_07_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 = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'edgeZone': self._serialize.url("edge_zone", edge_zone, '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}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_operations.py new file mode 100644 index 000000000000..ede3461589da --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _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.v2021_07_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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-07-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/v2021_07_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_run_commands_operations.py new file mode 100644 index 000000000000..5bd6b395fa2e --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_run_commands_operations.py @@ -0,0 +1,714 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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.v2021_07_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 = "2021-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 + 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.v2021_07_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 = "2021-07-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 + + def _create_or_update_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommand" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineRunCommand" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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(run_command, 'VirtualMachineRunCommand') + 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('VirtualMachineRunCommand', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineRunCommand', 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}/runCommands/{runCommandName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommand" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachineRunCommand"] + """The operation to create or update the run command. + + :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 run command should be created or + updated. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Create Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommandUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineRunCommand" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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(run_command, 'VirtualMachineRunCommandUpdate') + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommandUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachineRunCommand"] + """The operation to update the run command. + + :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 run command should be updated. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Update Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_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 = "2021-07-01" + accept = "application/json, text/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'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to delete the run command. + + :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 run command should be deleted. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + run_command_name=run_command_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def get_by_virtual_machine( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineRunCommand" + """The operation to get the run command. + + :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 run command. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_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: VirtualMachineRunCommand, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json, text/json" + + # Construct URL + url = self.get_by_virtual_machine.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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_virtual_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def list_by_virtual_machine( + self, + resource_group_name, # type: str + vm_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualMachineRunCommandsListResult"] + """The operation to get all run commands 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 run command. + :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: An iterator like instance of either VirtualMachineRunCommandsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommandsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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_by_virtual_machine.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') + + 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('VirtualMachineRunCommandsListResult', 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_virtual_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_extensions_operations.py new file mode 100644 index 000000000000..8e93c335c4b9 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -0,0 +1,583 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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 = "2021-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 + 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.v2021_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. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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 = "2021-07-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.v2021_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. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-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 + 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/v2021_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py new file mode 100644 index 000000000000..7e479c0df746 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -0,0 +1,434 @@ +# 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 as _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.v2021_07_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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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.v2021_07_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 = "2021-07-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/v2021_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py new file mode 100644 index 000000000000..80979afd63f8 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -0,0 +1,597 @@ +# 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 as _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.v2021_07_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.VirtualMachineScaleSetVMExtension" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineScaleSetVMExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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, 'VirtualMachineScaleSetVMExtension') + 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('VirtualMachineScaleSetVMExtension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', 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.VirtualMachineScaleSetVMExtension" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetVMExtension"] + """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.v2021_07_01.models.VirtualMachineScaleSetVMExtension + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 VirtualMachineScaleSetVMExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetVMExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] + 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('VirtualMachineScaleSetVMExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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.VirtualMachineScaleSetVMExtensionUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineScaleSetVMExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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, 'VirtualMachineScaleSetVMExtensionUpdate') + 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('VirtualMachineScaleSetVMExtension', 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.VirtualMachineScaleSetVMExtensionUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetVMExtension"] + """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.v2021_07_01.models.VirtualMachineScaleSetVMExtensionUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 VirtualMachineScaleSetVMExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetVMExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] + 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('VirtualMachineScaleSetVMExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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.VirtualMachineScaleSetVMExtension" + """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: VirtualMachineScaleSetVMExtension, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetVMExtension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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('VirtualMachineScaleSetVMExtension', 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.VirtualMachineScaleSetVMExtensionsListResult" + """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: VirtualMachineScaleSetVMExtensionsListResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineScaleSetVMExtensionsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtensionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-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('VirtualMachineScaleSetVMExtensionsListResult', 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/v2021_07_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py new file mode 100644 index 000000000000..99a9df89223d --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -0,0 +1,612 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineScaleSetVMRunCommandsOperations(object): + """VirtualMachineScaleSetVMRunCommandsOperations 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.v2021_07_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 + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommand" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineRunCommand" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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(run_command, 'VirtualMachineRunCommand') + 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('VirtualMachineRunCommand', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineRunCommand', 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}/runCommands/{runCommandName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommand" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachineRunCommand"] + """The operation to create or update the VMSS VM run command. + + :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 run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Create Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommandUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineRunCommand" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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(run_command, 'VirtualMachineRunCommandUpdate') + 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('VirtualMachineRunCommand', 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}/runCommands/{runCommandName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommandUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachineRunCommand"] + """The operation to update the VMSS VM run command. + + :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 run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Update Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandUpdate + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + run_command_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 = "2021-07-01" + accept = "application/json, text/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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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}/runCommands/{runCommandName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + run_command_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to delete the VMSS VM run command. + + :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 run_command_name: The name of the virtual machine run command. + :type run_command_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + run_command_name=run_command_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + '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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + run_command_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineRunCommand" + """The operation to get the VMSS VM run command. + + :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 run_command_name: The name of the virtual machine run command. + :type run_command_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: VirtualMachineRunCommand, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommand + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json, text/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'), + 'runCommandName': self._serialize.url("run_command_name", run_command_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('VirtualMachineRunCommand', 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}/runCommands/{runCommandName}'} # 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: (...) -> Iterable["_models.VirtualMachineRunCommandsListResult"] + """The operation to get all run commands 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: An iterator like instance of either VirtualMachineRunCommandsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineRunCommandsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommandsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-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 + 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') + + 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('VirtualMachineRunCommandsListResult', 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}/virtualMachines/{instanceId}/runCommands'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vms_operations.py new file mode 100644 index 000000000000..c8e8406a1d5c --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -0,0 +1,1747 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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.VirtualMachineScaleSetVMReimageParameters"] + **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 = "2021-07-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, 'VirtualMachineScaleSetVMReimageParameters') + 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.VirtualMachineScaleSetVMReimageParameters"] + **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.v2021_07_01.models.VirtualMachineScaleSetVMReimageParameters + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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 + force_deletion=None, # 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 = "2021-07-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] + if force_deletion is not None: + query_parameters['forceDeletion'] = self._serialize.query("force_deletion", force_deletion, 'bool') + 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 + force_deletion=None, # type: Optional[bool] + **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 + :param force_deletion: Optional parameter to force delete a virtual machine from a VM scale + set. (Feature in Preview). + :type force_deletion: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + force_deletion=force_deletion, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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=None, # type: Optional[Union[str, "_models.InstanceViewTypes"]] + **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. 'InstanceView' will retrieve + the instance view of the virtual machine. 'UserData' will retrieve the UserData of the virtual + machine. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.InstanceViewTypes + :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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-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 + 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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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.v2021_07_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 = "2021-07-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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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 = "2021-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 + 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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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/v2021_07_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_sets_operations.py new file mode 100644 index 000000000000..db6ad0c33031 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_sets_operations.py @@ -0,0 +1,2383 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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.VirtualMachineScaleSetListResult"] + """Gets all the VM scale sets under the specified subscription for the specified location. + + :param location: The location for which VM scale sets 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 VirtualMachineScaleSetListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2021_07_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 = "2021-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 + 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('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_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets'} # type: ignore + + 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 = "2021-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 + 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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + force_deletion=None, # 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 = "2021-07-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] + if force_deletion is not None: + query_parameters['forceDeletion'] = self._serialize.query("force_deletion", force_deletion, 'bool') + 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 + force_deletion=None, # type: Optional[bool] + **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 + :param force_deletion: Optional parameter to force delete a VM scale set. (Feature in Preview). + :type force_deletion: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + force_deletion=force_deletion, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + expand=None, # type: Optional[Union[str, "_models.ExpandTypesForGetVMScaleSets"]] + **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 + :param expand: The expand expression to apply on the operation. 'UserData' retrieves the + UserData property of the VM scale set that was provided by the user during the VM scale set + Create/Update operation. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.ExpandTypesForGetVMScaleSets + :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.v2021_07_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 = "2021-07-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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, '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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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" + force_deletion=None, # 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 = "2021-07-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] + if force_deletion is not None: + query_parameters['forceDeletion'] = self._serialize.query("force_deletion", force_deletion, '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] + 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" + force_deletion=None, # type: Optional[bool] + **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.v2021_07_01.models.VirtualMachineScaleSetVMInstanceRequiredIDs + :param force_deletion: Optional parameter to force delete virtual machines from the VM scale + set. (Feature in Preview). + :type force_deletion: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + force_deletion=force_deletion, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-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 + 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.v2021_07_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 = "2021-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 + 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.v2021_07_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 = "2021-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 + 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.v2021_07_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 = "2021-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 + 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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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/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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-07-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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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/v2021_07_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_sizes_operations.py new file mode 100644 index 000000000000..c51469cd55bc --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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.v2021_07_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 = "2021-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 + 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/v2021_07_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machines_operations.py new file mode 100644 index 000000000000..ec6c497e4326 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machines_operations.py @@ -0,0 +1,2528 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2021_07_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.v2021_07_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 = "2021-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 + 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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-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 + 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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/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 = "2021-07-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]: + 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 + _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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + force_deletion=None, # 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 = "2021-07-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] + if force_deletion is not None: + query_parameters['forceDeletion'] = self._serialize.query("force_deletion", force_deletion, 'bool') + 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 + force_deletion=None, # type: Optional[bool] + **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 + :param force_deletion: Optional parameter to force delete virtual machines.(Feature in + Preview). + :type force_deletion: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + force_deletion=force_deletion, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + vm_name, # type: str + expand=None, # type: Optional[Union[str, "_models.InstanceViewTypes"]] + **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. 'InstanceView' retrieves a + snapshot of the runtime properties of the virtual machine that is managed by the platform and + can change outside of control plane operations. 'UserData' retrieves the UserData property as + part of the VM model view that was provided by the user during the VM Create/Update operation. + :type expand: str or ~azure.mgmt.compute.v2021_07_01.models.InstanceViewTypes + :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.v2021_07_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 = "2021-07-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.v2021_07_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 = "2021-07-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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 + hibernate=None, # 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 = "2021-07-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] + if hibernate is not None: + query_parameters['hibernate'] = self._serialize.query("hibernate", hibernate, '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, {}) + + _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 + hibernate=None, # type: Optional[bool] + **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 + :param hibernate: Optional parameter to hibernate a virtual machine. (Feature in Preview). + :type hibernate: 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, + hibernate=hibernate, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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.v2021_07_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 = "2021-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 + 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.v2021_07_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 = "2021-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 + 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.v2021_07_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 = "2021-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 + 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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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.v2021_07_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 = "2021-07-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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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 = "2021-07-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 = "2021-07-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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_assess_patches.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches'} # type: ignore + + def _install_patches_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + install_patches_input, # type: "_models.VirtualMachineInstallPatchesParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VirtualMachineInstallPatchesResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineInstallPatchesResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._install_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['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(install_patches_input, 'VirtualMachineInstallPatchesParameters') + 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('VirtualMachineInstallPatchesResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_patches_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches'} # type: ignore + + def begin_install_patches( + self, + resource_group_name, # type: str + vm_name, # type: str + install_patches_input, # type: "_models.VirtualMachineInstallPatchesParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachineInstallPatchesResult"] + """Installs 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 + :param install_patches_input: Input for InstallPatches as directly received by the API. + :type install_patches_input: ~azure.mgmt.compute.v2021_07_01.models.VirtualMachineInstallPatchesParameters + :keyword callable cls: A custom type 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 VirtualMachineInstallPatchesResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2021_07_01.models.VirtualMachineInstallPatchesResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstallPatchesResult"] + 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._install_patches_initial( + resource_group_name=resource_group_name, + vm_name=vm_name, + install_patches_input=install_patches_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): + deserialized = self._deserialize('VirtualMachineInstallPatchesResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_patches.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches'} # 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 = "2021-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 + 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.v2021_07_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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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.v2021_07_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 + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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/v2021_07_01/py.typed b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_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/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 187bf75448be..c848b822b824 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,10 +14,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"availabilitysetse7f013f3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3\",\r\n @@ -32,7 +32,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:17:01 GMT + - Thu, 02 Sep 2021 03:19:03 GMT expires: - '-1' pragma: @@ -49,7 +49,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/PutVM3Min;744,Microsoft.Compute/PutVM30Min;3694 + - Microsoft.Compute/PutVM3Min;745,Microsoft.Compute/PutVM30Min;3729 x-ms-ratelimit-remaining-subscription-writes: - '1199' status: @@ -65,10 +65,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"availabilitysetse7f013f3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3\",\r\n @@ -84,7 +84,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:17:01 GMT + - Thu, 02 Sep 2021 03:19:03 GMT expires: - '-1' pragma: @@ -101,7 +101,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3999,Microsoft.Compute/LowCostGet30Min;31727 + - Microsoft.Compute/LowCostGet3Min;3998,Microsoft.Compute/LowCostGet30Min;31998 status: code: 200 message: OK @@ -120,10 +120,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"availabilitysetse7f013f3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3\",\r\n @@ -138,7 +138,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:17:01 GMT + - Thu, 02 Sep 2021 03:19:03 GMT expires: - '-1' pragma: @@ -155,7 +155,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/PutVM3Min;743,Microsoft.Compute/PutVM30Min;3693 + - Microsoft.Compute/PutVM3Min;744,Microsoft.Compute/PutVM30Min;3728 x-ms-ratelimit-remaining-subscription-writes: - '1198' status: @@ -173,10 +173,10 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/availabilitysetse7f013f3?api-version=2021-07-01 response: body: string: '' @@ -186,7 +186,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:17:02 GMT + - Thu, 02 Sep 2021 03:19:04 GMT expires: - '-1' pragma: @@ -199,7 +199,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVM3Min;239,Microsoft.Compute/DeleteVM30Min;1163 + - Microsoft.Compute/DeleteVM3Min;239,Microsoft.Compute/DeleteVM30Min;1199 x-ms-ratelimit-remaining-subscription-deletes: - '14999' status: 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 d65da26a4ed0..3b5ce2c3fd11 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 @@ -16,7 +16,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/accountxyz9b271243?api-version=2021-04-01 @@ -31,11 +31,11 @@ interactions: content-type: - text/plain; charset=utf-8 date: - - Thu, 22 Jul 2021 03:17:06 GMT + - Thu, 02 Sep 2021 03:19:09 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/03d8eb3b-448b-4dd9-87d3-ac37775d660f?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/4c7eaaf8-d0ee-4640-ae9c-ad88ba26966b?monitor=true&api-version=2021-04-01 pragma: - no-cache server: @@ -59,13 +59,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/03d8eb3b-448b-4dd9-87d3-ac37775d660f?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/4c7eaaf8-d0ee-4640-ae9c-ad88ba26966b?monitor=true&api-version=2021-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":{"keyCreationTime":{"key1":"2021-07-22T03:17:05.5509499Z","key2":"2021-07-22T03:17:05.5509499Z"},"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2021-07-22T03:17:05.5509499Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2021-07-22T03:17:05.5509499Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2021-07-22T03:17:05.4259845Z","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":{"keyCreationTime":{"key1":"2021-09-02T03:19:07.8537115Z","key2":"2021-09-02T03:19:07.8537115Z"},"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2021-09-02T03:19:07.8537115Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2021-09-02T03:19:07.8537115Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2021-09-02T03:19:07.7443354Z","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 @@ -74,7 +74,7 @@ interactions: content-type: - application/json date: - - Thu, 22 Jul 2021 03:17:23 GMT + - Thu, 02 Sep 2021 03:19:25 GMT expires: - '-1' pragma: @@ -104,13 +104,13 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/accountxyz9b271243/listKeys?api-version=2021-04-01&$expand=kerb response: body: - string: '{"keys":[{"creationTime":"2021-07-22T03:17:05.5509499Z","keyName":"key1","value":"FakeValue","permissions":"FULL"},{"creationTime":"2021-07-22T03:17:05.5509499Z","keyName":"key2","value":"FakeValue","permissions":"FULL"}]}' + string: '{"keys":[{"creationTime":"2021-09-02T03:19:07.8537115Z","keyName":"key1","value":"FakeValue","permissions":"FULL"},{"creationTime":"2021-09-02T03:19:07.8537115Z","keyName":"key2","value":"FakeValue","permissions":"FULL"}]}' headers: cache-control: - no-cache @@ -119,7 +119,7 @@ interactions: content-type: - application/json date: - - Thu, 22 Jul 2021 03:17:23 GMT + - Thu, 02 Sep 2021 03:19:26 GMT expires: - '-1' pragma: @@ -140,8 +140,8 @@ interactions: code: 200 message: OK - request: - body: '{"blobContainerSasUri": "fakeuri", "fromTime": "2021-07-20T03:17:24.15317Z", - "toTime": "2021-07-22T03:17:24.153175Z", "groupByResourceName": true, "intervalLength": + body: '{"blobContainerSasUri": "fakeuri", "fromTime": "2021-08-31T03:19:26.299953Z", + "toTime": "2021-09-02T03:19:26.299958Z", "groupByResourceName": true, "intervalLength": "SixtyMins"}' headers: Accept: @@ -151,30 +151,30 @@ interactions: Connection: - keep-alive Content-Length: - - '362' + - '361' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/logAnalytics/apiAccess/getRequestRateByInterval?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/logAnalytics/apiAccess/getRequestRateByInterval?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a5107793-7c97-477b-9b65-8bbd6b03cd1c?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d4a25eb1-6cfc-4330-a8ab-29f113b0ea33?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:17:23 GMT + - Thu, 02 Sep 2021 03:19:26 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a5107793-7c97-477b-9b65-8bbd6b03cd1c?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d4a25eb1-6cfc-4330-a8ab-29f113b0ea33?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -201,17 +201,17 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a5107793-7c97-477b-9b65-8bbd6b03cd1c?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d4a25eb1-6cfc-4330-a8ab-29f113b0ea33?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:17:24.6332872+00:00\",\r\n \"endTime\": - \"2021-07-22T03:17:26.1645894+00:00\",\r\n \"status\": \"Failed\",\r\n \"error\": + string: "{\r\n \"startTime\": \"2021-09-02T03:19:26.7566842+00:00\",\r\n \"endTime\": + \"2021-09-02T03:19:28.0535437+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\": \"a5107793-7c97-477b-9b65-8bbd6b03cd1c\"\r\n}" + (403) Forbidden..\"\r\n },\r\n \"name\": \"d4a25eb1-6cfc-4330-a8ab-29f113b0ea33\"\r\n}" headers: cache-control: - no-cache @@ -220,7 +220,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:17:53 GMT + - Thu, 02 Sep 2021 03:19:56 GMT expires: - '-1' pragma: @@ -237,13 +237,13 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29654 + - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29998 status: code: 200 message: OK - request: - body: '{"blobContainerSasUri": "fakeuri", "fromTime": "2021-07-20T03:17:54.794101Z", - "toTime": "2021-07-22T03:17:54.794114Z", "groupByOperationName": true, "groupByResourceName": + body: '{"blobContainerSasUri": "fakeuri", "fromTime": "2021-08-31T03:19:56.953692Z", + "toTime": "2021-09-02T03:19:56.953704Z", "groupByOperationName": true, "groupByResourceName": false}' headers: Accept: @@ -253,30 +253,30 @@ interactions: Connection: - keep-alive Content-Length: - - '363' + - '361' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/logAnalytics/apiAccess/getThrottledRequests?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/logAnalytics/apiAccess/getThrottledRequests?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/540435b4-9b95-429f-8aff-ae68a224dd4b?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/934c611f-3de7-42c2-bb1e-ed4d54923e63?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:17:53 GMT + - Thu, 02 Sep 2021 03:19:56 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/540435b4-9b95-429f-8aff-ae68a224dd4b?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/934c611f-3de7-42c2-bb1e-ed4d54923e63?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -303,26 +303,26 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/540435b4-9b95-429f-8aff-ae68a224dd4b?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/934c611f-3de7-42c2-bb1e-ed4d54923e63?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:17:54.836639+00:00\",\r\n \"endTime\": - \"2021-07-22T03:17:55.2428305+00:00\",\r\n \"status\": \"Failed\",\r\n \"error\": + string: "{\r\n \"startTime\": \"2021-09-02T03:19:56.9912681+00:00\",\r\n \"endTime\": + \"2021-09-02T03:19:57.3506316+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\": \"540435b4-9b95-429f-8aff-ae68a224dd4b\"\r\n}" + (403) Forbidden..\"\r\n },\r\n \"name\": \"934c611f-3de7-42c2-bb1e-ed4d54923e63\"\r\n}" headers: cache-control: - no-cache content-length: - - '358' + - '359' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:18:24 GMT + - Thu, 02 Sep 2021 03:20:26 GMT expires: - '-1' pragma: @@ -339,7 +339,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29652 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29996 status: code: 200 message: OK 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 3167297548ac..a2ed00613619 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,10 +13,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"proximiityplacementgroupsb24517e6\",\r\n \"id\": @@ -32,7 +32,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:18:26 GMT + - Thu, 02 Sep 2021 03:20:28 GMT expires: - '-1' pragma: @@ -47,7 +47,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 @@ -61,10 +61,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"proximiityplacementgroupsb24517e6\",\r\n \"id\": @@ -81,7 +81,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:18:26 GMT + - Thu, 02 Sep 2021 03:20:28 GMT expires: - '-1' pragma: @@ -98,7 +98,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/HighCostGet3Min;139,Microsoft.Compute/HighCostGet30Min;697 + - Microsoft.Compute/HighCostGet3Min;139,Microsoft.Compute/HighCostGet30Min;699 status: code: 200 message: OK @@ -116,10 +116,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"proximiityplacementgroupsb24517e6\",\r\n \"id\": @@ -135,7 +135,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:18:26 GMT + - Thu, 02 Sep 2021 03:20:28 GMT expires: - '-1' pragma: @@ -154,7 +154,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 @@ -170,10 +170,10 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/proximityPlacementGroups/proximiityplacementgroupsb24517e6?api-version=2021-07-01 response: body: string: '' @@ -183,7 +183,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:18:27 GMT + - Thu, 02 Sep 2021 03:20:29 GMT expires: - '-1' pragma: @@ -198,7 +198,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/PutDeletePPG3Min;97,Microsoft.Compute/PutDeletePPG30Min;497 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_disks.test_compute_disks.yaml b/sdk/compute/azure-mgmt-compute/tests/recordings/test_mgmt_compute_disks.test_compute_disks.yaml index bae825066c4c..e73ae79400ea 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,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2020-12-01 @@ -26,7 +26,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/7e190004-f601-422c-895f-1ac70acf2872?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/40f1ee56-9532-4d7b-9ed9-90c5dda6f335?api-version=2020-12-01 cache-control: - no-cache content-length: @@ -34,11 +34,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:20:05 GMT + - Thu, 02 Sep 2021 03:22:08 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/7e190004-f601-422c-895f-1ac70acf2872?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/40f1ee56-9532-4d7b-9ed9-90c5dda6f335?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -49,9 +49,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateUpdateDisks3Min;997,Microsoft.Compute/CreateUpdateDisks30Min;7996 + - Microsoft.Compute/CreateUpdateDisks3Min;997,Microsoft.Compute/CreateUpdateDisks30Min;7997 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1195' status: code: 202 message: Accepted @@ -65,14 +65,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/7e190004-f601-422c-895f-1ac70acf2872?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/40f1ee56-9532-4d7b-9ed9-90c5dda6f335?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:20:06.3043357+00:00\",\r\n \"endTime\": - \"2021-07-22T03:20:06.4293725+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T03:22:08.3927821+00:00\",\r\n \"endTime\": + \"2021-09-02T03:22:08.5021368+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\",\r\n @@ -80,11 +80,11 @@ interactions: \ },\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 \"encryption\": {\r\n \"type\": - \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-07-22T03:20:06.3199821+00:00\",\r\n + \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-09-02T03:22:08.3927821+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"dd57fd5c-3646-496e-8c84-b25db96cc12a\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"2c9365b5-317b-4c46-9520-219378126c7d\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"name\": - \"7e190004-f601-422c-895f-1ac70acf2872\"\r\n}" + \"40f1ee56-9532-4d7b-9ed9-90c5dda6f335\"\r\n}" headers: cache-control: - no-cache @@ -93,7 +93,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:20:07 GMT + - Thu, 02 Sep 2021 03:22:10 GMT expires: - '-1' pragma: @@ -110,7 +110,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49988,Microsoft.Compute/GetOperation30Min;399953 + - Microsoft.Compute/GetOperation3Min;49988,Microsoft.Compute/GetOperation30Min;399988 status: code: 200 message: OK @@ -124,7 +124,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2020-12-01 @@ -136,9 +136,9 @@ interactions: \ },\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 \"encryption\": {\r\n \"type\": - \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-07-22T03:20:06.3199821+00:00\",\r\n + \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-09-02T03:22:08.3927821+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"dd57fd5c-3646-496e-8c84-b25db96cc12a\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"2c9365b5-317b-4c46-9520-219378126c7d\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: @@ -148,7 +148,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:20:07 GMT + - Thu, 02 Sep 2021 03:22:10 GMT expires: - '-1' pragma: @@ -165,7 +165,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;14989,Microsoft.Compute/LowCostGet30Min;119855 + - Microsoft.Compute/LowCostGet3Min;14991,Microsoft.Compute/LowCostGet30Min;119991 status: code: 200 message: OK @@ -179,7 +179,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2020-12-01 @@ -191,9 +191,9 @@ interactions: \ },\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 \"encryption\": {\r\n \"type\": - \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-07-22T03:20:06.3199821+00:00\",\r\n + \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-09-02T03:22:08.3927821+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"dd57fd5c-3646-496e-8c84-b25db96cc12a\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"2c9365b5-317b-4c46-9520-219378126c7d\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: @@ -203,7 +203,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:20:07 GMT + - Thu, 02 Sep 2021 03:22:10 GMT expires: - '-1' pragma: @@ -220,7 +220,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;14988,Microsoft.Compute/LowCostGet30Min;119854 + - Microsoft.Compute/LowCostGet3Min;14990,Microsoft.Compute/LowCostGet30Min;119990 status: code: 200 message: OK @@ -238,7 +238,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2020-12-01 @@ -251,7 +251,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/ff6c55ea-9775-4a21-abd5-eb5fecae4547?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/2158dd42-c4c3-4152-aaeb-695dfd0d8be0?api-version=2020-12-01 cache-control: - no-cache content-length: @@ -259,11 +259,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:20:07 GMT + - Thu, 02 Sep 2021 03:22:10 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ff6c55ea-9775-4a21-abd5-eb5fecae4547?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/2158dd42-c4c3-4152-aaeb-695dfd0d8be0?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -274,9 +274,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateUpdateDisks3Min;996,Microsoft.Compute/CreateUpdateDisks30Min;7995 + - Microsoft.Compute/CreateUpdateDisks3Min;996,Microsoft.Compute/CreateUpdateDisks30Min;7996 x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1194' status: code: 202 message: Accepted @@ -290,14 +290,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ff6c55ea-9775-4a21-abd5-eb5fecae4547?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/2158dd42-c4c3-4152-aaeb-695dfd0d8be0?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:20:08.5387322+00:00\",\r\n \"endTime\": - \"2021-07-22T03:20:08.6481512+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T03:22:10.5959151+00:00\",\r\n \"endTime\": + \"2021-09-02T03:22:10.7208977+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\",\r\n @@ -305,11 +305,11 @@ interactions: \ },\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 \"encryption\": {\r\n \"type\": - \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-07-22T03:20:06.3199821+00:00\",\r\n + \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-09-02T03:22:08.3927821+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"dd57fd5c-3646-496e-8c84-b25db96cc12a\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"2c9365b5-317b-4c46-9520-219378126c7d\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"name\": - \"ff6c55ea-9775-4a21-abd5-eb5fecae4547\"\r\n}" + \"2158dd42-c4c3-4152-aaeb-695dfd0d8be0\"\r\n}" headers: cache-control: - no-cache @@ -318,7 +318,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:20:09 GMT + - Thu, 02 Sep 2021 03:22:12 GMT expires: - '-1' pragma: @@ -335,7 +335,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;399987 status: code: 200 message: OK @@ -349,7 +349,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2020-12-01 @@ -361,9 +361,9 @@ interactions: \ },\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 \"encryption\": {\r\n \"type\": - \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-07-22T03:20:06.3199821+00:00\",\r\n + \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-09-02T03:22:08.3927821+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"dd57fd5c-3646-496e-8c84-b25db96cc12a\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"2c9365b5-317b-4c46-9520-219378126c7d\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: @@ -373,7 +373,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:20:09 GMT + - Thu, 02 Sep 2021 03:22:12 GMT expires: - '-1' pragma: @@ -390,7 +390,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;14986,Microsoft.Compute/LowCostGet30Min;119852 + - Microsoft.Compute/LowCostGet3Min;14988,Microsoft.Compute/LowCostGet30Min;119988 status: code: 200 message: OK @@ -408,7 +408,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175/beginGetAccess?api-version=2020-12-01 @@ -417,17 +417,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5189feba-4ba6-4151-b1cb-8ac80d818a64?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/e7323014-5a63-4967-833d-eeae5b61b4fc?api-version=2020-12-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:20:09 GMT + - Thu, 02 Sep 2021 03:22:12 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5189feba-4ba6-4151-b1cb-8ac80d818a64?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/e7323014-5a63-4967-833d-eeae5b61b4fc?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -454,16 +454,16 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5189feba-4ba6-4151-b1cb-8ac80d818a64?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/e7323014-5a63-4967-833d-eeae5b61b4fc?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:20:10.7262894+00:00\",\r\n \"endTime\": - \"2021-07-22T03:20:10.9762858+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T03:22:12.7834023+00:00\",\r\n \"endTime\": + \"2021-09-02T03:22:13.0021825+00:00\",\r\n \"status\": \"Succeeded\",\r\n \ \"properties\": {\r\n \"output\": {\r\n \"accessSAS\": \"FakeUrl\"\r\n}\r\n - \ },\r\n \"name\": \"5189feba-4ba6-4151-b1cb-8ac80d818a64\"\r\n}" + \ },\r\n \"name\": \"e7323014-5a63-4967-833d-eeae5b61b4fc\"\r\n}" headers: cache-control: - no-cache @@ -472,7 +472,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:20:40 GMT + - Thu, 02 Sep 2021 03:22:42 GMT expires: - '-1' pragma: @@ -489,7 +489,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49984,Microsoft.Compute/GetOperation30Min;399949 + - Microsoft.Compute/GetOperation3Min;49984,Microsoft.Compute/GetOperation30Min;399984 status: code: 200 message: OK @@ -503,10 +503,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5189feba-4ba6-4151-b1cb-8ac80d818a64?monitor=true&api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/e7323014-5a63-4967-833d-eeae5b61b4fc?monitor=true&api-version=2020-12-01 response: body: string: "{\r\n \"accessSAS\": \"FakeUrl\"\r\n}" @@ -518,7 +518,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:20:40 GMT + - Thu, 02 Sep 2021 03:22:42 GMT expires: - '-1' pragma: @@ -535,7 +535,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49983,Microsoft.Compute/GetOperation30Min;399948 + - Microsoft.Compute/GetOperation3Min;49983,Microsoft.Compute/GetOperation30Min;399983 status: code: 200 message: OK @@ -551,7 +551,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175/endGetAccess?api-version=2020-12-01 @@ -560,17 +560,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/38f6177f-7abf-454e-a7f4-d3cd1dac291b?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4cc576a4-f1b8-4705-8b7e-53c873bcde9b?api-version=2020-12-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:20:40 GMT + - Thu, 02 Sep 2021 03:22:42 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/38f6177f-7abf-454e-a7f4-d3cd1dac291b?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4cc576a4-f1b8-4705-8b7e-53c873bcde9b?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -597,15 +597,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/38f6177f-7abf-454e-a7f4-d3cd1dac291b?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4cc576a4-f1b8-4705-8b7e-53c873bcde9b?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:20:40.9766244+00:00\",\r\n \"endTime\": - \"2021-07-22T03:20:41.1328579+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"38f6177f-7abf-454e-a7f4-d3cd1dac291b\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:22:43.0335609+00:00\",\r\n \"endTime\": + \"2021-09-02T03:22:43.1897874+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"4cc576a4-f1b8-4705-8b7e-53c873bcde9b\"\r\n}" headers: cache-control: - no-cache @@ -614,7 +614,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:21:10 GMT + - Thu, 02 Sep 2021 03:23:12 GMT expires: - '-1' pragma: @@ -631,7 +631,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49981,Microsoft.Compute/GetOperation30Min;399946 + - Microsoft.Compute/GetOperation3Min;49981,Microsoft.Compute/GetOperation30Min;399981 status: code: 200 message: OK @@ -645,10 +645,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/38f6177f-7abf-454e-a7f4-d3cd1dac291b?monitor=true&api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4cc576a4-f1b8-4705-8b7e-53c873bcde9b?monitor=true&api-version=2020-12-01 response: body: string: '' @@ -658,7 +658,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:21:10 GMT + - Thu, 02 Sep 2021 03:23:12 GMT expires: - '-1' pragma: @@ -671,7 +671,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49980,Microsoft.Compute/GetOperation30Min;399945 + - Microsoft.Compute/GetOperation3Min;49980,Microsoft.Compute/GetOperation30Min;399980 status: code: 200 message: OK @@ -687,7 +687,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex77f61175?api-version=2020-12-01 @@ -696,17 +696,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/250423ba-8893-4fab-ac24-775975b73a13?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d8bc9513-4031-4699-ba00-787a28f0a70c?api-version=2020-12-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:21:10 GMT + - Thu, 02 Sep 2021 03:23:12 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/250423ba-8893-4fab-ac24-775975b73a13?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d8bc9513-4031-4699-ba00-787a28f0a70c?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -717,9 +717,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteDisks3Min;2998,Microsoft.Compute/DeleteDisks30Min;23969 + - Microsoft.Compute/DeleteDisks3Min;2998,Microsoft.Compute/DeleteDisks30Min;23998 x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14997' status: code: 202 message: Accepted @@ -733,24 +733,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/250423ba-8893-4fab-ac24-775975b73a13?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d8bc9513-4031-4699-ba00-787a28f0a70c?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:21:11.2114702+00:00\",\r\n \"endTime\": - \"2021-07-22T03:21:11.3833429+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"250423ba-8893-4fab-ac24-775975b73a13\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:23:13.2837026+00:00\",\r\n \"endTime\": + \"2021-09-02T03:23:15.002409+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"d8bc9513-4031-4699-ba00-787a28f0a70c\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:21:40 GMT + - Thu, 02 Sep 2021 03:23:42 GMT expires: - '-1' pragma: @@ -767,7 +767,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49982,Microsoft.Compute/GetOperation30Min;399943 + - Microsoft.Compute/GetOperation3Min;49982,Microsoft.Compute/GetOperation30Min;399978 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 28ef873f5393..ac51702e4774 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/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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 @@ -26,7 +26,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/1a3d8581-9fef-4b22-8107-ce19f6e65b08?api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/9745363b-1a25-49cb-b412-24a9f9c13f21?api-version=2019-03-01 cache-control: - no-cache content-length: @@ -34,11 +34,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:18:28 GMT + - Thu, 02 Sep 2021 03:20:31 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/1a3d8581-9fef-4b22-8107-ce19f6e65b08?monitor=true&api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/9745363b-1a25-49cb-b412-24a9f9c13f21?monitor=true&api-version=2019-03-01 pragma: - no-cache server: @@ -49,7 +49,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateUpdateDisks3Min;999,Microsoft.Compute/CreateUpdateDisks30Min;7991 + - Microsoft.Compute/CreateUpdateDisks3Min;999,Microsoft.Compute/CreateUpdateDisks30Min;7999 x-ms-ratelimit-remaining-subscription-writes: - '1199' status: @@ -65,24 +65,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/1a3d8581-9fef-4b22-8107-ce19f6e65b08?api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/9745363b-1a25-49cb-b412-24a9f9c13f21?api-version=2019-03-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:18:29.5815286+00:00\",\r\n \"endTime\": - \"2021-07-22T03:18:29.6909236+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T03:20:31.8601471+00:00\",\r\n \"endTime\": + \"2021-09-02T03:20:32.0320102+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\": \"2021-07-22T03:18:29.5971626+00:00\",\r\n + 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2021-09-02T03:20:31.8757611+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"90eb4b32-5160-461c-96d2-d51d516b9a88\"\r\n - \ }\r\n}\r\n },\r\n \"name\": \"1a3d8581-9fef-4b22-8107-ce19f6e65b08\"\r\n}" + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"3c982d32-0a66-4987-8d3e-31238cb72a99\"\r\n + \ }\r\n}\r\n },\r\n \"name\": \"9745363b-1a25-49cb-b412-24a9f9c13f21\"\r\n}" headers: cache-control: - no-cache @@ -91,7 +91,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:18:30 GMT + - Thu, 02 Sep 2021 03:20:33 GMT expires: - '-1' pragma: @@ -108,7 +108,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49999,Microsoft.Compute/GetOperation30Min;399928 + - Microsoft.Compute/GetOperation3Min;49999,Microsoft.Compute/GetOperation30Min;399999 status: code: 200 message: OK @@ -122,7 +122,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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 @@ -133,9 +133,9 @@ interactions: \ \"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\": \"2021-07-22T03:18:29.5971626+00:00\",\r\n + 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2021-09-02T03:20:31.8757611+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"90eb4b32-5160-461c-96d2-d51d516b9a88\"\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"3c982d32-0a66-4987-8d3e-31238cb72a99\"\r\n \ }\r\n}" headers: cache-control: @@ -145,7 +145,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:18:30 GMT + - Thu, 02 Sep 2021 03:20:33 GMT expires: - '-1' pragma: @@ -162,7 +162,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;14999,Microsoft.Compute/LowCostGet30Min;119806 + - Microsoft.Compute/LowCostGet3Min;14999,Microsoft.Compute/LowCostGet30Min;119999 status: code: 200 message: OK @@ -176,7 +176,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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 @@ -187,9 +187,9 @@ interactions: \ \"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\": \"2021-07-22T03:18:29.5971626+00:00\",\r\n + 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2021-09-02T03:20:31.8757611+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"90eb4b32-5160-461c-96d2-d51d516b9a88\"\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"3c982d32-0a66-4987-8d3e-31238cb72a99\"\r\n \ }\r\n}" headers: cache-control: @@ -199,7 +199,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:18:30 GMT + - Thu, 02 Sep 2021 03:20:33 GMT expires: - '-1' pragma: @@ -216,7 +216,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;14998,Microsoft.Compute/LowCostGet30Min;119805 + - Microsoft.Compute/LowCostGet3Min;14998,Microsoft.Compute/LowCostGet30Min;119998 status: code: 200 message: OK @@ -234,7 +234,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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 @@ -247,7 +247,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/999fbd53-54dd-43ed-a021-3577c36735a1?api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/899a778d-3e2e-4558-bb89-3119bc7717d9?api-version=2019-03-01 cache-control: - no-cache content-length: @@ -255,11 +255,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:18:30 GMT + - Thu, 02 Sep 2021 03:20:33 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/999fbd53-54dd-43ed-a021-3577c36735a1?monitor=true&api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/899a778d-3e2e-4558-bb89-3119bc7717d9?monitor=true&api-version=2019-03-01 pragma: - no-cache server: @@ -270,7 +270,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateUpdateDisks3Min;998,Microsoft.Compute/CreateUpdateDisks30Min;7990 + - Microsoft.Compute/CreateUpdateDisks3Min;998,Microsoft.Compute/CreateUpdateDisks30Min;7998 x-ms-ratelimit-remaining-subscription-writes: - '1198' status: @@ -286,24 +286,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/999fbd53-54dd-43ed-a021-3577c36735a1?api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/899a778d-3e2e-4558-bb89-3119bc7717d9?api-version=2019-03-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:18:31.8159304+00:00\",\r\n \"endTime\": - \"2021-07-22T03:18:31.9096807+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T03:20:34.1570253+00:00\",\r\n \"endTime\": + \"2021-09-02T03:20:34.2820027+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\": \"2021-07-22T03:18:29.5971626+00:00\",\r\n + 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2021-09-02T03:20:31.8757611+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"90eb4b32-5160-461c-96d2-d51d516b9a88\"\r\n - \ }\r\n}\r\n },\r\n \"name\": \"999fbd53-54dd-43ed-a021-3577c36735a1\"\r\n}" + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"3c982d32-0a66-4987-8d3e-31238cb72a99\"\r\n + \ }\r\n}\r\n },\r\n \"name\": \"899a778d-3e2e-4558-bb89-3119bc7717d9\"\r\n}" headers: cache-control: - no-cache @@ -312,7 +312,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:18:32 GMT + - Thu, 02 Sep 2021 03:20:35 GMT expires: - '-1' pragma: @@ -329,7 +329,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49998,Microsoft.Compute/GetOperation30Min;399927 + - Microsoft.Compute/GetOperation3Min;49998,Microsoft.Compute/GetOperation30Min;399998 status: code: 200 message: OK @@ -343,7 +343,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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 @@ -354,9 +354,9 @@ interactions: \ \"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\": \"2021-07-22T03:18:29.5971626+00:00\",\r\n + 500,\r\n \"diskMBpsReadWrite\": 60,\r\n \"timeCreated\": \"2021-09-02T03:20:31.8757611+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"90eb4b32-5160-461c-96d2-d51d516b9a88\"\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"3c982d32-0a66-4987-8d3e-31238cb72a99\"\r\n \ }\r\n}" headers: cache-control: @@ -366,7 +366,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:18:32 GMT + - Thu, 02 Sep 2021 03:20:35 GMT expires: - '-1' pragma: @@ -383,7 +383,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;14996,Microsoft.Compute/LowCostGet30Min;119803 + - Microsoft.Compute/LowCostGet3Min;14996,Microsoft.Compute/LowCostGet30Min;119996 status: code: 200 message: OK @@ -401,7 +401,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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 @@ -410,17 +410,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/c12c7572-db2e-44c5-9f65-d37eef241aac?api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/894284ec-d093-4a4c-a2c8-11dfe7784b33?api-version=2019-03-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:18:33 GMT + - Thu, 02 Sep 2021 03:20:35 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/c12c7572-db2e-44c5-9f65-d37eef241aac?monitor=true&api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/894284ec-d093-4a4c-a2c8-11dfe7784b33?monitor=true&api-version=2019-03-01 pragma: - no-cache server: @@ -447,25 +447,25 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/c12c7572-db2e-44c5-9f65-d37eef241aac?api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/894284ec-d093-4a4c-a2c8-11dfe7784b33?api-version=2019-03-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:18:33.9722127+00:00\",\r\n \"endTime\": - \"2021-07-22T03:18:34.2222213+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T03:20:36.3289144+00:00\",\r\n \"endTime\": + \"2021-09-02T03:20:36.6882601+00:00\",\r\n \"status\": \"Succeeded\",\r\n \ \"properties\": {\r\n \"output\": {\r\n \"accessSAS\": \"FakeUrl\"\r\n}\r\n - \ },\r\n \"name\": \"c12c7572-db2e-44c5-9f65-d37eef241aac\"\r\n}" + \ },\r\n \"name\": \"894284ec-d093-4a4c-a2c8-11dfe7784b33\"\r\n}" headers: cache-control: - no-cache content-length: - - '428' + - '430' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:19:03 GMT + - Thu, 02 Sep 2021 03:21:05 GMT expires: - '-1' pragma: @@ -482,7 +482,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49995,Microsoft.Compute/GetOperation30Min;399924 + - Microsoft.Compute/GetOperation3Min;49995,Microsoft.Compute/GetOperation30Min;399995 status: code: 200 message: OK @@ -496,10 +496,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/c12c7572-db2e-44c5-9f65-d37eef241aac?monitor=true&api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/894284ec-d093-4a4c-a2c8-11dfe7784b33?monitor=true&api-version=2019-03-01 response: body: string: "{\r\n \"accessSAS\": \"FakeUrl\"\r\n}" @@ -507,11 +507,11 @@ interactions: cache-control: - no-cache content-length: - - '203' + - '205' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:19:04 GMT + - Thu, 02 Sep 2021 03:21:05 GMT expires: - '-1' pragma: @@ -528,7 +528,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49994,Microsoft.Compute/GetOperation30Min;399923 + - Microsoft.Compute/GetOperation3Min;49994,Microsoft.Compute/GetOperation30Min;399994 status: code: 200 message: OK @@ -544,7 +544,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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 @@ -553,17 +553,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b37b2e39-bbc5-40b0-82e1-958fe43a180b?api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4e1280f4-2d10-4a8b-8b1b-82ccc164e640?api-version=2019-03-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:19:04 GMT + - Thu, 02 Sep 2021 03:21:05 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b37b2e39-bbc5-40b0-82e1-958fe43a180b?monitor=true&api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4e1280f4-2d10-4a8b-8b1b-82ccc164e640?monitor=true&api-version=2019-03-01 pragma: - no-cache server: @@ -590,24 +590,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b37b2e39-bbc5-40b0-82e1-958fe43a180b?api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4e1280f4-2d10-4a8b-8b1b-82ccc164e640?api-version=2019-03-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:19:04.2226061+00:00\",\r\n \"endTime\": - \"2021-07-22T03:19:04.363257+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"b37b2e39-bbc5-40b0-82e1-958fe43a180b\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:21:06.5793656+00:00\",\r\n \"endTime\": + \"2021-09-02T03:21:06.7199951+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"4e1280f4-2d10-4a8b-8b1b-82ccc164e640\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:19:33 GMT + - Thu, 02 Sep 2021 03:21:35 GMT expires: - '-1' pragma: @@ -624,7 +624,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49992,Microsoft.Compute/GetOperation30Min;399921 + - Microsoft.Compute/GetOperation3Min;49992,Microsoft.Compute/GetOperation30Min;399992 status: code: 200 message: OK @@ -638,10 +638,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/b37b2e39-bbc5-40b0-82e1-958fe43a180b?monitor=true&api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4e1280f4-2d10-4a8b-8b1b-82ccc164e640?monitor=true&api-version=2019-03-01 response: body: string: '' @@ -651,7 +651,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:19:33 GMT + - Thu, 02 Sep 2021 03:21:35 GMT expires: - '-1' pragma: @@ -664,7 +664,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49991,Microsoft.Compute/GetOperation30Min;399920 + - Microsoft.Compute/GetOperation3Min;49991,Microsoft.Compute/GetOperation30Min;399991 status: code: 200 message: OK @@ -680,7 +680,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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 @@ -689,17 +689,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8d41beed-c14e-48cd-873e-af8bbd6f9d4a?api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/6bfacc57-ab48-4f31-8c8c-0c299b0e6ea5?api-version=2019-03-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:19:34 GMT + - Thu, 02 Sep 2021 03:21:35 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8d41beed-c14e-48cd-873e-af8bbd6f9d4a?monitor=true&api-version=2019-03-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/6bfacc57-ab48-4f31-8c8c-0c299b0e6ea5?monitor=true&api-version=2019-03-01 pragma: - no-cache server: @@ -710,7 +710,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteDisks3Min;2999,Microsoft.Compute/DeleteDisks30Min;23938 + - Microsoft.Compute/DeleteDisks3Min;2999,Microsoft.Compute/DeleteDisks30Min;23999 x-ms-ratelimit-remaining-subscription-deletes: - '14999' status: @@ -726,24 +726,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8d41beed-c14e-48cd-873e-af8bbd6f9d4a?api-version=2019-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/6bfacc57-ab48-4f31-8c8c-0c299b0e6ea5?api-version=2019-03-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:19:34.4913642+00:00\",\r\n \"endTime\": - \"2021-07-22T03:19:34.6788461+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"8d41beed-c14e-48cd-873e-af8bbd6f9d4a\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:21:36.7832469+00:00\",\r\n \"endTime\": + \"2021-09-02T03:21:37.470822+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"6bfacc57-ab48-4f31-8c8c-0c299b0e6ea5\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:20:03 GMT + - Thu, 02 Sep 2021 03:22:06 GMT expires: - '-1' pragma: @@ -760,7 +760,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49989,Microsoft.Compute/GetOperation30Min;399954 + - Microsoft.Compute/GetOperation3Min;49989,Microsoft.Compute/GetOperation30Min;399989 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 7f2ae76beb0b..6b2632e4882c 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,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115?api-version=2020-12-01 @@ -26,7 +26,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/cb22a979-4764-4fa3-9eca-11d4a91f6f9a?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/f02954f9-2c0b-42a6-a4f6-e9fbe9d1d81b?api-version=2020-12-01 cache-control: - no-cache content-length: @@ -34,11 +34,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:21:42 GMT + - Thu, 02 Sep 2021 03:23:44 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/cb22a979-4764-4fa3-9eca-11d4a91f6f9a?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/f02954f9-2c0b-42a6-a4f6-e9fbe9d1d81b?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -49,7 +49,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateUpdateDisks3Min;997,Microsoft.Compute/CreateUpdateDisks30Min;7994 + - Microsoft.Compute/CreateUpdateDisks3Min;997,Microsoft.Compute/CreateUpdateDisks30Min;7995 x-ms-ratelimit-remaining-subscription-writes: - '1198' status: @@ -65,14 +65,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/cb22a979-4764-4fa3-9eca-11d4a91f6f9a?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/f02954f9-2c0b-42a6-a4f6-e9fbe9d1d81b?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:21:42.8680861+00:00\",\r\n \"endTime\": - \"2021-07-22T03:21:42.9932315+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T03:23:44.877505+00:00\",\r\n \"endTime\": + \"2021-09-02T03:23:44.9712745+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\",\r\n @@ -80,20 +80,20 @@ interactions: \ },\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 \"encryption\": {\r\n \"type\": - \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-07-22T03:21:42.8680861+00:00\",\r\n + \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-09-02T03:23:44.893143+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"cd5d03a1-237d-4ca3-9d5c-c2b5ff09082b\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"6a70f49f-01f5-4d00-ac83-19e368b1f7a9\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"name\": - \"cb22a979-4764-4fa3-9eca-11d4a91f6f9a\"\r\n}" + \"f02954f9-2c0b-42a6-a4f6-e9fbe9d1d81b\"\r\n}" headers: cache-control: - no-cache content-length: - - '1116' + - '1114' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:21:44 GMT + - Thu, 02 Sep 2021 03:23:46 GMT expires: - '-1' pragma: @@ -110,7 +110,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49981,Microsoft.Compute/GetOperation30Min;399942 + - Microsoft.Compute/GetOperation3Min;49981,Microsoft.Compute/GetOperation30Min;399977 status: code: 200 message: OK @@ -124,7 +124,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/disknamex66bb1115?api-version=2020-12-01 @@ -136,19 +136,19 @@ interactions: \ },\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 \"encryption\": {\r\n \"type\": - \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-07-22T03:21:42.8680861+00:00\",\r\n + \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-09-02T03:23:44.893143+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"cd5d03a1-237d-4ca3-9d5c-c2b5ff09082b\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"6a70f49f-01f5-4d00-ac83-19e368b1f7a9\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '891' + - '890' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:21:44 GMT + - Thu, 02 Sep 2021 03:23:46 GMT expires: - '-1' pragma: @@ -165,7 +165,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;14985,Microsoft.Compute/LowCostGet30Min;119845 + - Microsoft.Compute/LowCostGet3Min;14989,Microsoft.Compute/LowCostGet30Min;119983 status: code: 200 message: OK @@ -184,7 +184,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2020-12-01 @@ -192,12 +192,12 @@ interactions: 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\": \"cd5d03a1-237d-4ca3-9d5c-c2b5ff09082b\"\r\n },\r\n + \ \"sourceUniqueId\": \"6a70f49f-01f5-4d00-ac83-19e368b1f7a9\"\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/72f3a683-c6f2-4f75-8bd5-ec8c3ceacb34?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/c0a9ef50-0768-49c3-8dbb-6aba7d536ccd?api-version=2020-12-01 cache-control: - no-cache content-length: @@ -205,11 +205,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:21:44 GMT + - Thu, 02 Sep 2021 03:23:47 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/72f3a683-c6f2-4f75-8bd5-ec8c3ceacb34?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/c0a9ef50-0768-49c3-8dbb-6aba7d536ccd?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -236,36 +236,36 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/72f3a683-c6f2-4f75-8bd5-ec8c3ceacb34?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/c0a9ef50-0768-49c3-8dbb-6aba7d536ccd?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:21:45.2118579+00:00\",\r\n \"endTime\": - \"2021-07-22T03:21:45.9462601+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T03:23:47.2213146+00:00\",\r\n \"endTime\": + \"2021-09-02T03:23:48.424404+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\": \"cd5d03a1-237d-4ca3-9d5c-c2b5ff09082b\"\r\n },\r\n + \ \"sourceUniqueId\": \"6a70f49f-01f5-4d00-ac83-19e368b1f7a9\"\r\n },\r\n \ \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n - \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-07-22T03:21:45.2118579+00:00\",\r\n + \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-09-02T03:23:47.2213146+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"56e57f55-bea1-4873-a294-52eac325f353\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"e056c0da-b820-46bd-a567-b1703be1f3b5\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"name\": - \"72f3a683-c6f2-4f75-8bd5-ec8c3ceacb34\"\r\n}" + \"c0a9ef50-0768-49c3-8dbb-6aba7d536ccd\"\r\n}" headers: cache-control: - no-cache content-length: - - '1384' + - '1383' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:21:46 GMT + - Thu, 02 Sep 2021 03:23:49 GMT expires: - '-1' pragma: @@ -282,7 +282,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49980,Microsoft.Compute/GetOperation30Min;399941 + - Microsoft.Compute/GetOperation3Min;49980,Microsoft.Compute/GetOperation30Min;399976 status: code: 200 message: OK @@ -296,7 +296,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2020-12-01 @@ -307,11 +307,11 @@ interactions: \ \"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\": \"cd5d03a1-237d-4ca3-9d5c-c2b5ff09082b\"\r\n },\r\n + \ \"sourceUniqueId\": \"6a70f49f-01f5-4d00-ac83-19e368b1f7a9\"\r\n },\r\n \ \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n - \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-07-22T03:21:45.2118579+00:00\",\r\n + \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-09-02T03:23:47.2213146+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"56e57f55-bea1-4873-a294-52eac325f353\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"e056c0da-b820-46bd-a567-b1703be1f3b5\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: @@ -321,7 +321,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:21:46 GMT + - Thu, 02 Sep 2021 03:23:49 GMT expires: - '-1' pragma: @@ -338,7 +338,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;14984,Microsoft.Compute/LowCostGet30Min;119844 + - Microsoft.Compute/LowCostGet3Min;14988,Microsoft.Compute/LowCostGet30Min;119982 status: code: 200 message: OK @@ -359,10 +359,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"imagex66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115\",\r\n @@ -378,7 +378,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a604bd6a-b0ef-49d4-8aaf-a353c0830663?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6d0d7a7-16d8-479c-a608-b1368e89cf1a?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: @@ -386,7 +386,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:21:47 GMT + - Thu, 02 Sep 2021 03:23:49 GMT expires: - '-1' pragma: @@ -399,7 +399,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateImages3Min;39,Microsoft.Compute/CreateImages30Min;198 + - Microsoft.Compute/CreateImages3Min;39,Microsoft.Compute/CreateImages30Min;199 x-ms-ratelimit-remaining-subscription-writes: - '1196' status: @@ -415,15 +415,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a604bd6a-b0ef-49d4-8aaf-a353c0830663?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c6d0d7a7-16d8-479c-a608-b1368e89cf1a?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:21:47.5252002+00:00\",\r\n \"endTime\": - \"2021-07-22T03:21:52.6502365+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"a604bd6a-b0ef-49d4-8aaf-a353c0830663\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:23:49.5242572+00:00\",\r\n \"endTime\": + \"2021-09-02T03:23:54.6649042+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"c6d0d7a7-16d8-479c-a608-b1368e89cf1a\"\r\n}" headers: cache-control: - no-cache @@ -432,7 +432,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:22:17 GMT + - Thu, 02 Sep 2021 03:24:19 GMT expires: - '-1' pragma: @@ -449,7 +449,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29842 + - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29994 status: code: 200 message: OK @@ -463,10 +463,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"imagex66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115\",\r\n @@ -487,7 +487,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:22:17 GMT + - Thu, 02 Sep 2021 03:24:19 GMT expires: - '-1' pragma: @@ -504,7 +504,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetImages3Min;358,Microsoft.Compute/GetImages30Min;1789 + - Microsoft.Compute/GetImages3Min;358,Microsoft.Compute/GetImages30Min;1798 status: code: 200 message: OK @@ -518,7 +518,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2020-12-01 @@ -529,11 +529,11 @@ interactions: \ \"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\": \"cd5d03a1-237d-4ca3-9d5c-c2b5ff09082b\"\r\n },\r\n + \ \"sourceUniqueId\": \"6a70f49f-01f5-4d00-ac83-19e368b1f7a9\"\r\n },\r\n \ \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n - \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-07-22T03:21:45.2118579+00:00\",\r\n + \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-09-02T03:23:47.2213146+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"56e57f55-bea1-4873-a294-52eac325f353\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"e056c0da-b820-46bd-a567-b1703be1f3b5\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: @@ -543,7 +543,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:22:17 GMT + - Thu, 02 Sep 2021 03:24:19 GMT expires: - '-1' pragma: @@ -560,7 +560,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;14980,Microsoft.Compute/LowCostGet30Min;119838 + - Microsoft.Compute/LowCostGet3Min;14982,Microsoft.Compute/LowCostGet30Min;119976 status: code: 200 message: OK @@ -574,10 +574,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"imagex66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115\",\r\n @@ -598,7 +598,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:22:17 GMT + - Thu, 02 Sep 2021 03:24:19 GMT expires: - '-1' pragma: @@ -615,7 +615,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetImages3Min;357,Microsoft.Compute/GetImages30Min;1788 + - Microsoft.Compute/GetImages3Min;357,Microsoft.Compute/GetImages30Min;1797 status: code: 200 message: OK @@ -633,10 +633,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"imagex66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115\",\r\n @@ -653,7 +653,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fc251a45-25de-4699-aca2-a5c4559b781f?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e2603c57-edd0-4a9a-8adc-390fb361d6d1?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: @@ -661,7 +661,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:22:17 GMT + - Thu, 02 Sep 2021 03:24:20 GMT expires: - '-1' pragma: @@ -678,7 +678,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateImages3Min;38,Microsoft.Compute/CreateImages30Min;197 + - Microsoft.Compute/CreateImages3Min;38,Microsoft.Compute/CreateImages30Min;198 x-ms-ratelimit-remaining-subscription-writes: - '1195' status: @@ -694,15 +694,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fc251a45-25de-4699-aca2-a5c4559b781f?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e2603c57-edd0-4a9a-8adc-390fb361d6d1?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:22:17.9158445+00:00\",\r\n \"endTime\": - \"2021-07-22T03:22:23.0408535+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"fc251a45-25de-4699-aca2-a5c4559b781f\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:24:20.0244422+00:00\",\r\n \"endTime\": + \"2021-09-02T03:24:25.0869757+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"e2603c57-edd0-4a9a-8adc-390fb361d6d1\"\r\n}" headers: cache-control: - no-cache @@ -711,7 +711,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:22:47 GMT + - Thu, 02 Sep 2021 03:24:49 GMT expires: - '-1' pragma: @@ -728,7 +728,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29839 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29992 status: code: 200 message: OK @@ -742,10 +742,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"imagex66bb1115\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115\",\r\n @@ -766,7 +766,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:22:47 GMT + - Thu, 02 Sep 2021 03:24:49 GMT expires: - '-1' pragma: @@ -783,7 +783,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetImages3Min;355,Microsoft.Compute/GetImages30Min;1786 + - Microsoft.Compute/GetImages3Min;355,Microsoft.Compute/GetImages30Min;1795 status: code: 200 message: OK @@ -801,7 +801,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2020-12-01 @@ -810,12 +810,12 @@ interactions: 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\": \"cd5d03a1-237d-4ca3-9d5c-c2b5ff09082b\"\r\n },\r\n + \ \"sourceUniqueId\": \"6a70f49f-01f5-4d00-ac83-19e368b1f7a9\"\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/efb88858-af7c-457e-9e2a-4e34faf3b513?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/44b8a299-2bdf-4848-85b9-fc7dda117530?api-version=2020-12-01 cache-control: - no-cache content-length: @@ -823,11 +823,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:22:47 GMT + - Thu, 02 Sep 2021 03:24:50 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/efb88858-af7c-457e-9e2a-4e34faf3b513?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/44b8a299-2bdf-4848-85b9-fc7dda117530?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -838,7 +838,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateUpdateDisks3Min;996,Microsoft.Compute/CreateUpdateDisks30Min;7993 + - Microsoft.Compute/CreateUpdateDisks3Min;996,Microsoft.Compute/CreateUpdateDisks30Min;7994 x-ms-ratelimit-remaining-subscription-writes: - '1194' status: @@ -854,27 +854,27 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/efb88858-af7c-457e-9e2a-4e34faf3b513?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/44b8a299-2bdf-4848-85b9-fc7dda117530?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:22:48.3531969+00:00\",\r\n \"endTime\": - \"2021-07-22T03:22:48.4938027+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T03:24:50.3631109+00:00\",\r\n \"endTime\": + \"2021-09-02T03:24:50.4724644+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\": \"cd5d03a1-237d-4ca3-9d5c-c2b5ff09082b\"\r\n },\r\n + \ \"sourceUniqueId\": \"6a70f49f-01f5-4d00-ac83-19e368b1f7a9\"\r\n },\r\n \ \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n - \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-07-22T03:21:45.2118579+00:00\",\r\n + \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-09-02T03:23:47.2213146+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"56e57f55-bea1-4873-a294-52eac325f353\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"e056c0da-b820-46bd-a567-b1703be1f3b5\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"name\": - \"efb88858-af7c-457e-9e2a-4e34faf3b513\"\r\n}" + \"44b8a299-2bdf-4848-85b9-fc7dda117530\"\r\n}" headers: cache-control: - no-cache @@ -883,7 +883,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:22:49 GMT + - Thu, 02 Sep 2021 03:24:52 GMT expires: - '-1' pragma: @@ -900,7 +900,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49979,Microsoft.Compute/GetOperation30Min;399934 + - Microsoft.Compute/GetOperation3Min;49979,Microsoft.Compute/GetOperation30Min;399969 status: code: 200 message: OK @@ -914,7 +914,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2020-12-01 @@ -925,11 +925,11 @@ interactions: \ \"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\": \"cd5d03a1-237d-4ca3-9d5c-c2b5ff09082b\"\r\n },\r\n + \ \"sourceUniqueId\": \"6a70f49f-01f5-4d00-ac83-19e368b1f7a9\"\r\n },\r\n \ \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n - \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-07-22T03:21:45.2118579+00:00\",\r\n + \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-09-02T03:23:47.2213146+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"56e57f55-bea1-4873-a294-52eac325f353\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"e056c0da-b820-46bd-a567-b1703be1f3b5\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: @@ -939,7 +939,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:22:49 GMT + - Thu, 02 Sep 2021 03:24:52 GMT expires: - '-1' pragma: @@ -956,7 +956,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;14978,Microsoft.Compute/LowCostGet30Min;119834 + - Microsoft.Compute/LowCostGet3Min;14982,Microsoft.Compute/LowCostGet30Min;119974 status: code: 200 message: OK @@ -974,7 +974,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115/beginGetAccess?api-version=2020-12-01 @@ -983,17 +983,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/0f5848af-782e-4a3f-991e-2b5c7f504e3d?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5a939299-ed7f-4155-9f65-7a8463ab3c26?api-version=2020-12-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:22:49 GMT + - Thu, 02 Sep 2021 03:24:52 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/0f5848af-782e-4a3f-991e-2b5c7f504e3d?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5a939299-ed7f-4155-9f65-7a8463ab3c26?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -1020,25 +1020,25 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/0f5848af-782e-4a3f-991e-2b5c7f504e3d?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5a939299-ed7f-4155-9f65-7a8463ab3c26?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:22:50.5251012+00:00\",\r\n \"endTime\": - \"2021-07-22T03:22:50.6657301+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T03:24:52.5506314+00:00\",\r\n \"endTime\": + \"2021-09-02T03:24:52.6756216+00:00\",\r\n \"status\": \"Succeeded\",\r\n \ \"properties\": {\r\n \"output\": {\r\n \"accessSAS\": \"FakeUrl\"\r\n}\r\n - \ },\r\n \"name\": \"0f5848af-782e-4a3f-991e-2b5c7f504e3d\"\r\n}" + \ },\r\n \"name\": \"5a939299-ed7f-4155-9f65-7a8463ab3c26\"\r\n}" headers: cache-control: - no-cache content-length: - - '428' + - '426' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:23:20 GMT + - Thu, 02 Sep 2021 03:25:22 GMT expires: - '-1' pragma: @@ -1055,7 +1055,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49982,Microsoft.Compute/GetOperation30Min;399932 + - Microsoft.Compute/GetOperation3Min;49982,Microsoft.Compute/GetOperation30Min;399967 status: code: 200 message: OK @@ -1069,10 +1069,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/0f5848af-782e-4a3f-991e-2b5c7f504e3d?monitor=true&api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/5a939299-ed7f-4155-9f65-7a8463ab3c26?monitor=true&api-version=2020-12-01 response: body: string: "{\r\n \"accessSAS\": \"FakeUrl\"\r\n}" @@ -1080,11 +1080,11 @@ interactions: cache-control: - no-cache content-length: - - '203' + - '201' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:23:20 GMT + - Thu, 02 Sep 2021 03:25:22 GMT expires: - '-1' pragma: @@ -1101,7 +1101,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49981,Microsoft.Compute/GetOperation30Min;399931 + - Microsoft.Compute/GetOperation3Min;49981,Microsoft.Compute/GetOperation30Min;399966 status: code: 200 message: OK @@ -1117,7 +1117,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115/endGetAccess?api-version=2020-12-01 @@ -1126,17 +1126,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d16091ea-01fa-4ae5-ba63-eddf38a0f5ad?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/a90ee979-b9d8-421d-92b3-5d5ee2e717e7?api-version=2020-12-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:23:20 GMT + - Thu, 02 Sep 2021 03:25:22 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d16091ea-01fa-4ae5-ba63-eddf38a0f5ad?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/a90ee979-b9d8-421d-92b3-5d5ee2e717e7?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -1163,15 +1163,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d16091ea-01fa-4ae5-ba63-eddf38a0f5ad?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/a90ee979-b9d8-421d-92b3-5d5ee2e717e7?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:23:20.7754706+00:00\",\r\n \"endTime\": - \"2021-07-22T03:23:20.9316923+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"d16091ea-01fa-4ae5-ba63-eddf38a0f5ad\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:25:22.8632843+00:00\",\r\n \"endTime\": + \"2021-09-02T03:25:22.9726213+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"a90ee979-b9d8-421d-92b3-5d5ee2e717e7\"\r\n}" headers: cache-control: - no-cache @@ -1180,7 +1180,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:23:50 GMT + - Thu, 02 Sep 2021 03:25:52 GMT expires: - '-1' pragma: @@ -1197,7 +1197,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49982,Microsoft.Compute/GetOperation30Min;399929 + - Microsoft.Compute/GetOperation3Min;49982,Microsoft.Compute/GetOperation30Min;399964 status: code: 200 message: OK @@ -1211,10 +1211,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/d16091ea-01fa-4ae5-ba63-eddf38a0f5ad?monitor=true&api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/a90ee979-b9d8-421d-92b3-5d5ee2e717e7?monitor=true&api-version=2020-12-01 response: body: string: '' @@ -1224,7 +1224,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:23:50 GMT + - Thu, 02 Sep 2021 03:25:52 GMT expires: - '-1' pragma: @@ -1237,7 +1237,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49981,Microsoft.Compute/GetOperation30Min;399928 + - Microsoft.Compute/GetOperation3Min;49981,Microsoft.Compute/GetOperation30Min;399963 status: code: 200 message: OK @@ -1253,10 +1253,10 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/images/imagex66bb1115?api-version=2021-07-01 response: body: string: '' @@ -1264,17 +1264,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/542ab968-bd22-482a-b160-87ff4735daaf?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/579b9da3-8773-4eff-9c7e-ea6bc9157dd8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:23:50 GMT + - Thu, 02 Sep 2021 03:25:52 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/542ab968-bd22-482a-b160-87ff4735daaf?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/579b9da3-8773-4eff-9c7e-ea6bc9157dd8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1285,7 +1285,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteImages3Min;119,Microsoft.Compute/DeleteImages30Min;596 + - Microsoft.Compute/DeleteImages3Min;119,Microsoft.Compute/DeleteImages30Min;599 x-ms-ratelimit-remaining-subscription-deletes: - '14998' status: @@ -1301,24 +1301,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/542ab968-bd22-482a-b160-87ff4735daaf?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/579b9da3-8773-4eff-9c7e-ea6bc9157dd8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:23:51.087726+00:00\",\r\n \"endTime\": - \"2021-07-22T03:23:56.1970929+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"542ab968-bd22-482a-b160-87ff4735daaf\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:25:53.1188887+00:00\",\r\n \"endTime\": + \"2021-09-02T03:25:58.1970878+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"579b9da3-8773-4eff-9c7e-ea6bc9157dd8\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:24:20 GMT + - Thu, 02 Sep 2021 03:26:22 GMT expires: - '-1' pragma: @@ -1335,7 +1335,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29833 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29990 status: code: 200 message: OK @@ -1351,7 +1351,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotx66bb1115?api-version=2020-12-01 @@ -1360,17 +1360,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ca67907e-abfb-45fd-ae11-c03561e032ea?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/651384be-ee28-4c62-ae38-bbabea0cc793?api-version=2020-12-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:24:20 GMT + - Thu, 02 Sep 2021 03:26:22 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ca67907e-abfb-45fd-ae11-c03561e032ea?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/651384be-ee28-4c62-ae38-bbabea0cc793?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -1381,7 +1381,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteDisks3Min;2999,Microsoft.Compute/DeleteDisks30Min;23968 + - Microsoft.Compute/DeleteDisks3Min;2999,Microsoft.Compute/DeleteDisks30Min;23997 x-ms-ratelimit-remaining-subscription-deletes: - '14997' status: @@ -1397,15 +1397,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/ca67907e-abfb-45fd-ae11-c03561e032ea?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/651384be-ee28-4c62-ae38-bbabea0cc793?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:24:21.3230148+00:00\",\r\n \"endTime\": - \"2021-07-22T03:24:21.5261483+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"ca67907e-abfb-45fd-ae11-c03561e032ea\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:26:23.3635786+00:00\",\r\n \"endTime\": + \"2021-09-02T03:26:24.9573445+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"651384be-ee28-4c62-ae38-bbabea0cc793\"\r\n}" headers: cache-control: - no-cache @@ -1414,7 +1414,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:24:50 GMT + - Thu, 02 Sep 2021 03:26:53 GMT expires: - '-1' pragma: @@ -1431,7 +1431,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49987,Microsoft.Compute/GetOperation30Min;399924 + - Microsoft.Compute/GetOperation3Min;49987,Microsoft.Compute/GetOperation30Min;399959 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 78831c427103..0b67616944bb 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,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/diskname10bb14a9?api-version=2020-12-01 @@ -26,7 +26,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/8328ed05-6275-4328-8582-2f916b6bb6cb?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4c07791d-deb2-4639-b60a-2bb8174002e8?api-version=2020-12-01 cache-control: - no-cache content-length: @@ -34,11 +34,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:24:52 GMT + - Thu, 02 Sep 2021 03:26:55 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8328ed05-6275-4328-8582-2f916b6bb6cb?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4c07791d-deb2-4639-b60a-2bb8174002e8?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -49,9 +49,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;7993 x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1193' status: code: 202 message: Accepted @@ -65,14 +65,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8328ed05-6275-4328-8582-2f916b6bb6cb?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4c07791d-deb2-4639-b60a-2bb8174002e8?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:24:53.2921328+00:00\",\r\n \"endTime\": - \"2021-07-22T03:24:53.3859219+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T03:26:55.2699636+00:00\",\r\n \"endTime\": + \"2021-09-02T03:26:55.3637136+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\",\r\n @@ -80,11 +80,11 @@ interactions: \ },\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 \"encryption\": {\r\n \"type\": - \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-07-22T03:24:53.2921328+00:00\",\r\n + \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-09-02T03:26:55.2855691+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"bf747e9d-e440-466e-babf-515abdc702cd\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"7a0a2f9c-27e5-4c8e-ac3f-1c7cbf14fc03\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"name\": - \"8328ed05-6275-4328-8582-2f916b6bb6cb\"\r\n}" + \"4c07791d-deb2-4639-b60a-2bb8174002e8\"\r\n}" headers: cache-control: - no-cache @@ -93,7 +93,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:24:54 GMT + - Thu, 02 Sep 2021 03:26:57 GMT expires: - '-1' pragma: @@ -110,7 +110,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49986,Microsoft.Compute/GetOperation30Min;399923 + - Microsoft.Compute/GetOperation3Min;49986,Microsoft.Compute/GetOperation30Min;399958 status: code: 200 message: OK @@ -124,7 +124,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/diskname10bb14a9?api-version=2020-12-01 @@ -136,9 +136,9 @@ interactions: \ },\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 \"encryption\": {\r\n \"type\": - \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-07-22T03:24:53.2921328+00:00\",\r\n + \"EncryptionAtRestWithPlatformKey\"\r\n },\r\n \"timeCreated\": \"2021-09-02T03:26:55.2855691+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"bf747e9d-e440-466e-babf-515abdc702cd\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"7a0a2f9c-27e5-4c8e-ac3f-1c7cbf14fc03\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: @@ -148,7 +148,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:24:54 GMT + - Thu, 02 Sep 2021 03:26:57 GMT expires: - '-1' pragma: @@ -165,7 +165,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;14990,Microsoft.Compute/LowCostGet30Min;119829 + - Microsoft.Compute/LowCostGet3Min;14992,Microsoft.Compute/LowCostGet30Min;119969 status: code: 200 message: OK @@ -184,7 +184,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9?api-version=2020-12-01 @@ -192,12 +192,12 @@ interactions: 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\": \"bf747e9d-e440-466e-babf-515abdc702cd\"\r\n },\r\n + \ \"sourceUniqueId\": \"7a0a2f9c-27e5-4c8e-ac3f-1c7cbf14fc03\"\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/8d5e70ab-530b-499f-b712-d67cac05b228?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/666dacfe-8955-4407-8de8-2a257a28f30c?api-version=2020-12-01 cache-control: - no-cache content-length: @@ -205,11 +205,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:24:55 GMT + - Thu, 02 Sep 2021 03:26:57 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8d5e70ab-530b-499f-b712-d67cac05b228?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/666dacfe-8955-4407-8de8-2a257a28f30c?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -222,7 +222,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/HighCostSnapshotCreateHydrate3Min;997,Microsoft.Compute/HighCostSnapshotCreateHydrate30Min;7996 x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1192' status: code: 202 message: Accepted @@ -236,27 +236,27 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8d5e70ab-530b-499f-b712-d67cac05b228?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/666dacfe-8955-4407-8de8-2a257a28f30c?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:24:55.6671605+00:00\",\r\n \"endTime\": - \"2021-07-22T03:24:56.2921684+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T03:26:57.5668356+00:00\",\r\n \"endTime\": + \"2021-09-02T03:26:58.3949726+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\": \"bf747e9d-e440-466e-babf-515abdc702cd\"\r\n },\r\n + \ \"sourceUniqueId\": \"7a0a2f9c-27e5-4c8e-ac3f-1c7cbf14fc03\"\r\n },\r\n \ \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n - \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-07-22T03:24:55.6671605+00:00\",\r\n + \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-09-02T03:26:57.5668356+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"d7114907-9318-4f63-8fab-b488fc499f69\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"fce3e0f5-b6d7-453c-89bc-3a2edbae5230\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}\r\n },\r\n \"name\": - \"8d5e70ab-530b-499f-b712-d67cac05b228\"\r\n}" + \"666dacfe-8955-4407-8de8-2a257a28f30c\"\r\n}" headers: cache-control: - no-cache @@ -265,7 +265,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:24:57 GMT + - Thu, 02 Sep 2021 03:26:59 GMT expires: - '-1' pragma: @@ -282,7 +282,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49985,Microsoft.Compute/GetOperation30Min;399922 + - Microsoft.Compute/GetOperation3Min;49985,Microsoft.Compute/GetOperation30Min;399957 status: code: 200 message: OK @@ -296,7 +296,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9?api-version=2020-12-01 @@ -307,11 +307,11 @@ interactions: \ \"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\": \"bf747e9d-e440-466e-babf-515abdc702cd\"\r\n },\r\n + \ \"sourceUniqueId\": \"7a0a2f9c-27e5-4c8e-ac3f-1c7cbf14fc03\"\r\n },\r\n \ \"diskSizeGB\": 200,\r\n \"encryption\": {\r\n \"type\": \"EncryptionAtRestWithPlatformKey\"\r\n - \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-07-22T03:24:55.6671605+00:00\",\r\n + \ },\r\n \"incremental\": false,\r\n \"timeCreated\": \"2021-09-02T03:26:57.5668356+00:00\",\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\",\r\n - \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"d7114907-9318-4f63-8fab-b488fc499f69\",\r\n + \ \"diskSizeBytes\": 214748364800,\r\n \"uniqueId\": \"fce3e0f5-b6d7-453c-89bc-3a2edbae5230\",\r\n \ \"networkAccessPolicy\": \"AllowAll\"\r\n }\r\n}" headers: cache-control: @@ -321,7 +321,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:24:57 GMT + - Thu, 02 Sep 2021 03:26:59 GMT expires: - '-1' pragma: @@ -338,7 +338,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;14989,Microsoft.Compute/LowCostGet30Min;119828 + - Microsoft.Compute/LowCostGet3Min;14991,Microsoft.Compute/LowCostGet30Min;119968 status: code: 200 message: OK @@ -357,29 +357,29 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"galleryname10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9\",\r\n \ \"type\": \"Microsoft.Compute/galleries\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"description\": \"This is the gallery description.\",\r\n \ \"identifier\": {\r\n \"uniqueName\": \"00000000-0000-0000-0000-000000000000-GALLERYNAME10BB14A9\"\r\n - \ },\r\n \"sharingProfile\": {\r\n \"permissions\": \"Private\"\r\n - \ },\r\n \"provisioningState\": \"Creating\"\r\n }\r\n}" + \ },\r\n \"provisioningState\": \"Creating\",\r\n \"softDeletePolicy\": + {\r\n \"isSoftDeleteEnabled\": false\r\n }\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/03e60bd5-da37-4db5-9feb-fd2c674ab55a?api-version=2020-09-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/c28aae9e-a0e0-433e-b89a-c22e6195d56b?api-version=2021-07-01 cache-control: - no-cache content-length: - - '614' + - '620' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:24:57 GMT + - Thu, 02 Sep 2021 03:26:59 GMT expires: - '-1' pragma: @@ -394,7 +394,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGallery3Min;49,Microsoft.Compute/CreateUpdateGallery30Min;299 x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1191' status: code: 201 message: Created @@ -408,15 +408,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/03e60bd5-da37-4db5-9feb-fd2c674ab55a?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/c28aae9e-a0e0-433e-b89a-c22e6195d56b?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:24:58.0371312+00:00\",\r\n \"endTime\": - \"2021-07-22T03:24:58.2558758+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"03e60bd5-da37-4db5-9feb-fd2c674ab55a\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:26:59.9287698+00:00\",\r\n \"endTime\": + \"2021-09-02T03:27:00.3037645+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"c28aae9e-a0e0-433e-b89a-c22e6195d56b\"\r\n}" headers: cache-control: - no-cache @@ -425,7 +425,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:25:27 GMT + - Thu, 02 Sep 2021 03:27:29 GMT expires: - '-1' pragma: @@ -456,26 +456,27 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"galleryname10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9\",\r\n \ \"type\": \"Microsoft.Compute/galleries\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"description\": \"This is the gallery description.\",\r\n \ \"identifier\": {\r\n \"uniqueName\": \"00000000-0000-0000-0000-000000000000-GALLERYNAME10BB14A9\"\r\n - \ },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" + \ },\r\n \"provisioningState\": \"Succeeded\",\r\n \"softDeletePolicy\": + {\r\n \"isSoftDeleteEnabled\": false\r\n }\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '550' + - '621' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:25:27 GMT + - Thu, 02 Sep 2021 03:27:29 GMT expires: - '-1' pragma: @@ -512,10 +513,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"applicationname10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9\",\r\n @@ -531,7 +532,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:25:27 GMT + - Thu, 02 Sep 2021 03:27:30 GMT expires: - '-1' pragma: @@ -546,7 +547,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGalleryApplication3Min;149,Microsoft.Compute/CreateUpdateGalleryApplication30Min;749 x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1190' status: code: 201 message: Created @@ -560,10 +561,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"applicationname10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9\",\r\n @@ -579,7 +580,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:25:58 GMT + - Thu, 02 Sep 2021 03:27:59 GMT expires: - '-1' pragma: @@ -616,30 +617,30 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"imagex10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9\",\r\n \ \"type\": \"Microsoft.Compute/galleries/images\",\r\n \"location\": \"eastus\",\r\n - \ \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"osType\": - \"Windows\",\r\n \"osState\": \"Generalized\",\r\n \"identifier\": {\r\n - \ \"publisher\": \"myPublisherName\",\r\n \"offer\": \"myOfferName\",\r\n - \ \"sku\": \"mySkuName\"\r\n },\r\n \"provisioningState\": \"Creating\"\r\n - \ }\r\n}" + \ \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"architecture\": + \"x64\",\r\n \"osType\": \"Windows\",\r\n \"osState\": \"Generalized\",\r\n + \ \"identifier\": {\r\n \"publisher\": \"myPublisherName\",\r\n \"offer\": + \"myOfferName\",\r\n \"sku\": \"mySkuName\"\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/7f5b262e-8df2-4d7d-b5aa-d1ca4aff176d?api-version=2020-09-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/7923e2fa-b1f6-4fe1-a4c9-ba6a3acca821?api-version=2021-07-01 cache-control: - no-cache content-length: - - '621' + - '649' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:25:58 GMT + - Thu, 02 Sep 2021 03:28:00 GMT expires: - '-1' pragma: @@ -654,7 +655,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGalleryImage3Min;149,Microsoft.Compute/CreateUpdateGalleryImage30Min;749 x-ms-ratelimit-remaining-subscription-writes: - - '1192' + - '1189' status: code: 201 message: Created @@ -668,24 +669,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/7f5b262e-8df2-4d7d-b5aa-d1ca4aff176d?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/7923e2fa-b1f6-4fe1-a4c9-ba6a3acca821?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:25:58.6781008+00:00\",\r\n \"endTime\": - \"2021-07-22T03:25:58.787456+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"7f5b262e-8df2-4d7d-b5aa-d1ca4aff176d\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:28:00.6319139+00:00\",\r\n \"endTime\": + \"2021-09-02T03:28:00.7725317+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"7923e2fa-b1f6-4fe1-a4c9-ba6a3acca821\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:26:28 GMT + - Thu, 02 Sep 2021 03:28:30 GMT expires: - '-1' pragma: @@ -716,28 +717,28 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"imagex10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9\",\r\n \ \"type\": \"Microsoft.Compute/galleries/images\",\r\n \"location\": \"eastus\",\r\n - \ \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"osType\": - \"Windows\",\r\n \"osState\": \"Generalized\",\r\n \"identifier\": {\r\n - \ \"publisher\": \"myPublisherName\",\r\n \"offer\": \"myOfferName\",\r\n - \ \"sku\": \"mySkuName\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n - \ }\r\n}" + \ \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"architecture\": + \"x64\",\r\n \"osType\": \"Windows\",\r\n \"osState\": \"Generalized\",\r\n + \ \"identifier\": {\r\n \"publisher\": \"myPublisherName\",\r\n \"offer\": + \"myOfferName\",\r\n \"sku\": \"mySkuName\"\r\n },\r\n \"provisioningState\": + \"Succeeded\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '622' + - '650' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:26:28 GMT + - Thu, 02 Sep 2021 03:28:30 GMT expires: - '-1' pragma: @@ -775,10 +776,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2020-09-30 + 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=2021-07-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\",\r\n @@ -787,7 +788,7 @@ interactions: [\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\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"storageAccountType\": + \ \"publishedDate\": \"2021-09-02T03:28:31.0693976+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\"\r\n @@ -795,7 +796,7 @@ interactions: \ }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9c59a3c6-9871-4bbe-b6d1-110bd86d83a8?api-version=2021-07-01 cache-control: - no-cache content-length: @@ -803,7 +804,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:26:29 GMT + - Thu, 02 Sep 2021 03:28:30 GMT expires: - '-1' pragma: @@ -818,7 +819,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGalleryImageVersion3Min;374,Microsoft.Compute/CreateUpdateGalleryImageVersion30Min;1199 x-ms-ratelimit-remaining-subscription-writes: - - '1191' + - '1188' status: code: 201 message: Created @@ -832,14 +833,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9c59a3c6-9871-4bbe-b6d1-110bd86d83a8?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"e858710f-483e-4f91-9d0e-9935898bbe82\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:28:31.0693976+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"9c59a3c6-9871-4bbe-b6d1-110bd86d83a8\"\r\n}" headers: cache-control: - no-cache @@ -848,7 +849,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:27:28 GMT + - Thu, 02 Sep 2021 03:29:31 GMT expires: - '-1' pragma: @@ -865,7 +866,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4195 + - Microsoft.Compute/GetOperationStatus3Min;1194,Microsoft.Compute/GetOperationStatus30Min;4194 status: code: 200 message: OK @@ -879,14 +880,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9c59a3c6-9871-4bbe-b6d1-110bd86d83a8?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"e858710f-483e-4f91-9d0e-9935898bbe82\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:28:31.0693976+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"9c59a3c6-9871-4bbe-b6d1-110bd86d83a8\"\r\n}" headers: cache-control: - no-cache @@ -895,7 +896,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:28:29 GMT + - Thu, 02 Sep 2021 03:30:31 GMT expires: - '-1' pragma: @@ -926,14 +927,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9c59a3c6-9871-4bbe-b6d1-110bd86d83a8?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"e858710f-483e-4f91-9d0e-9935898bbe82\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:28:31.0693976+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"9c59a3c6-9871-4bbe-b6d1-110bd86d83a8\"\r\n}" headers: cache-control: - no-cache @@ -942,7 +943,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:29:29 GMT + - Thu, 02 Sep 2021 03:31:30 GMT expires: - '-1' pragma: @@ -973,14 +974,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9c59a3c6-9871-4bbe-b6d1-110bd86d83a8?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"e858710f-483e-4f91-9d0e-9935898bbe82\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:28:31.0693976+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"9c59a3c6-9871-4bbe-b6d1-110bd86d83a8\"\r\n}" headers: cache-control: - no-cache @@ -989,7 +990,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:30:28 GMT + - Thu, 02 Sep 2021 03:32:31 GMT expires: - '-1' pragma: @@ -1006,7 +1007,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1194,Microsoft.Compute/GetOperationStatus30Min;4189 + - Microsoft.Compute/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4189 status: code: 200 message: OK @@ -1020,14 +1021,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9c59a3c6-9871-4bbe-b6d1-110bd86d83a8?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"e858710f-483e-4f91-9d0e-9935898bbe82\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:28:31.0693976+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"9c59a3c6-9871-4bbe-b6d1-110bd86d83a8\"\r\n}" headers: cache-control: - no-cache @@ -1036,7 +1037,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:31:29 GMT + - Thu, 02 Sep 2021 03:33:31 GMT expires: - '-1' pragma: @@ -1053,7 +1054,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1194,Microsoft.Compute/GetOperationStatus30Min;4187 + - Microsoft.Compute/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4187 status: code: 200 message: OK @@ -1067,14 +1068,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9c59a3c6-9871-4bbe-b6d1-110bd86d83a8?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"e858710f-483e-4f91-9d0e-9935898bbe82\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:28:31.0693976+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"9c59a3c6-9871-4bbe-b6d1-110bd86d83a8\"\r\n}" headers: cache-control: - no-cache @@ -1083,7 +1084,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:32:29 GMT + - Thu, 02 Sep 2021 03:34:31 GMT expires: - '-1' pragma: @@ -1100,7 +1101,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1194,Microsoft.Compute/GetOperationStatus30Min;4185 + - Microsoft.Compute/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4185 status: code: 200 message: OK @@ -1114,14 +1115,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9c59a3c6-9871-4bbe-b6d1-110bd86d83a8?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"e858710f-483e-4f91-9d0e-9935898bbe82\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:28:31.0693976+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"9c59a3c6-9871-4bbe-b6d1-110bd86d83a8\"\r\n}" headers: cache-control: - no-cache @@ -1130,7 +1131,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:33:29 GMT + - Thu, 02 Sep 2021 03:35:31 GMT expires: - '-1' pragma: @@ -1161,14 +1162,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9c59a3c6-9871-4bbe-b6d1-110bd86d83a8?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"e858710f-483e-4f91-9d0e-9935898bbe82\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:28:31.0693976+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"9c59a3c6-9871-4bbe-b6d1-110bd86d83a8\"\r\n}" headers: cache-control: - no-cache @@ -1177,7 +1178,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:34:29 GMT + - Thu, 02 Sep 2021 03:36:31 GMT expires: - '-1' pragma: @@ -1208,14 +1209,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9c59a3c6-9871-4bbe-b6d1-110bd86d83a8?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"e858710f-483e-4f91-9d0e-9935898bbe82\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:28:31.0693976+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"9c59a3c6-9871-4bbe-b6d1-110bd86d83a8\"\r\n}" headers: cache-control: - no-cache @@ -1224,7 +1225,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:35:29 GMT + - Thu, 02 Sep 2021 03:37:31 GMT expires: - '-1' pragma: @@ -1255,14 +1256,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9c59a3c6-9871-4bbe-b6d1-110bd86d83a8?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"e858710f-483e-4f91-9d0e-9935898bbe82\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:28:31.0693976+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"9c59a3c6-9871-4bbe-b6d1-110bd86d83a8\"\r\n}" headers: cache-control: - no-cache @@ -1271,7 +1272,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:36:30 GMT + - Thu, 02 Sep 2021 03:38:32 GMT expires: - '-1' pragma: @@ -1302,14 +1303,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9c59a3c6-9871-4bbe-b6d1-110bd86d83a8?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"e858710f-483e-4f91-9d0e-9935898bbe82\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:28:31.0693976+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"9c59a3c6-9871-4bbe-b6d1-110bd86d83a8\"\r\n}" headers: cache-control: - no-cache @@ -1318,7 +1319,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:37:29 GMT + - Thu, 02 Sep 2021 03:39:31 GMT expires: - '-1' pragma: @@ -1349,62 +1350,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 - response: - body: - string: "{\r\n \"startTime\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"e858710f-483e-4f91-9d0e-9935898bbe82\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 22 Jul 2021 03:38:30 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;1195,Microsoft.Compute/GetOperationStatus30Min;4173 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/e858710f-483e-4f91-9d0e-9935898bbe82?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9c59a3c6-9871-4bbe-b6d1-110bd86d83a8?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"endTime\": - \"2021-07-22T03:38:51.7126915+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"e858710f-483e-4f91-9d0e-9935898bbe82\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:28:31.0693976+00:00\",\r\n \"endTime\": + \"2021-09-02T03:39:47.1350907+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"9c59a3c6-9871-4bbe-b6d1-110bd86d83a8\"\r\n}" headers: cache-control: - no-cache @@ -1413,7 +1367,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:39:30 GMT + - Thu, 02 Sep 2021 03:40:32 GMT expires: - '-1' pragma: @@ -1430,7 +1384,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4171 + - Microsoft.Compute/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4173 status: code: 200 message: OK @@ -1444,10 +1398,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2020-09-30 + 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=2021-07-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\",\r\n @@ -1456,7 +1410,7 @@ interactions: [\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\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"storageAccountType\": + \ \"publishedDate\": \"2021-09-02T03:28:31.0693976+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 @@ -1470,7 +1424,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:39:30 GMT + - Thu, 02 Sep 2021 03:40:32 GMT expires: - '-1' pragma: @@ -1501,10 +1455,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2020-09-30 + 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=2021-07-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\",\r\n @@ -1513,7 +1467,7 @@ interactions: [\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\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"storageAccountType\": + \ \"publishedDate\": \"2021-09-02T03:28:31.0693976+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 @@ -1527,7 +1481,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:39:30 GMT + - Thu, 02 Sep 2021 03:40:32 GMT expires: - '-1' pragma: @@ -1558,28 +1512,28 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"imagex10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9\",\r\n \ \"type\": \"Microsoft.Compute/galleries/images\",\r\n \"location\": \"eastus\",\r\n - \ \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"osType\": - \"Windows\",\r\n \"osState\": \"Generalized\",\r\n \"identifier\": {\r\n - \ \"publisher\": \"myPublisherName\",\r\n \"offer\": \"myOfferName\",\r\n - \ \"sku\": \"mySkuName\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n - \ }\r\n}" + \ \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"architecture\": + \"x64\",\r\n \"osType\": \"Windows\",\r\n \"osState\": \"Generalized\",\r\n + \ \"identifier\": {\r\n \"publisher\": \"myPublisherName\",\r\n \"offer\": + \"myOfferName\",\r\n \"sku\": \"mySkuName\"\r\n },\r\n \"provisioningState\": + \"Succeeded\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '622' + - '650' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:39:30 GMT + - Thu, 02 Sep 2021 03:40:32 GMT expires: - '-1' pragma: @@ -1596,7 +1550,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetGalleryImage3Min;599,Microsoft.Compute/GetGalleryImage30Min;2989 + - Microsoft.Compute/GetGalleryImage3Min;595,Microsoft.Compute/GetGalleryImage30Min;2989 status: code: 200 message: OK @@ -1610,10 +1564,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"applicationname10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9\",\r\n @@ -1629,7 +1583,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:39:30 GMT + - Thu, 02 Sep 2021 03:40:32 GMT expires: - '-1' pragma: @@ -1660,26 +1614,27 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"galleryname10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9\",\r\n \ \"type\": \"Microsoft.Compute/galleries\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"description\": \"This is the gallery description.\",\r\n \ \"identifier\": {\r\n \"uniqueName\": \"00000000-0000-0000-0000-000000000000-GALLERYNAME10BB14A9\"\r\n - \ },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" + \ },\r\n \"provisioningState\": \"Succeeded\",\r\n \"softDeletePolicy\": + {\r\n \"isSoftDeleteEnabled\": false\r\n }\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '550' + - '621' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:39:30 GMT + - Thu, 02 Sep 2021 03:40:32 GMT expires: - '-1' pragma: @@ -1716,10 +1671,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2020-09-30 + 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=2021-07-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\",\r\n @@ -1728,7 +1683,7 @@ interactions: [\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\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"storageAccountType\": + \ \"publishedDate\": \"2021-09-02T03:28:31.0693976+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 @@ -1736,7 +1691,7 @@ interactions: \ }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/faad63e4-137d-4b4e-83be-28bcae470e5d?api-version=2020-09-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9d9d49e3-c7af-4c26-a050-f798c633b529?api-version=2021-07-01 cache-control: - no-cache content-length: @@ -1744,7 +1699,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:39:30 GMT + - Thu, 02 Sep 2021 03:40:33 GMT expires: - '-1' pragma: @@ -1763,7 +1718,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGalleryImageVersion3Min;374,Microsoft.Compute/CreateUpdateGalleryImageVersion30Min;1198 x-ms-ratelimit-remaining-subscription-writes: - - '1190' + - '1187' status: code: 200 message: OK @@ -1777,14 +1732,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/faad63e4-137d-4b4e-83be-28bcae470e5d?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9d9d49e3-c7af-4c26-a050-f798c633b529?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:39:31.1022815+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"faad63e4-137d-4b4e-83be-28bcae470e5d\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:40:33.1196828+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"9d9d49e3-c7af-4c26-a050-f798c633b529\"\r\n}" headers: cache-control: - no-cache @@ -1793,7 +1748,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:40:31 GMT + - Thu, 02 Sep 2021 03:41:32 GMT expires: - '-1' pragma: @@ -1810,7 +1765,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4170 + - Microsoft.Compute/GetOperationStatus3Min;1196,Microsoft.Compute/GetOperationStatus30Min;4172 status: code: 200 message: OK @@ -1824,14 +1779,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/faad63e4-137d-4b4e-83be-28bcae470e5d?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9d9d49e3-c7af-4c26-a050-f798c633b529?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:39:31.1022815+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"faad63e4-137d-4b4e-83be-28bcae470e5d\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:40:33.1196828+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"9d9d49e3-c7af-4c26-a050-f798c633b529\"\r\n}" headers: cache-control: - no-cache @@ -1840,7 +1795,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:41:30 GMT + - Thu, 02 Sep 2021 03:42:32 GMT expires: - '-1' pragma: @@ -1857,7 +1812,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1196,Microsoft.Compute/GetOperationStatus30Min;4169 + - Microsoft.Compute/GetOperationStatus3Min;1197,Microsoft.Compute/GetOperationStatus30Min;4171 status: code: 200 message: OK @@ -1871,15 +1826,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/faad63e4-137d-4b4e-83be-28bcae470e5d?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/9d9d49e3-c7af-4c26-a050-f798c633b529?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:39:31.1022815+00:00\",\r\n \"endTime\": - \"2021-07-22T03:42:01.2917959+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"faad63e4-137d-4b4e-83be-28bcae470e5d\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:40:33.1196828+00:00\",\r\n \"endTime\": + \"2021-09-02T03:43:03.3386688+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"9d9d49e3-c7af-4c26-a050-f798c633b529\"\r\n}" headers: cache-control: - no-cache @@ -1888,7 +1843,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:42:30 GMT + - Thu, 02 Sep 2021 03:43:33 GMT expires: - '-1' pragma: @@ -1905,7 +1860,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1197,Microsoft.Compute/GetOperationStatus30Min;4168 + - Microsoft.Compute/GetOperationStatus3Min;1197,Microsoft.Compute/GetOperationStatus30Min;4170 status: code: 200 message: OK @@ -1919,10 +1874,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2020-09-30 + 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=2021-07-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\",\r\n @@ -1931,7 +1886,7 @@ interactions: [\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\": \"2021-07-22T03:26:29.1313914+00:00\",\r\n \"storageAccountType\": + \ \"publishedDate\": \"2021-09-02T03:28:31.0693976+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 @@ -1945,7 +1900,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:42:30 GMT + - Thu, 02 Sep 2021 03:43:33 GMT expires: - '-1' pragma: @@ -1981,30 +1936,30 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"imagex10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9\",\r\n \ \"type\": \"Microsoft.Compute/galleries/images\",\r\n \"location\": \"eastus\",\r\n - \ \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"osType\": - \"Windows\",\r\n \"osState\": \"Generalized\",\r\n \"identifier\": {\r\n - \ \"publisher\": \"myPublisherName\",\r\n \"offer\": \"myOfferName\",\r\n - \ \"sku\": \"mySkuName\"\r\n },\r\n \"provisioningState\": \"Updating\"\r\n - \ }\r\n}" + \ \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"architecture\": + \"x64\",\r\n \"osType\": \"Windows\",\r\n \"osState\": \"Generalized\",\r\n + \ \"identifier\": {\r\n \"publisher\": \"myPublisherName\",\r\n \"offer\": + \"myOfferName\",\r\n \"sku\": \"mySkuName\"\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/capsOperations/85a8e3cb-4755-4f8e-aa81-b5f6748fe7bd?api-version=2020-09-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/cd29d405-134e-4d92-b01e-da37c8f296f8?api-version=2021-07-01 cache-control: - no-cache content-length: - - '621' + - '649' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:42:30 GMT + - Thu, 02 Sep 2021 03:43:33 GMT expires: - '-1' pragma: @@ -2023,7 +1978,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGalleryImage3Min;149,Microsoft.Compute/CreateUpdateGalleryImage30Min;748 x-ms-ratelimit-remaining-subscription-writes: - - '1189' + - '1186' status: code: 200 message: OK @@ -2037,15 +1992,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/85a8e3cb-4755-4f8e-aa81-b5f6748fe7bd?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/cd29d405-134e-4d92-b01e-da37c8f296f8?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:42:31.5576258+00:00\",\r\n \"endTime\": - \"2021-07-22T03:42:31.6044759+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"85a8e3cb-4755-4f8e-aa81-b5f6748fe7bd\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:43:33.7136382+00:00\",\r\n \"endTime\": + \"2021-09-02T03:43:33.7605399+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"cd29d405-134e-4d92-b01e-da37c8f296f8\"\r\n}" headers: cache-control: - no-cache @@ -2054,7 +2009,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:43:00 GMT + - Thu, 02 Sep 2021 03:44:03 GMT expires: - '-1' pragma: @@ -2071,7 +2026,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1196,Microsoft.Compute/GetOperationStatus30Min;4167 + - Microsoft.Compute/GetOperationStatus3Min;1196,Microsoft.Compute/GetOperationStatus30Min;4169 status: code: 200 message: OK @@ -2085,28 +2040,28 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"imagex10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9\",\r\n \ \"type\": \"Microsoft.Compute/galleries/images\",\r\n \"location\": \"eastus\",\r\n - \ \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"osType\": - \"Windows\",\r\n \"osState\": \"Generalized\",\r\n \"identifier\": {\r\n - \ \"publisher\": \"myPublisherName\",\r\n \"offer\": \"myOfferName\",\r\n - \ \"sku\": \"mySkuName\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n - \ }\r\n}" + \ \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"architecture\": + \"x64\",\r\n \"osType\": \"Windows\",\r\n \"osState\": \"Generalized\",\r\n + \ \"identifier\": {\r\n \"publisher\": \"myPublisherName\",\r\n \"offer\": + \"myOfferName\",\r\n \"sku\": \"mySkuName\"\r\n },\r\n \"provisioningState\": + \"Succeeded\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '622' + - '650' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:43:00 GMT + - Thu, 02 Sep 2021 03:44:03 GMT expires: - '-1' pragma: @@ -2143,10 +2098,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"applicationname10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9\",\r\n @@ -2163,7 +2118,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:43:00 GMT + - Thu, 02 Sep 2021 03:44:03 GMT expires: - '-1' pragma: @@ -2182,7 +2137,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGalleryApplication3Min;149,Microsoft.Compute/CreateUpdateGalleryApplication30Min;748 x-ms-ratelimit-remaining-subscription-writes: - - '1188' + - '1185' status: code: 200 message: OK @@ -2200,29 +2155,29 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"galleryname10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9\",\r\n \ \"type\": \"Microsoft.Compute/galleries\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"description\": \"This is the gallery description.\",\r\n \ \"identifier\": {\r\n \"uniqueName\": \"00000000-0000-0000-0000-000000000000-GALLERYNAME10BB14A9\"\r\n - \ },\r\n \"sharingProfile\": {\r\n \"permissions\": \"Private\"\r\n - \ },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" + \ },\r\n \"provisioningState\": \"Succeeded\",\r\n \"softDeletePolicy\": + {\r\n \"isSoftDeleteEnabled\": false\r\n }\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/287006b8-7dee-4082-8a15-16a71252a483?api-version=2020-09-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2d3bf706-75f1-4c3d-9973-c0923411c8d9?api-version=2021-07-01 cache-control: - no-cache content-length: - - '615' + - '621' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:43:00 GMT + - Thu, 02 Sep 2021 03:44:03 GMT expires: - '-1' pragma: @@ -2241,7 +2196,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/CreateUpdateGallery3Min;49,Microsoft.Compute/CreateUpdateGallery30Min;298 x-ms-ratelimit-remaining-subscription-writes: - - '1187' + - '1184' status: code: 200 message: OK @@ -2255,24 +2210,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/287006b8-7dee-4082-8a15-16a71252a483?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2d3bf706-75f1-4c3d-9973-c0923411c8d9?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:43:01.870301+00:00\",\r\n \"endTime\": - \"2021-07-22T03:43:01.9015309+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"287006b8-7dee-4082-8a15-16a71252a483\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:44:03.9792782+00:00\",\r\n \"endTime\": + \"2021-09-02T03:44:04.0261384+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"2d3bf706-75f1-4c3d-9973-c0923411c8d9\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:43:31 GMT + - Thu, 02 Sep 2021 03:44:33 GMT expires: - '-1' pragma: @@ -2289,7 +2244,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1196,Microsoft.Compute/GetOperationStatus30Min;4166 + - Microsoft.Compute/GetOperationStatus3Min;1196,Microsoft.Compute/GetOperationStatus30Min;4168 status: code: 200 message: OK @@ -2303,26 +2258,27 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"galleryname10bb14a9\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9\",\r\n \ \"type\": \"Microsoft.Compute/galleries\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"description\": \"This is the gallery description.\",\r\n \ \"identifier\": {\r\n \"uniqueName\": \"00000000-0000-0000-0000-000000000000-GALLERYNAME10BB14A9\"\r\n - \ },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" + \ },\r\n \"provisioningState\": \"Succeeded\",\r\n \"softDeletePolicy\": + {\r\n \"isSoftDeleteEnabled\": false\r\n }\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '550' + - '621' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:43:31 GMT + - Thu, 02 Sep 2021 03:44:33 GMT expires: - '-1' pragma: @@ -2355,26 +2311,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2020-09-30 + 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=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2e20553d-6fbe-42c4-b3bb-304d3302d677?api-version=2020-09-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/5940334a-f574-483b-bb4d-c951359ef3ae?api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:43:31 GMT + - Thu, 02 Sep 2021 03:44:33 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2e20553d-6fbe-42c4-b3bb-304d3302d677?monitor=true&api-version=2020-09-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/5940334a-f574-483b-bb4d-c951359ef3ae?monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -2387,7 +2343,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteGalleryImageVersion3Min;149,Microsoft.Compute/DeleteGalleryImageVersion30Min;999 x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14996' status: code: 202 message: Accepted @@ -2401,14 +2357,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2e20553d-6fbe-42c4-b3bb-304d3302d677?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/5940334a-f574-483b-bb4d-c951359ef3ae?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:43:32.1048255+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"2e20553d-6fbe-42c4-b3bb-304d3302d677\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:44:34.2292809+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"5940334a-f574-483b-bb4d-c951359ef3ae\"\r\n}" headers: cache-control: - no-cache @@ -2417,7 +2373,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:44:31 GMT + - Thu, 02 Sep 2021 03:45:33 GMT expires: - '-1' pragma: @@ -2434,7 +2390,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1196,Microsoft.Compute/GetOperationStatus30Min;4165 + - Microsoft.Compute/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4166 status: code: 200 message: OK @@ -2448,15 +2404,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2e20553d-6fbe-42c4-b3bb-304d3302d677?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/5940334a-f574-483b-bb4d-c951359ef3ae?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:43:32.1048255+00:00\",\r\n \"endTime\": - \"2021-07-22T03:45:02.2929465+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"2e20553d-6fbe-42c4-b3bb-304d3302d677\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:44:34.2292809+00:00\",\r\n \"endTime\": + \"2021-09-02T03:46:04.4011651+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"5940334a-f574-483b-bb4d-c951359ef3ae\"\r\n}" headers: cache-control: - no-cache @@ -2465,7 +2421,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:45:32 GMT + - Thu, 02 Sep 2021 03:46:34 GMT expires: - '-1' pragma: @@ -2482,7 +2438,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4163 + - Microsoft.Compute/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4165 status: code: 200 message: OK @@ -2498,10 +2454,10 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/applications/applicationname10bb14a9?api-version=2021-07-01 response: body: string: '' @@ -2511,7 +2467,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:45:32 GMT + - Thu, 02 Sep 2021 03:46:34 GMT expires: - '-1' pragma: @@ -2526,7 +2482,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteGalleryApplication3Min;49,Microsoft.Compute/DeleteGalleryApplication30Min;299 x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14995' status: code: 200 message: OK @@ -2542,7 +2498,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9/endGetAccess?api-version=2020-12-01 @@ -2551,17 +2507,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8fec28f7-87e0-4bba-86c2-0dd6c160c4e1?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/78fbf63f-30e9-45eb-b3fb-bca397ab28fb?api-version=2020-12-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:45:32 GMT + - Thu, 02 Sep 2021 03:46:34 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8fec28f7-87e0-4bba-86c2-0dd6c160c4e1?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/78fbf63f-30e9-45eb-b3fb-bca397ab28fb?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -2574,7 +2530,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 @@ -2588,15 +2544,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8fec28f7-87e0-4bba-86c2-0dd6c160c4e1?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/78fbf63f-30e9-45eb-b3fb-bca397ab28fb?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:45:32.5315928+00:00\",\r\n \"endTime\": - \"2021-07-22T03:45:32.6878982+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"8fec28f7-87e0-4bba-86c2-0dd6c160c4e1\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:46:34.6977901+00:00\",\r\n \"endTime\": + \"2021-09-02T03:46:34.8384163+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"78fbf63f-30e9-45eb-b3fb-bca397ab28fb\"\r\n}" headers: cache-control: - no-cache @@ -2605,7 +2561,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:46:02 GMT + - Thu, 02 Sep 2021 03:47:04 GMT expires: - '-1' pragma: @@ -2622,7 +2578,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49996,Microsoft.Compute/GetOperation30Min;399934 + - Microsoft.Compute/GetOperation3Min;49996,Microsoft.Compute/GetOperation30Min;399924 status: code: 200 message: OK @@ -2636,10 +2592,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/8fec28f7-87e0-4bba-86c2-0dd6c160c4e1?monitor=true&api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/78fbf63f-30e9-45eb-b3fb-bca397ab28fb?monitor=true&api-version=2020-12-01 response: body: string: '' @@ -2649,7 +2605,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:46:02 GMT + - Thu, 02 Sep 2021 03:47:04 GMT expires: - '-1' pragma: @@ -2662,7 +2618,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49995,Microsoft.Compute/GetOperation30Min;399933 + - Microsoft.Compute/GetOperation3Min;49995,Microsoft.Compute/GetOperation30Min;399923 status: code: 200 message: OK @@ -2678,7 +2634,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/snapshots/snapshotname10bb14a9?api-version=2020-12-01 @@ -2687,17 +2643,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4b0893e6-3147-4171-b3bc-584c22bb8ad5?api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/be6ac034-435a-499b-be94-96c2a0f7ae00?api-version=2020-12-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:46:02 GMT + - Thu, 02 Sep 2021 03:47:04 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4b0893e6-3147-4171-b3bc-584c22bb8ad5?monitor=true&api-version=2020-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/be6ac034-435a-499b-be94-96c2a0f7ae00?monitor=true&api-version=2020-12-01 pragma: - no-cache server: @@ -2708,9 +2664,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteDisks3Min;2996,Microsoft.Compute/DeleteDisks30Min;23990 + - Microsoft.Compute/DeleteDisks3Min;2996,Microsoft.Compute/DeleteDisks30Min;23989 x-ms-ratelimit-remaining-subscription-deletes: - - '14996' + - '14994' status: code: 202 message: Accepted @@ -2724,15 +2680,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/4b0893e6-3147-4171-b3bc-584c22bb8ad5?api-version=2020-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/DiskOperations/be6ac034-435a-499b-be94-96c2a0f7ae00?api-version=2020-12-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:46:02.8130246+00:00\",\r\n \"endTime\": - \"2021-07-22T03:46:03.0473732+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"4b0893e6-3147-4171-b3bc-584c22bb8ad5\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:47:04.9797795+00:00\",\r\n \"endTime\": + \"2021-09-02T03:47:05.5891143+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"be6ac034-435a-499b-be94-96c2a0f7ae00\"\r\n}" headers: cache-control: - no-cache @@ -2741,7 +2697,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:46:32 GMT + - Thu, 02 Sep 2021 03:47:34 GMT expires: - '-1' pragma: @@ -2758,7 +2714,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;49993,Microsoft.Compute/GetOperation30Min;399931 + - Microsoft.Compute/GetOperation3Min;49993,Microsoft.Compute/GetOperation30Min;399921 status: code: 200 message: OK @@ -2774,26 +2730,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9/images/imagex10bb14a9?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/57c5cf9f-27e2-4501-8724-e1aa880bc501?api-version=2020-09-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/22c75135-6078-4176-8e08-05b764cf8151?api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:46:32 GMT + - Thu, 02 Sep 2021 03:47:34 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/57c5cf9f-27e2-4501-8724-e1aa880bc501?monitor=true&api-version=2020-09-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/22c75135-6078-4176-8e08-05b764cf8151?monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -2806,7 +2762,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteGalleryImage3Min;49,Microsoft.Compute/DeleteGalleryImage30Min;299 x-ms-ratelimit-remaining-subscription-deletes: - - '14995' + - '14993' status: code: 202 message: Accepted @@ -2820,24 +2776,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/57c5cf9f-27e2-4501-8724-e1aa880bc501?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/22c75135-6078-4176-8e08-05b764cf8151?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:46:33.0589478+00:00\",\r\n \"endTime\": - \"2021-07-22T03:46:33.3245515+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"57c5cf9f-27e2-4501-8724-e1aa880bc501\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:47:35.2296362+00:00\",\r\n \"endTime\": + \"2021-09-02T03:47:35.479609+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"22c75135-6078-4176-8e08-05b764cf8151\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:47:02 GMT + - Thu, 02 Sep 2021 03:48:04 GMT expires: - '-1' pragma: @@ -2854,7 +2810,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1194,Microsoft.Compute/GetOperationStatus30Min;4160 + - Microsoft.Compute/GetOperationStatus3Min;1194,Microsoft.Compute/GetOperationStatus30Min;4162 status: code: 200 message: OK @@ -2870,26 +2826,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/galleries/galleryname10bb14a9?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/034cf654-6df0-4a2b-b99f-ee0cf9182155?api-version=2020-09-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2f773e18-cf0f-4a08-b610-3d59f07e812f?api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:47:02 GMT + - Thu, 02 Sep 2021 03:48:05 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/034cf654-6df0-4a2b-b99f-ee0cf9182155?monitor=true&api-version=2020-09-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2f773e18-cf0f-4a08-b610-3d59f07e812f?monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -2902,7 +2858,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteGallery3Min;49,Microsoft.Compute/DeleteGallery30Min;299 x-ms-ratelimit-remaining-subscription-deletes: - - '14994' + - '14992' status: code: 202 message: Accepted @@ -2916,15 +2872,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/034cf654-6df0-4a2b-b99f-ee0cf9182155?api-version=2020-09-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/capsOperations/2f773e18-cf0f-4a08-b610-3d59f07e812f?api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:47:03.2308052+00:00\",\r\n \"endTime\": - \"2021-07-22T03:47:03.3401921+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"034cf654-6df0-4a2b-b99f-ee0cf9182155\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:48:05.4328844+00:00\",\r\n \"endTime\": + \"2021-09-02T03:48:05.5579269+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"2f773e18-cf0f-4a08-b610-3d59f07e812f\"\r\n}" headers: cache-control: - no-cache @@ -2933,7 +2889,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:47:32 GMT + - Thu, 02 Sep 2021 03:48:35 GMT expires: - '-1' pragma: @@ -2950,7 +2906,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperationStatus3Min;1194,Microsoft.Compute/GetOperationStatus30Min;4158 + - Microsoft.Compute/GetOperationStatus3Min;1194,Microsoft.Compute/GetOperationStatus30Min;4160 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 97ee6d5b752c..85e57a7d1bb4 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 @@ -14,17 +14,17 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff?api-version=2021-02-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/\\\"c0e1ed2d-3ff5-496e-91ed-0582b61097bd\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"68e5421e-7698-4533-94eb-98b21e7f8851\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": - \"e5b97ff9-d4a0-49b1-a8de-9b4c9f4c03c0\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + \"99b6723a-044f-42ed-9dd7-618ee54de009\",\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 \ }\r\n}" @@ -32,7 +32,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/fc053412-81b8-4f3c-8d79-02fe9d621370?api-version=2021-02-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/06699a79-86ba-433e-9785-264f3414870d?api-version=2021-02-01 cache-control: - no-cache content-length: @@ -40,7 +40,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:47:35 GMT + - Thu, 02 Sep 2021 03:48:38 GMT expires: - '-1' pragma: @@ -53,9 +53,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - ba055f8e-b29b-4b46-b8d1-8b6abac03a04 + - 56e5e866-b25d-48be-8bf4-3a7bda54d491 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1193' status: code: 201 message: Created @@ -69,10 +69,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/fc053412-81b8-4f3c-8d79-02fe9d621370?api-version=2021-02-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/06699a79-86ba-433e-9785-264f3414870d?api-version=2021-02-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -84,7 +84,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:47:38 GMT + - Thu, 02 Sep 2021 03:48:41 GMT expires: - '-1' pragma: @@ -101,7 +101,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - b4764ecc-e170-4202-9934-2803b72cc47d + - a93cf494-5fd8-4b4d-8cab-7ca487a6c32b status: code: 200 message: OK @@ -115,17 +115,17 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff?api-version=2021-02-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/\\\"3c135ebc-e588-4010-b37a-27e180d47c97\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"2a0608a5-319f-40e7-8394-eb681d9d432c\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": - \"e5b97ff9-d4a0-49b1-a8de-9b4c9f4c03c0\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + \"99b6723a-044f-42ed-9dd7-618ee54de009\",\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 \ }\r\n}" @@ -137,9 +137,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:47:38 GMT + - Thu, 02 Sep 2021 03:48:41 GMT etag: - - W/"3c135ebc-e588-4010-b37a-27e180d47c97" + - W/"2a0608a5-319f-40e7-8394-eb681d9d432c" expires: - '-1' pragma: @@ -156,7 +156,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 04cd4780-5845-4eb9-ad85-5935f85433a0 + - e095b2bf-5ef6-4e31-a2cb-a2f1141cab87 status: code: 200 message: OK @@ -174,21 +174,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff/subnets/subnetx15cf0eff?api-version=2021-02-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/\\\"628ab7da-fa07-40e3-b5af-d99639c4de20\\\"\",\r\n \"properties\": + \ \"etag\": \"W/\\\"f29f4fce-4547-49a0-b94f-c89211951b8e\\\"\",\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/1442e264-b52a-4a16-8693-21ebd726a7b4?api-version=2021-02-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/2af310a7-4346-4443-a4dc-b1226afbf166?api-version=2021-02-01 cache-control: - no-cache content-length: @@ -196,7 +196,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:47:38 GMT + - Thu, 02 Sep 2021 03:48:41 GMT expires: - '-1' pragma: @@ -209,9 +209,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - df5acb71-586b-4a96-8b8e-33ee3869ba31 + - b097eb1c-c9d5-41d9-89ed-90f4cc1b3bef x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1192' status: code: 201 message: Created @@ -225,10 +225,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/1442e264-b52a-4a16-8693-21ebd726a7b4?api-version=2021-02-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/2af310a7-4346-4443-a4dc-b1226afbf166?api-version=2021-02-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -240,7 +240,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:47:41 GMT + - Thu, 02 Sep 2021 03:48:44 GMT expires: - '-1' pragma: @@ -257,7 +257,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 8b07e9c2-3be7-46e1-a5a2-9a5c49886562 + - e6144538-587e-42d7-bd0e-4311b01b45ac status: code: 200 message: OK @@ -271,14 +271,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex15cf0eff/subnets/subnetx15cf0eff?api-version=2021-02-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/\\\"49a73ba3-1b22-4e21-ac50-17c91ba231bf\\\"\",\r\n \"properties\": + \ \"etag\": \"W/\\\"adeaf429-7d8c-464a-9c67-f7e5581eade7\\\"\",\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\n },\r\n \"type\": @@ -291,9 +291,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:47:41 GMT + - Thu, 02 Sep 2021 03:48:44 GMT etag: - - W/"49a73ba3-1b22-4e21-ac50-17c91ba231bf" + - W/"adeaf429-7d8c-464a-9c67-f7e5581eade7" expires: - '-1' pragma: @@ -310,7 +310,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - fe716394-c4fe-49df-bd68-64e67a609ae8 + - a6287d74-a469-4b39-88ab-b6991199ac5b status: code: 200 message: OK @@ -329,18 +329,18 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff?api-version=2021-02-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/\\\"ef5b2fc0-239b-4bee-bb1e-2a70c73b4891\\\"\",\r\n \"location\": + \ \"etag\": \"W/\\\"0625039f-9bec-403a-b912-1d5a6897d5c4\\\"\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"resourceGuid\": \"29c4aae3-3336-4702-856b-e7ebe8b771ca\",\r\n \"ipConfigurations\": + \ \"resourceGuid\": \"8785a24e-d00c-400d-ac83-343367b85a94\",\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/\\\"ef5b2fc0-239b-4bee-bb1e-2a70c73b4891\\\"\",\r\n + \ \"etag\": \"W/\\\"0625039f-9bec-403a-b912-1d5a6897d5c4\\\"\",\r\n \ \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": @@ -348,23 +348,23 @@ interactions: \ },\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\": - \"5f51tzna0syutkg4tngj4tadya.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\"\r\n}" + \"hjzlngkpatwufhoxmghoktpabb.bx.internal.cloudapp.net\"\r\n },\r\n \"enableAcceleratedNetworking\": + false,\r\n \"vnetEncryptionSupported\": false,\r\n \"enableIPForwarding\": + 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/9e6f0d30-9bcc-4d71-99e2-2b7041796a87?api-version=2021-02-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/1653f402-087e-4383-99b8-a2346fa21109?api-version=2021-02-01 cache-control: - no-cache content-length: - - '1878' + - '1917' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:47:42 GMT + - Thu, 02 Sep 2021 03:48:44 GMT expires: - '-1' pragma: @@ -377,9 +377,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 96ac8617-38eb-4f9e-9868-e354fac8b59e + - 02262c11-586b-468f-9944-07b4ea7ccd03 x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1191' status: code: 201 message: Created @@ -393,10 +393,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/9e6f0d30-9bcc-4d71-99e2-2b7041796a87?api-version=2021-02-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/1653f402-087e-4383-99b8-a2346fa21109?api-version=2021-02-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -408,7 +408,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:48:12 GMT + - Thu, 02 Sep 2021 03:49:14 GMT expires: - '-1' pragma: @@ -425,7 +425,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 23afb0f3-e4c9-40ad-94f0-ea000ec6a829 + - 3374b255-90a4-4808-81f9-abac1d31e43b status: code: 200 message: OK @@ -439,18 +439,18 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacex15cf0eff?api-version=2021-02-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/\\\"ef5b2fc0-239b-4bee-bb1e-2a70c73b4891\\\"\",\r\n \"location\": + \ \"etag\": \"W/\\\"0625039f-9bec-403a-b912-1d5a6897d5c4\\\"\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"resourceGuid\": \"29c4aae3-3336-4702-856b-e7ebe8b771ca\",\r\n \"ipConfigurations\": + \ \"resourceGuid\": \"8785a24e-d00c-400d-ac83-343367b85a94\",\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/\\\"ef5b2fc0-239b-4bee-bb1e-2a70c73b4891\\\"\",\r\n + \ \"etag\": \"W/\\\"0625039f-9bec-403a-b912-1d5a6897d5c4\\\"\",\r\n \ \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": @@ -458,21 +458,21 @@ interactions: \ },\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\": - \"5f51tzna0syutkg4tngj4tadya.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\"\r\n}" + \"hjzlngkpatwufhoxmghoktpabb.bx.internal.cloudapp.net\"\r\n },\r\n \"enableAcceleratedNetworking\": + false,\r\n \"vnetEncryptionSupported\": false,\r\n \"enableIPForwarding\": + 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: - - '1878' + - '1917' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:48:12 GMT + - Thu, 02 Sep 2021 03:49:14 GMT etag: - - W/"ef5b2fc0-239b-4bee-bb1e-2a70c73b4891" + - W/"0625039f-9bec-403a-b912-1d5a6897d5c4" expires: - '-1' pragma: @@ -489,7 +489,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 2c7d1b25-34a4-460e-9698-51bfd411c2af + - 0874925f-87bf-48c1-aebe-536b2339715d status: code: 200 message: OK @@ -516,34 +516,34 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2021-07-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\": \"fd19ee27-1058-4cd9-98f1-2364ada3e71a\",\r\n + \ \"properties\": {\r\n \"vmId\": \"bc737ab2-dd03-4ec7-87f5-38e7675d78af\",\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.4530.2107090502\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": + \"14393.4583.2108010852\"\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 },\r\n - \ \"diskSizeGB\": 127,\r\n \"deleteOption\": \"Detach\"\r\n },\r\n + \ \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": 127\r\n },\r\n \ \"dataDisks\": [\r\n {\r\n \"lun\": 0,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"Standard_LRS\"\r\n },\r\n - \ \"diskSizeGB\": 1023,\r\n \"toBeDetached\": false,\r\n - \ \"deleteOption\": \"Detach\"\r\n },\r\n {\r\n \"lun\": + \ \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": 1023,\r\n + \ \"toBeDetached\": false\r\n },\r\n {\r\n \"lun\": 1,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\",\r\n \ \"managedDisk\": {\r\n \"storageAccountType\": \"Standard_LRS\"\r\n - \ },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\": - false,\r\n \"deleteOption\": \"Detach\"\r\n }\r\n ]\r\n - \ },\r\n \"osProfile\": {\r\n \"computerName\": \"myVM\",\r\n \"adminUsername\": + \ },\r\n \"deleteOption\": \"Detach\",\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 \"patchSettings\": {\r\n \"patchMode\": \"AutomaticByOS\",\r\n \"assessmentMode\": @@ -555,7 +555,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fbfe78af-2d27-4d36-a7b7-489069906649?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5c1649f6-16e9-4412-8276-0f7866c61d80?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: @@ -563,7 +563,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:48:14 GMT + - Thu, 02 Sep 2021 03:49:18 GMT expires: - '-1' pragma: @@ -576,9 +576,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/PutVM3Min;744,Microsoft.Compute/PutVM30Min;3726 + - Microsoft.Compute/PutVM3Min;745,Microsoft.Compute/PutVM30Min;3729 x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1196' status: code: 201 message: Created @@ -592,14 +592,61 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5c1649f6-16e9-4412-8276-0f7866c61d80?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + response: + body: + string: "{\r\n \"startTime\": \"2021-09-02T03:49:16.9448846+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"5c1649f6-16e9-4412-8276-0f7866c61d80\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 02 Sep 2021 03:49: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/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29991 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fbfe78af-2d27-4d36-a7b7-489069906649?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5c1649f6-16e9-4412-8276-0f7866c61d80?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:48:13.7352916+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"fbfe78af-2d27-4d36-a7b7-489069906649\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:49:16.9448846+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"5c1649f6-16e9-4412-8276-0f7866c61d80\"\r\n}" headers: cache-control: - no-cache @@ -608,7 +655,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:48:24 GMT + - Thu, 02 Sep 2021 03:50:18 GMT expires: - '-1' pragma: @@ -625,7 +672,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29982 + - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29996 status: code: 200 message: OK @@ -639,15 +686,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fbfe78af-2d27-4d36-a7b7-489069906649?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5c1649f6-16e9-4412-8276-0f7866c61d80?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:48:13.7352916+00:00\",\r\n \"endTime\": - \"2021-07-22T03:49:02.1417738+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"fbfe78af-2d27-4d36-a7b7-489069906649\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:49:16.9448846+00:00\",\r\n \"endTime\": + \"2021-09-02T03:50:29.1485723+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"5c1649f6-16e9-4412-8276-0f7866c61d80\"\r\n}" headers: cache-control: - no-cache @@ -656,7 +703,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:49:14 GMT + - Thu, 02 Sep 2021 03:50:48 GMT expires: - '-1' pragma: @@ -673,7 +720,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14997,Microsoft.Compute/GetOperation30Min;29980 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29994 status: code: 200 message: OK @@ -687,39 +734,39 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2021-07-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\": \"fd19ee27-1058-4cd9-98f1-2364ada3e71a\",\r\n + \ \"properties\": {\r\n \"vmId\": \"bc737ab2-dd03-4ec7-87f5-38e7675d78af\",\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.4530.2107090502\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": + \"14393.4583.2108010852\"\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\"\r\n - \ },\r\n \"diskSizeGB\": 127,\r\n \"deleteOption\": \"Detach\"\r\n - \ },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": 0,\r\n - \ \"name\": \"virtualmachinex15cf0eff_disk2_a50e061efa8f47039c97d8ea6ef815ce\",\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 127\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"virtualmachinex15cf0eff_disk2_1c88fce1508d45f4b29540d6613f8826\",\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_a50e061efa8f47039c97d8ea6ef815ce\"\r\n - \ },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\": - false,\r\n \"deleteOption\": \"Detach\"\r\n },\r\n {\r\n - \ \"lun\": 1,\r\n \"name\": \"virtualmachinex15cf0eff_disk3_fb1d3ef280944725adf0d591e7d81e90\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk2_1c88fce1508d45f4b29540d6613f8826\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1023,\r\n \"toBeDetached\": false\r\n },\r\n {\r\n + \ \"lun\": 1,\r\n \"name\": \"virtualmachinex15cf0eff_disk3_c9ba933572224d51aaeaa2958592f548\",\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_fb1d3ef280944725adf0d591e7d81e90\"\r\n - \ },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\": - false,\r\n \"deleteOption\": \"Detach\"\r\n }\r\n ]\r\n - \ },\r\n \"osProfile\": {\r\n \"computerName\": \"myVM\",\r\n \"adminUsername\": + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk3_c9ba933572224d51aaeaa2958592f548\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\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 \"patchSettings\": {\r\n \"patchMode\": \"AutomaticByOS\",\r\n \"assessmentMode\": @@ -735,7 +782,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:49:14 GMT + - Thu, 02 Sep 2021 03:50:48 GMT expires: - '-1' pragma: @@ -752,7 +799,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3998,Microsoft.Compute/LowCostGet30Min;31928 + - Microsoft.Compute/LowCostGet3Min;3998,Microsoft.Compute/LowCostGet30Min;31995 status: code: 200 message: OK @@ -772,10 +819,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionx15cf0eff\",\r\n \"id\": @@ -789,7 +836,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9e103578-c13d-4b4b-b1be-04a2fc843111?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/84780d34-e639-466a-ae9a-c88606cbdeec?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: @@ -797,7 +844,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:49:14 GMT + - Thu, 02 Sep 2021 03:50:49 GMT expires: - '-1' pragma: @@ -812,7 +859,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;239,Microsoft.Compute/UpdateVM30Min;1199 x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1195' status: code: 201 message: Created @@ -826,14 +873,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9e103578-c13d-4b4b-b1be-04a2fc843111?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/84780d34-e639-466a-ae9a-c88606cbdeec?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:49:15.2356009+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"9e103578-c13d-4b4b-b1be-04a2fc843111\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:50:49.6487227+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"84780d34-e639-466a-ae9a-c88606cbdeec\"\r\n}" headers: cache-control: - no-cache @@ -842,7 +889,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:49:44 GMT + - Thu, 02 Sep 2021 03:51:19 GMT expires: - '-1' pragma: @@ -859,7 +906,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29979 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29993 status: code: 200 message: OK @@ -873,14 +920,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9e103578-c13d-4b4b-b1be-04a2fc843111?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/84780d34-e639-466a-ae9a-c88606cbdeec?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:49:15.2356009+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"9e103578-c13d-4b4b-b1be-04a2fc843111\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:50:49.6487227+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"84780d34-e639-466a-ae9a-c88606cbdeec\"\r\n}" headers: cache-control: - no-cache @@ -889,7 +936,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:50:15 GMT + - Thu, 02 Sep 2021 03:51:49 GMT expires: - '-1' pragma: @@ -906,7 +953,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29995 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29992 status: code: 200 message: OK @@ -920,14 +967,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9e103578-c13d-4b4b-b1be-04a2fc843111?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/84780d34-e639-466a-ae9a-c88606cbdeec?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:49:15.2356009+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"9e103578-c13d-4b4b-b1be-04a2fc843111\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:50:49.6487227+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"84780d34-e639-466a-ae9a-c88606cbdeec\"\r\n}" headers: cache-control: - no-cache @@ -936,7 +983,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:50:45 GMT + - Thu, 02 Sep 2021 03:52:19 GMT expires: - '-1' pragma: @@ -953,7 +1000,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29994 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29991 status: code: 200 message: OK @@ -967,24 +1014,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9e103578-c13d-4b4b-b1be-04a2fc843111?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/84780d34-e639-466a-ae9a-c88606cbdeec?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:49:15.2356009+00:00\",\r\n \"endTime\": - \"2021-07-22T03:51:00.5331076+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"9e103578-c13d-4b4b-b1be-04a2fc843111\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:50:49.6487227+00:00\",\r\n \"endTime\": + \"2021-09-02T03:52:34.571438+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"84780d34-e639-466a-ae9a-c88606cbdeec\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:51:14 GMT + - Thu, 02 Sep 2021 03:52:49 GMT expires: - '-1' pragma: @@ -1001,7 +1048,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29992 + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29989 status: code: 200 message: OK @@ -1015,10 +1062,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionx15cf0eff\",\r\n \"id\": @@ -1036,7 +1083,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:51:15 GMT + - Thu, 02 Sep 2021 03:52:49 GMT expires: - '-1' pragma: @@ -1053,7 +1100,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3995,Microsoft.Compute/LowCostGet30Min;31932 + - Microsoft.Compute/LowCostGet3Min;3995,Microsoft.Compute/LowCostGet30Min;31993 status: code: 200 message: OK @@ -1067,58 +1114,58 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/instanceView?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/instanceView?api-version=2021-07-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.1010\",\r\n \"statuses\": + 2016 Datacenter\",\r\n \"osVersion\": \"Windows:Windows Server 2016 Datacenter-10.0.14393.4583\",\r\n + \ \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.7.41491.1024\",\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\": - \"2021-07-22T03:50:53+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": + \"2021-09-02T03:52:28+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": [\r\n {\r\n \"type\": \"Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows\",\r\n - \ \"typeHandlerVersion\": \"1.4.1884.1\",\r\n \"status\": {\r\n + \ \"typeHandlerVersion\": \"1.4.1974.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.1884.1).\"\r\n }\r\n }\r\n ]\r\n + extension name: , version: 1.4.1974.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\": \"2021-07-22T03:48:16.1102772+00:00\"\r\n - \ }\r\n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinex15cf0eff_disk2_a50e061efa8f47039c97d8ea6ef815ce\",\r\n + succeeded\",\r\n \"time\": \"2021-09-02T03:49:20.8043126+00:00\"\r\n + \ }\r\n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinex15cf0eff_disk2_1c88fce1508d45f4b29540d6613f8826\",\r\n \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning - succeeded\",\r\n \"time\": \"2021-07-22T03:48:16.1102772+00:00\"\r\n - \ }\r\n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinex15cf0eff_disk3_fb1d3ef280944725adf0d591e7d81e90\",\r\n + succeeded\",\r\n \"time\": \"2021-09-02T03:49:20.8043126+00:00\"\r\n + \ }\r\n ]\r\n },\r\n {\r\n \"name\": \"virtualmachinex15cf0eff_disk3_c9ba933572224d51aaeaa2958592f548\",\r\n \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning - succeeded\",\r\n \"time\": \"2021-07-22T03:48:16.1102772+00:00\"\r\n + succeeded\",\r\n \"time\": \"2021-09-02T03:49:20.8199495+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.1884.1\",\r\n \"statuses\": [\r\n + \ \"typeHandlerVersion\": \"1.4.1974.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.1884.1).\"\r\n }\r\n ]\r\n }\r\n + extension name: , version: 1.4.1974.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\": \"2021-07-22T03:51:00.5331076+00:00\"\r\n + \ \"displayStatus\": \"Provisioning succeeded\",\r\n \"time\": \"2021-09-02T03:52:34.5558172+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: - - '2812' + - '2833' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:51:15 GMT + - Thu, 02 Sep 2021 03:52:49 GMT expires: - '-1' pragma: @@ -1135,7 +1182,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3994,Microsoft.Compute/LowCostGet30Min;31931 + - Microsoft.Compute/LowCostGet3Min;3994,Microsoft.Compute/LowCostGet30Min;31992 status: code: 200 message: OK @@ -1149,10 +1196,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionx15cf0eff\",\r\n \"id\": @@ -1170,7 +1217,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:51:15 GMT + - Thu, 02 Sep 2021 03:52:49 GMT expires: - '-1' pragma: @@ -1187,7 +1234,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3993,Microsoft.Compute/LowCostGet30Min;31930 + - Microsoft.Compute/LowCostGet3Min;3993,Microsoft.Compute/LowCostGet30Min;31991 status: code: 200 message: OK @@ -1201,15 +1248,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/runCommands/RunPowerShellScript?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/runCommands/RunPowerShellScript?api-version=2021-07-01 response: body: string: "{\r\n \"script\": [\r\n \"param(\\r\\n [string]$arg1,\\r\\n [string]$arg2\\r\\n)\\r\\nWrite-Host This is a sample script with parameters $arg1 $arg2\\r\\n\\r\\n# SIG # Begin - signature block\\r\\n# MIIjhQYJKoZIhvcNAQcCoIIjdjCCI3ICAQExDzANBglghkgBZQMEAgEFADB5Bgor\\r\\n# + signature block\\r\\n# MIIjhgYJKoZIhvcNAQcCoIIjdzCCI3MCAQExDzANBglghkgBZQMEAgEFADB5Bgor\\r\\n# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG\\r\\n# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB6jm9GJUxEj/xj\\r\\n# xRn7NMmK1YlgeGDCHEVx3xVyCBNnmaCCDYEwggX/MIID56ADAgECAhMzAAAB32vw\\r\\n# LpKnSrTQAAAAAAHfMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD\\r\\n# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy\\r\\n# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p\\r\\n# @@ -1247,64 +1294,64 @@ interactions: wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ\\r\\n# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j\\r\\n# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B\\r\\n# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96\\r\\n# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7\\r\\n# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I\\r\\n# - RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIVWjCCFVYCAQEwgZUwfjELMAkG\\r\\n# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx\\r\\n# + RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIVWzCCFVcCAQEwgZUwfjELMAkG\\r\\n# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx\\r\\n# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z\\r\\n# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAd9r8C6Sp0q00AAAAAAB3zAN\\r\\n# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor\\r\\n# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgtFV7nVIA\\r\\n# MzAyvGRGFyVFPBXkTNlNDitxIkf6V1ugHIUwQgYKKwYBBAGCNwIBDDE0MDKgFIAS\\r\\n# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN\\r\\n# BgkqhkiG9w0BAQEFAASCAQCdcZkwG3N2yyK8zjw+MCmVYaQKrdUoDeuk/eGP1cNs\\r\\n# 2/0LZ1Nl5T1BXbVxIXU8gqL9GzokG58Fo1kTzUx0Vk/mJyAaV+KHVPDe0pIfreZL\\r\\n# cosVVdCKCXc6zhBrapOG/fY5bmrhSMVsGGe04uvInKlItOltcAc1xx/z3yl3e4L7\\r\\n# d1esSaFrr+e95j4YwkCuQ8cUiAMWi9817841qYi36oIwVgsE29/d2b7+l5S2eEDy\\r\\n# - 0Umdiz2jWVXfSA6CePldzhOk5ySI5ShcBpn2b132gIs5lWlj3r1OD/lkOgOjQhSN\\r\\n# khCltIJso0c+f+LP822OJeHCSc1S6aKMH54rsrLZlSr9oYIS5DCCEuAGCisGAQQB\\r\\n# - gjcDAwExghLQMIISzAYJKoZIhvcNAQcCoIISvTCCErkCAQMxDzANBglghkgBZQME\\r\\n# AgEFADCCAVAGCyqGSIb3DQEJEAEEoIIBPwSCATswggE3AgEBBgorBgEEAYRZCgMB\\r\\n# - MDEwDQYJYIZIAWUDBAIBBQAEICye+7PcMlsaxZQZ4xS/CJz3pTAcisYNJPqQgd+y\\r\\n# OPl2AgZgrpmc4xkYEjIwMjEwNjE3MTgyMzUwLjI0WjAEgAIB9KCB0KSBzTCByjEL\\r\\n# - MAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1v\\r\\n# bmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWlj\\r\\n# - cm9zb2Z0IEFtZXJpY2EgT3BlcmF0aW9uczEmMCQGA1UECxMdVGhhbGVzIFRTUyBF\\r\\n# U046M0U3QS1FMzU5LUEyNUQxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1w\\r\\n# - IFNlcnZpY2Wggg48MIIE8TCCA9mgAwIBAgITMwAAAVIwS12JrOZwRwAAAAABUjAN\\r\\n# BgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3Rv\\r\\n# - bjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0\\r\\n# aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDAeFw0y\\r\\n# - MDExMTIxODI2MDVaFw0yMjAyMTExODI2MDVaMIHKMQswCQYDVQQGEwJVUzETMBEG\\r\\n# A1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWlj\\r\\n# - cm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1lcmljYSBP\\r\\n# cGVyYXRpb25zMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjozRTdBLUUzNTktQTI1\\r\\n# - RDElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZTCCASIwDQYJ\\r\\n# KoZIhvcNAQEBBQADggEPADCCAQoCggEBAK7MboSJmHS1oJJuzAyK6kxNidtugXOO\\r\\n# - PUO4Ntu9PRFcoEJWX+6YD5TLbXgOYeIWGR65F2UsHTJrlL26bloqvuUEGpnO+0qA\\r\\n# Y2AJFsNMb1i7qTMPM9PNBG6VUi+hZXLSAhOcTKgnU7ebkg+mwsE1AJ1eyH7dNkXv\\r\\n# - ckBy5vbVufGb/izF7jNN1t220Gupfz8kkXZUScA/4wG8XZRBKjpdQBpMoL8c8M8J\\r\\n# x78iw2gDHEsMjXAeEiWqNEGe3gczkdwoetmu8f68eeKGKR2UTOHd+NAWjCTV8bs9\\r\\n# - WGY7rQ7m9V2oD4f3fXiEcQ1AjRxuj5KRKLxJIlIs2LGCPR5Z49OHulsCAwEAAaOC\\r\\n# ARswggEXMB0GA1UdDgQWBBSE3a7arCPWXZzaH+RQsO4FEmx7FDAfBgNVHSMEGDAW\\r\\n# - gBTVYzpcijGQ80N7fEYbxTNoWoVtVTBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8v\\r\\n# Y3JsLm1pY3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNUaW1TdGFQQ0Ff\\r\\n# - MjAxMC0wNy0wMS5jcmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRw\\r\\n# Oi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1RpbVN0YVBDQV8yMDEw\\r\\n# - LTA3LTAxLmNydDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoGCCsGAQUFBwMIMA0G\\r\\n# CSqGSIb3DQEBCwUAA4IBAQBVxSdx8WpJrNBsMRd/d3XT+6mJZBTkd1NvAb2/1t5U\\r\\n# - gNobigQvIhw0Tp7oJs4EyU9T6yalhhycreO5w2oKHCq4ubF2LaI/LiJDq+MB0Gn3\\r\\n# 5UVaWsGpSw1dnOMKmAwJmPpu7xerQ2d2XhbIFsjQmS7ry9Q0bjCwx0o/d3P7UzOT\\r\\n# - 1JSZrePsfI0Dnn12j2eEqahkyfl21/TdC/GVoTAwBo+T3G5S/0E3xw28WelaTiYs\\r\\n# RFBbq0DetcrSygQhIpNgbs6x7ugxdkNg9bF/2gWFgrNnD9LCeF0GiPZLl7JgTcC4\\r\\n# - X9lfNHeF2nf9cbNl450RF8XLWsLtkHCEMhqN4UyLncafMIIGcTCCBFmgAwIBAgIK\\r\\n# YQmBKgAAAAAAAjANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNV\\r\\n# - BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv\\r\\n# c29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlm\\r\\n# - aWNhdGUgQXV0aG9yaXR5IDIwMTAwHhcNMTAwNzAxMjEzNjU1WhcNMjUwNzAxMjE0\\r\\n# NjU1WjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE\\r\\n# - BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD\\r\\n# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDCCASIwDQYJKoZIhvcN\\r\\n# - AQEBBQADggEPADCCAQoCggEBAKkdDbx3EYo6IOz8E5f1+n9plGt0VBDVpQoAgoX7\\r\\n# 7XxoSyxfxcPlYcJ2tz5mK1vwFVMnBDEfQRsalR3OCROOfGEwWbEwRA/xYIiEVEMM\\r\\n# - 1024OAizQt2TrNZzMFcmgqNFDdDq9UeBzb8kYDJYYEbyWEeGMoQedGFnkV+BVLHP\\r\\n# k0ySwcSmXdFhE24oxhr5hoC732H8RsEnHSRnEnIaIYqvS2SJUGKxXf13Hz3wV3Ws\\r\\n# - vYpCTUBR0Q+cBj5nf/VmwAOWRH7v0Ev9buWayrGo8noqCjHw2k4GkbaICDXoeByw\\r\\n# 6ZnNPOcvRLqn9NxkvaQBwSAJk3jN/LzAyURdXhacAQVPIk0CAwEAAaOCAeYwggHi\\r\\n# - MBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBTVYzpcijGQ80N7fEYbxTNoWoVt\\r\\n# VTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0T\\r\\n# - AQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo0T2UkFvXzpoYxDBWBgNV\\r\\n# HR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpL2NybC9w\\r\\n# - cm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5jcmwwWgYIKwYBBQUHAQEE\\r\\n# TjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpL2Nl\\r\\n# - cnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDCBoAYDVR0gAQH/BIGVMIGS\\r\\n# MIGPBgkrBgEEAYI3LgMwgYEwPQYIKwYBBQUHAgEWMWh0dHA6Ly93d3cubWljcm9z\\r\\n# - b2Z0LmNvbS9QS0kvZG9jcy9DUFMvZGVmYXVsdC5odG0wQAYIKwYBBQUHAgIwNB4y\\r\\n# IB0ATABlAGcAYQBsAF8AUABvAGwAaQBjAHkAXwBTAHQAYQB0AGUAbQBlAG4AdAAu\\r\\n# - IB0wDQYJKoZIhvcNAQELBQADggIBAAfmiFEN4sbgmD+BcQM9naOhIW+z66bM9TG+\\r\\n# zwXiqf76V20ZMLPCxWbJat/15/B4vceoniXj+bzta1RXCCtRgkQS+7lTjMz0YBKK\\r\\n# - dsxAQEGb3FwX/1z5Xhc1mCRWS3TvQhDIr79/xn/yN31aPxzymXlKkVIArzgPF/Uv\\r\\n# eYFl2am1a+THzvbKegBvSzBEJCI8z+0DpZaPWSm8tv0E4XCfMkon/VWvL/625Y4z\\r\\n# - u2JfmttXQOnxzplmkIz/amJ/3cVKC5Em4jnsGUpxY517IW3DnKOiPPp/fZZqkHim\\r\\n# bdLhnPkd/DjYlPTGpQqWhqS9nhquBEKDuLWAmyI4ILUl5WTs9/S/fmNZJQ96LjlX\\r\\n# - dqJxqgaKD4kWumGnEcua2A5HmoDF0M2n0O99g/DhO3EJ3110mCIIYdqwUB5vvfHh\\r\\n# AN/nMQekkzr3ZUd46PioSKv33nJ+YWtvd6mBy6cJrDm77MbL2IK0cs0d9LiFAR6A\\r\\n# - +xuJKlQ5slvayA1VmXqHczsI5pgt6o3gMy4SKfXAL1QnIffIrE7aKLixqduWsqdC\\r\\n# osnPGUFN4Ib5KpqjEWYw07t0MkvfY3v1mYovG8chr1m1rtxEPJdQcdeh0sVV42ne\\r\\n# - V8HR3jDA/czmTfsNv11P6Z0eGTgvvM9YBS7vDaBQNdrvCScc1bN+NR4Iuto229Nf\\r\\n# j950iEkSoYICzjCCAjcCAQEwgfihgdCkgc0wgcoxCzAJBgNVBAYTAlVTMRMwEQYD\\r\\n# - VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy\\r\\n# b3NvZnQgQ29ycG9yYXRpb24xJTAjBgNVBAsTHE1pY3Jvc29mdCBBbWVyaWNhIE9w\\r\\n# - ZXJhdGlvbnMxJjAkBgNVBAsTHVRoYWxlcyBUU1MgRVNOOjNFN0EtRTM1OS1BMjVE\\r\\n# MSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFtcCBTZXJ2aWNloiMKAQEwBwYF\\r\\n# - Kw4DAhoDFQC/bp5Ulq6ZyZNyF3qGprJAw0NeW6CBgzCBgKR+MHwxCzAJBgNVBAYT\\r\\n# AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYD\\r\\n# - VQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBU\\r\\n# aW1lLVN0YW1wIFBDQSAyMDEwMA0GCSqGSIb3DQEBBQUAAgUA5HVvvTAiGA8yMDIx\\r\\n# - MDYxNzE0NTI0NVoYDzIwMjEwNjE4MTQ1MjQ1WjB3MD0GCisGAQQBhFkKBAExLzAt\\r\\n# MAoCBQDkdW+9AgEAMAoCAQACAhMMAgH/MAcCAQACAhGjMAoCBQDkdsE9AgEAMDYG\\r\\n# - CisGAQQBhFkKBAIxKDAmMAwGCisGAQQBhFkKAwKgCjAIAgEAAgMHoSChCjAIAgEA\\r\\n# AgMBhqAwDQYJKoZIhvcNAQEFBQADgYEAWH2uUm8L5ZAOfZ1hK6F7nsPP2D5YHFen\\r\\n# - 6xfPDeKHCVTHFx3Syo/AfJO8MAjM2H2mWiB5BY2kfQUkTw5gWcPRO2qgg0mEu4KR\\r\\n# XcLhDgsUB0qYpD0uW3lcY9sdVyJ2kfxSCKzED+2UCNZBBAj3k47kN5f+4xXaGdVR\\r\\n# - H/lMgmAhAXwxggMNMIIDCQIBATCBkzB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMK\\r\\n# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0\\r\\n# - IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0Eg\\r\\n# MjAxMAITMwAAAVIwS12JrOZwRwAAAAABUjANBglghkgBZQMEAgEFAKCCAUowGgYJ\\r\\n# - KoZIhvcNAQkDMQ0GCyqGSIb3DQEJEAEEMC8GCSqGSIb3DQEJBDEiBCAzYs+Y/Zdl\\r\\n# ZA/2jCDt+ETpvii1BrEoliHQA2SybVLq1DCB+gYLKoZIhvcNAQkQAi8xgeowgecw\\r\\n# - geQwgb0EIJPuXMejiyVQjF8QanwtdA2KT95wrq+64ZYhyYGuuyemMIGYMIGApH4w\\r\\n# fDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1Jl\\r\\n# - ZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMd\\r\\n# TWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAFSMEtdiazmcEcAAAAA\\r\\n# - AVIwIgQgh5ZLnHfhk2RwWk8svJSUxAnSyakqyQFNhm/pnHOyfCswDQYJKoZIhvcN\\r\\n# AQELBQAEggEASvG/aMEqHX4reRULoNavv8MVsgMygUiN9uxohEvUl6ZiMfg9ntOs\\r\\n# - KlP4h5zGIP9fVUb1hgNzgC/QVZlEIuYNW+KPTjIKW0Ah4z6da0EXXHGqNnPBTxOU\\r\\n# tO1yM0lJrAqPciy06uTRRmuPNnCait9mQTmMsOIRvOddUMCwnD/Vc1zA/CUM145Q\\r\\n# - nP9KMcBgoBYh2efBR/hxWJQoOk7st4NW6wjpdwB31eKN8M7F48oX9jIz5lsB6hqn\\r\\n# 0ksmqt9R3XBAykklM9NTbY2anTwEzK93vY/gx5Hy2dXWDmEj6keE5+D5yTKtPnyW\\r\\n# - ZUq0C+kDW7BETs7VKNWYL0RSNk9cNxTnLg==\\r\\n# SIG # End signature block\\r\\n\"\r\n + 0Umdiz2jWVXfSA6CePldzhOk5ySI5ShcBpn2b132gIs5lWlj3r1OD/lkOgOjQhSN\\r\\n# khCltIJso0c+f+LP822OJeHCSc1S6aKMH54rsrLZlSr9oYIS5TCCEuEGCisGAQQB\\r\\n# + gjcDAwExghLRMIISzQYJKoZIhvcNAQcCoIISvjCCEroCAQMxDzANBglghkgBZQME\\r\\n# AgEFADCCAVEGCyqGSIb3DQEJEAEEoIIBQASCATwwggE4AgEBBgorBgEEAYRZCgMB\\r\\n# + MDEwDQYJYIZIAWUDBAIBBQAEICye+7PcMlsaxZQZ4xS/CJz3pTAcisYNJPqQgd+y\\r\\n# OPl2AgZhHqeWrnsYEzIwMjEwODI4MDExODA1LjU4N1owBIACAfSggdCkgc0wgcox\\r\\n# + CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt\\r\\n# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJTAjBgNVBAsTHE1p\\r\\n# + Y3Jvc29mdCBBbWVyaWNhIE9wZXJhdGlvbnMxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg\\r\\n# RVNOOkQ2QkQtRTNFNy0xNjg1MSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt\\r\\n# + cCBTZXJ2aWNloIIOPDCCBPEwggPZoAMCAQICEzMAAAFQWKLUp5sLMOsAAAAAAVAw\\r\\n# DQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0\\r\\n# + b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh\\r\\n# dGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwHhcN\\r\\n# + MjAxMTEyMTgyNjAzWhcNMjIwMjExMTgyNjAzWjCByjELMAkGA1UEBhMCVVMxEzAR\\r\\n# BgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1p\\r\\n# + Y3Jvc29mdCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJpY2Eg\\r\\n# T3BlcmF0aW9uczEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046RDZCRC1FM0U3LTE2\\r\\n# + ODUxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2UwggEiMA0G\\r\\n# CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDnen+UeypZwycbVpoN8zNSAqnZl40+\\r\\n# + RjRTx17gsPvVYNxvPe6PzruS/J5X2mON6BRt+XaJATJJvkCgHvViJqrU7Q39T0qT\\r\\n# f02fOTTzkBR1zhB2ihL3XSaEpRE/L2wSa7vgL8jhPFi0dZ8nnqcj96bVLaRvPs7A\\r\\n# + NXeDF3xpZNgUSKL2EegBcmRUse+92uWk/NYsj8Y3ECv2qPnSCNESqdQ97JS4K3R5\\r\\n# PzHSCG2xYvRRLp+b90FVI2JCQr1IAj92UNke2wKHbQs5VdyJE+/vgg6tyZdaxW7A\\r\\n# + VojIq5KcfM3+QahNKpsdOHm37IwYmD1LfTsb0tVhXLjbh7o4T6cCKiWbAgMBAAGj\\r\\n# ggEbMIIBFzAdBgNVHQ4EFgQUglUZHxlF261kL0PBAEM7t+ufRX4wHwYDVR0jBBgw\\r\\n# + FoAU1WM6XIoxkPNDe3xGG8UzaFqFbVUwVgYDVR0fBE8wTTBLoEmgR4ZFaHR0cDov\\r\\n# L2NybC5taWNyb3NvZnQuY29tL3BraS9jcmwvcHJvZHVjdHMvTWljVGltU3RhUENB\\r\\n# + XzIwMTAtMDctMDEuY3JsMFoGCCsGAQUFBwEBBE4wTDBKBggrBgEFBQcwAoY+aHR0\\r\\n# cDovL3d3dy5taWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNUaW1TdGFQQ0FfMjAx\\r\\n# + MC0wNy0wMS5jcnQwDAYDVR0TAQH/BAIwADATBgNVHSUEDDAKBggrBgEFBQcDCDAN\\r\\n# BgkqhkiG9w0BAQsFAAOCAQEAUT9odHKO/uPj08AeL5P2HixMOqHK3oPk9JAdmlgf\\r\\n# + 2Xt8xF7Y9BHiFQNWYMKd/HI2ryYOu3SAAs3txZaRpalvY0R16WWIQzC9G9oqSD7Q\\r\\n# NN0RMxsiiCMM65/nq9xSPIrmYh6aTXFgIMuh4GLNk7gMQFybUbg2ZlLZsn9r5Rzx\\r\\n# + X/x8aK17ggEWKmiij1lgb/6AE+bAPUuEyy50ua6U9Zs0+bi8/HvnZs6PiMwGhtXz\\r\\n# /sRrZaAYjbLvaCXOk+DbRvHBoYHQQm35QrPUIfiNcw30giIMRy7xYHjiml/IxakM\\r\\n# + FUJ56mLE3SvnbSGxaKwppPlkIsw5HhemdSGHs5SlrQTbXjCCBnEwggRZoAMCAQIC\\r\\n# CmEJgSoAAAAAAAIwDQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYD\\r\\n# + VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy\\r\\n# b3NvZnQgQ29ycG9yYXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRp\\r\\n# + ZmljYXRlIEF1dGhvcml0eSAyMDEwMB4XDTEwMDcwMTIxMzY1NVoXDTI1MDcwMTIx\\r\\n# NDY1NVowfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNV\\r\\n# + BAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQG\\r\\n# A1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggEiMA0GCSqGSIb3\\r\\n# + DQEBAQUAA4IBDwAwggEKAoIBAQCpHQ28dxGKOiDs/BOX9fp/aZRrdFQQ1aUKAIKF\\r\\n# ++18aEssX8XD5WHCdrc+Zitb8BVTJwQxH0EbGpUdzgkTjnxhMFmxMEQP8WCIhFRD\\r\\n# + DNdNuDgIs0Ldk6zWczBXJoKjRQ3Q6vVHgc2/JGAyWGBG8lhHhjKEHnRhZ5FfgVSx\\r\\n# z5NMksHEpl3RYRNuKMYa+YaAu99h/EbBJx0kZxJyGiGKr0tkiVBisV39dx898Fd1\\r\\n# + rL2KQk1AUdEPnAY+Z3/1ZsADlkR+79BL/W7lmsqxqPJ6Kgox8NpOBpG2iAg16Hgc\\r\\n# sOmZzTznL0S6p/TcZL2kAcEgCZN4zfy8wMlEXV4WnAEFTyJNAgMBAAGjggHmMIIB\\r\\n# + 4jAQBgkrBgEEAYI3FQEEAwIBADAdBgNVHQ4EFgQU1WM6XIoxkPNDe3xGG8UzaFqF\\r\\n# bVUwGQYJKwYBBAGCNxQCBAweCgBTAHUAYgBDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud\\r\\n# + EwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAU1fZWy4/oolxiaNE9lJBb186aGMQwVgYD\\r\\n# VR0fBE8wTTBLoEmgR4ZFaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraS9jcmwv\\r\\n# + cHJvZHVjdHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3JsMFoGCCsGAQUFBwEB\\r\\n# BE4wTDBKBggrBgEFBQcwAoY+aHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraS9j\\r\\n# + ZXJ0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5jcnQwgaAGA1UdIAEB/wSBlTCB\\r\\n# kjCBjwYJKwYBBAGCNy4DMIGBMD0GCCsGAQUFBwIBFjFodHRwOi8vd3d3Lm1pY3Jv\\r\\n# + c29mdC5jb20vUEtJL2RvY3MvQ1BTL2RlZmF1bHQuaHRtMEAGCCsGAQUFBwICMDQe\\r\\n# MiAdAEwAZQBnAGEAbABfAFAAbwBsAGkAYwB5AF8AUwB0AGEAdABlAG0AZQBuAHQA\\r\\n# + LiAdMA0GCSqGSIb3DQEBCwUAA4ICAQAH5ohRDeLG4Jg/gXEDPZ2joSFvs+umzPUx\\r\\n# vs8F4qn++ldtGTCzwsVmyWrf9efweL3HqJ4l4/m87WtUVwgrUYJEEvu5U4zM9GAS\\r\\n# + inbMQEBBm9xcF/9c+V4XNZgkVkt070IQyK+/f8Z/8jd9Wj8c8pl5SpFSAK84Dxf1\\r\\n# L3mBZdmptWvkx872ynoAb0swRCQiPM/tA6WWj1kpvLb9BOFwnzJKJ/1Vry/+tuWO\\r\\n# + M7tiX5rbV0Dp8c6ZZpCM/2pif93FSguRJuI57BlKcWOdeyFtw5yjojz6f32WapB4\\r\\n# pm3S4Zz5Hfw42JT0xqUKloakvZ4argRCg7i1gJsiOCC1JeVk7Pf0v35jWSUPei45\\r\\n# + V3aicaoGig+JFrphpxHLmtgOR5qAxdDNp9DvfYPw4TtxCd9ddJgiCGHasFAeb73x\\r\\n# 4QDf5zEHpJM692VHeOj4qEir995yfmFrb3epgcunCaw5u+zGy9iCtHLNHfS4hQEe\\r\\n# + gPsbiSpUObJb2sgNVZl6h3M7COaYLeqN4DMuEin1wC9UJyH3yKxO2ii4sanblrKn\\r\\n# QqLJzxlBTeCG+SqaoxFmMNO7dDJL32N79ZmKLxvHIa9Zta7cRDyXUHHXodLFVeNp\\r\\n# + 3lfB0d4wwP3M5k37Db9dT+mdHhk4L7zPWAUu7w2gUDXa7wknHNWzfjUeCLraNtvT\\r\\n# X4/edIhJEqGCAs4wggI3AgEBMIH4oYHQpIHNMIHKMQswCQYDVQQGEwJVUzETMBEG\\r\\n# + A1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWlj\\r\\n# cm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1lcmljYSBP\\r\\n# + cGVyYXRpb25zMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjpENkJELUUzRTctMTY4\\r\\n# NTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcG\\r\\n# + BSsOAwIaAxUAIw17n3LxNWtGEZtallmkMZYeoBKggYMwgYCkfjB8MQswCQYDVQQG\\r\\n# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG\\r\\n# + A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQg\\r\\n# VGltZS1TdGFtcCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIFAOTTsfAwIhgPMjAy\\r\\n# + MTA4MjgwMjQ4MTZaGA8yMDIxMDgyOTAyNDgxNlowdzA9BgorBgEEAYRZCgQBMS8w\\r\\n# LTAKAgUA5NOx8AIBADAKAgEAAgIKaAIB/zAHAgEAAgIRVTAKAgUA5NUDcAIBADA2\\r\\n# + BgorBgEEAYRZCgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIB\\r\\n# AAIDAYagMA0GCSqGSIb3DQEBBQUAA4GBAJHZ2FIBGntJQBL1nw6XmcSgH6icLCFj\\r\\n# + IqhYKTQ4xV8AQhwMe1k3I87cU4vOBTUI7tYOQDLgJRUqEKufdQt7Gi9vwLW8rRWS\\r\\n# DSHGmydQEhqdfxxA7mB4obh9EM741+GpEp2VmgoIgEz+vbNrGpbQnpIuZCLdZPfu\\r\\n# + J3p5ReZSVOKVMYIDDTCCAwkCAQEwgZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgT\\r\\n# Cldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29m\\r\\n# + dCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENB\\r\\n# IDIwMTACEzMAAAFQWKLUp5sLMOsAAAAAAVAwDQYJYIZIAWUDBAIBBQCgggFKMBoG\\r\\n# + CSqGSIb3DQEJAzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0BCQQxIgQgco9so3th\\r\\n# yUUgdI3WZ1BAl4ZVxzZWEBNfpdJTRO95fm0wgfoGCyqGSIb3DQEJEAIvMYHqMIHn\\r\\n# + MIHkMIG9BCBs9D6fL5rCThgXJmGIhdXS6IY1Zg6op47dkKJ8L/Kj9jCBmDCBgKR+\\r\\n# MHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS\\r\\n# + ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMT\\r\\n# HU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAABUFii1KebCzDrAAAA\\r\\n# + AAFQMCIEIAt91UnrKowgSD32DDE/GX7AJA29JxN3cpvjMar4l4JtMA0GCSqGSIb3\\r\\n# DQEBCwUABIIBAG8bBcZI5pkQUtSmKCP6EWhC7JBhUMvUF8BzAEc/+uZxG1e93XaF\\r\\n# + GvzbTncwgFe1hnUbzWHtUAcIEHRb43LIbtmIWb8GCPhbkOJrjgNsFH+jhE29Ussh\\r\\n# 5CWiHsatMDtqY7a0yav8+HXveYYsk6gUjOS8GJNJRPdLYU52DEzmc5zpcnrAYv4g\\r\\n# + qSR3bRSD+A+uHtPzUvTOz2XMqPyKEixrLVSbKZpbIHKcikHAkTTL5GeFKk7/PHWw\\r\\n# 63ikvZC9psDhPutaq7HOJOjJB54WkrMe4pJWBhYiP9coOerDrfu1K2C22gfVC3kt\\r\\n# + r2DMiAaeHR3R2HwM19Lbl68fMR+lJCMbw/w=\\r\\n# SIG # End signature block\\r\\n\"\r\n \ ],\r\n \"parameters\": [\r\n {\r\n \"name\": \"arg1\",\r\n \"type\": \"string\",\r\n \"required\": false\r\n },\r\n {\r\n \"name\": \"arg2\",\r\n \"type\": \"string\",\r\n \"required\": false\r\n @@ -1321,7 +1368,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:51:15 GMT + - Thu, 02 Sep 2021 03:52:49 GMT expires: - '-1' pragma: @@ -1352,10 +1399,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions?api-version=2021-07-01 response: body: string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"virtualmachineextensionx15cf0eff\",\r\n @@ -1373,7 +1420,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:51:15 GMT + - Thu, 02 Sep 2021 03:52:49 GMT expires: - '-1' pragma: @@ -1390,7 +1437,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3992,Microsoft.Compute/LowCostGet30Min;31929 + - Microsoft.Compute/LowCostGet3Min;3992,Microsoft.Compute/LowCostGet30Min;31990 status: code: 200 message: OK @@ -1404,39 +1451,39 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2021-07-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\": \"fd19ee27-1058-4cd9-98f1-2364ada3e71a\",\r\n + \ \"properties\": {\r\n \"vmId\": \"bc737ab2-dd03-4ec7-87f5-38e7675d78af\",\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.4530.2107090502\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": + \"14393.4583.2108010852\"\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\"\r\n - \ },\r\n \"diskSizeGB\": 127,\r\n \"deleteOption\": \"Detach\"\r\n - \ },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": 0,\r\n - \ \"name\": \"virtualmachinex15cf0eff_disk2_a50e061efa8f47039c97d8ea6ef815ce\",\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 127\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"virtualmachinex15cf0eff_disk2_1c88fce1508d45f4b29540d6613f8826\",\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_a50e061efa8f47039c97d8ea6ef815ce\"\r\n - \ },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\": - false,\r\n \"deleteOption\": \"Detach\"\r\n },\r\n {\r\n - \ \"lun\": 1,\r\n \"name\": \"virtualmachinex15cf0eff_disk3_fb1d3ef280944725adf0d591e7d81e90\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk2_1c88fce1508d45f4b29540d6613f8826\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1023,\r\n \"toBeDetached\": false\r\n },\r\n {\r\n + \ \"lun\": 1,\r\n \"name\": \"virtualmachinex15cf0eff_disk3_c9ba933572224d51aaeaa2958592f548\",\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_fb1d3ef280944725adf0d591e7d81e90\"\r\n - \ },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\": - false,\r\n \"deleteOption\": \"Detach\"\r\n }\r\n ]\r\n - \ },\r\n \"osProfile\": {\r\n \"computerName\": \"myVM\",\r\n \"adminUsername\": + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk3_c9ba933572224d51aaeaa2958592f548\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\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 \"patchSettings\": {\r\n \"patchMode\": \"AutomaticByOS\",\r\n \"assessmentMode\": @@ -1459,7 +1506,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:51:15 GMT + - Thu, 02 Sep 2021 03:52:49 GMT expires: - '-1' pragma: @@ -1476,7 +1523,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3991,Microsoft.Compute/LowCostGet30Min;31928 + - Microsoft.Compute/LowCostGet3Min;3991,Microsoft.Compute/LowCostGet30Min;31989 status: code: 200 message: OK @@ -1494,26 +1541,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/runCommand?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/runCommand?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/08478eb2-d896-4a95-9d19-eadf9661d980?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e039acd3-6965-4aa3-a233-f7fffbab4eb0?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:51:15 GMT + - Thu, 02 Sep 2021 03:52:50 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/08478eb2-d896-4a95-9d19-eadf9661d980?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e039acd3-6965-4aa3-a233-f7fffbab4eb0?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1540,23 +1587,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/08478eb2-d896-4a95-9d19-eadf9661d980?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e039acd3-6965-4aa3-a233-f7fffbab4eb0?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:51:16.0644216+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"08478eb2-d896-4a95-9d19-eadf9661d980\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:52:50.446548+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"e039acd3-6965-4aa3-a233-f7fffbab4eb0\"\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '133' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:51:45 GMT + - Thu, 02 Sep 2021 03:53:19 GMT expires: - '-1' pragma: @@ -1573,7 +1620,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29990 + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29987 status: code: 200 message: OK @@ -1587,26 +1634,26 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/08478eb2-d896-4a95-9d19-eadf9661d980?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e039acd3-6965-4aa3-a233-f7fffbab4eb0?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:51:16.0644216+00:00\",\r\n \"endTime\": - \"2021-07-22T03:51:56.4083937+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T03:52:50.446548+00:00\",\r\n \"endTime\": + \"2021-09-02T03:53:20.7905069+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\": \"08478eb2-d896-4a95-9d19-eadf9661d980\"\r\n}" + succeeded\",\"message\":\"\"}]}\r\n },\r\n \"name\": \"e039acd3-6965-4aa3-a233-f7fffbab4eb0\"\r\n}" headers: cache-control: - no-cache content-length: - - '503' + - '502' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:52:16 GMT + - Thu, 02 Sep 2021 03:53:49 GMT expires: - '-1' pragma: @@ -1623,7 +1670,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29987 + - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29985 status: code: 200 message: OK @@ -1637,10 +1684,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/08478eb2-d896-4a95-9d19-eadf9661d980?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e039acd3-6965-4aa3-a233-f7fffbab4eb0?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '{"value":[{"code":"ComponentStatus/StdOut/succeeded","level":"Info","displayStatus":"Provisioning @@ -1654,7 +1701,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:52:16 GMT + - Thu, 02 Sep 2021 03:53:49 GMT expires: - '-1' pragma: @@ -1671,7 +1718,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29986 + - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29984 status: code: 200 message: OK @@ -1687,26 +1734,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/restart?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/restart?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/055c0e3d-faaa-472d-abdb-b1408f5f596f?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0f905da1-a4b8-4f81-a6da-6b9cfe662d27?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:52:16 GMT + - Thu, 02 Sep 2021 03:53:49 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/055c0e3d-faaa-472d-abdb-b1408f5f596f?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0f905da1-a4b8-4f81-a6da-6b9cfe662d27?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1733,15 +1780,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/055c0e3d-faaa-472d-abdb-b1408f5f596f?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0f905da1-a4b8-4f81-a6da-6b9cfe662d27?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:52:16.4085237+00:00\",\r\n \"endTime\": - \"2021-07-22T03:52:16.7053741+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"055c0e3d-faaa-472d-abdb-b1408f5f596f\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:53:50.7751385+00:00\",\r\n \"endTime\": + \"2021-09-02T03:53:51.1032442+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"0f905da1-a4b8-4f81-a6da-6b9cfe662d27\"\r\n}" headers: cache-control: - no-cache @@ -1750,7 +1797,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:52:46 GMT + - Thu, 02 Sep 2021 03:54:20 GMT expires: - '-1' pragma: @@ -1767,7 +1814,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29984 + - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29982 status: code: 200 message: OK @@ -1781,10 +1828,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/055c0e3d-faaa-472d-abdb-b1408f5f596f?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0f905da1-a4b8-4f81-a6da-6b9cfe662d27?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -1794,7 +1841,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:52:46 GMT + - Thu, 02 Sep 2021 03:54:20 GMT expires: - '-1' pragma: @@ -1807,7 +1854,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29983 + - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29981 status: code: 200 message: OK @@ -1823,26 +1870,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/powerOff?skipShutdown=false&api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/985e44a3-5636-42e3-abf6-611c9762df3c?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e1dbbc7f-301e-4e11-84ee-89ce4f877b05?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:52:46 GMT + - Thu, 02 Sep 2021 03:54:20 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/985e44a3-5636-42e3-abf6-611c9762df3c?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e1dbbc7f-301e-4e11-84ee-89ce4f877b05?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1869,15 +1916,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/985e44a3-5636-42e3-abf6-611c9762df3c?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e1dbbc7f-301e-4e11-84ee-89ce4f877b05?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:52:46.6430612+00:00\",\r\n \"endTime\": - \"2021-07-22T03:52:53.9087583+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"985e44a3-5636-42e3-abf6-611c9762df3c\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:54:21.0097296+00:00\",\r\n \"endTime\": + \"2021-09-02T03:54:24.5097801+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"e1dbbc7f-301e-4e11-84ee-89ce4f877b05\"\r\n}" headers: cache-control: - no-cache @@ -1886,7 +1933,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:53:16 GMT + - Thu, 02 Sep 2021 03:54:50 GMT expires: - '-1' pragma: @@ -1903,7 +1950,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29981 + - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29979 status: code: 200 message: OK @@ -1917,10 +1964,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/985e44a3-5636-42e3-abf6-611c9762df3c?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e1dbbc7f-301e-4e11-84ee-89ce4f877b05?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -1930,7 +1977,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:53:16 GMT + - Thu, 02 Sep 2021 03:54:50 GMT expires: - '-1' pragma: @@ -1943,7 +1990,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29980 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29978 status: code: 200 message: OK @@ -1959,26 +2006,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/start?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/start?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/addb4375-f828-48f3-928d-d2c28caef990?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/00ea8d97-a85c-4017-aea0-854aa50df0a0?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:53:16 GMT + - Thu, 02 Sep 2021 03:54:51 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/addb4375-f828-48f3-928d-d2c28caef990?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/00ea8d97-a85c-4017-aea0-854aa50df0a0?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -2005,24 +2052,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/addb4375-f828-48f3-928d-d2c28caef990?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/00ea8d97-a85c-4017-aea0-854aa50df0a0?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:53:16.8776318+00:00\",\r\n \"endTime\": - \"2021-07-22T03:53:20.2213789+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"addb4375-f828-48f3-928d-d2c28caef990\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:54:51.2443633+00:00\",\r\n \"endTime\": + \"2021-09-02T03:54:54.916239+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"00ea8d97-a85c-4017-aea0-854aa50df0a0\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:53:26 GMT + - Thu, 02 Sep 2021 03:55:01 GMT expires: - '-1' pragma: @@ -2039,7 +2086,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29979 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29979 status: code: 200 message: OK @@ -2053,10 +2100,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/addb4375-f828-48f3-928d-d2c28caef990?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/00ea8d97-a85c-4017-aea0-854aa50df0a0?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -2066,7 +2113,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:53:26 GMT + - Thu, 02 Sep 2021 03:55:01 GMT expires: - '-1' pragma: @@ -2079,7 +2126,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29978 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29978 status: code: 200 message: OK @@ -2097,10 +2144,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionx15cf0eff\",\r\n \"id\": @@ -2111,8 +2158,10 @@ interactions: \ \"type\": \"NetworkWatcherAgentWindows\",\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/7e965c5a-0d59-43ce-847b-9ec5b35703c4?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c92d657c-2f51-49e3-b203-9ae7d945dc66?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: @@ -2120,7 +2169,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:53:26 GMT + - Thu, 02 Sep 2021 03:55:01 GMT expires: - '-1' pragma: @@ -2139,7 +2188,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/UpdateVM3Min;235,Microsoft.Compute/UpdateVM30Min;1194 x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1194' status: code: 200 message: OK @@ -2153,15 +2202,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7e965c5a-0d59-43ce-847b-9ec5b35703c4?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c92d657c-2f51-49e3-b203-9ae7d945dc66?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:53:27.0807954+00:00\",\r\n \"endTime\": - \"2021-07-22T03:53:27.3620452+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"7e965c5a-0d59-43ce-847b-9ec5b35703c4\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:55:01.4631456+00:00\",\r\n \"endTime\": + \"2021-09-02T03:55:01.7912728+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"c92d657c-2f51-49e3-b203-9ae7d945dc66\"\r\n}" headers: cache-control: - no-cache @@ -2170,7 +2219,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:53:56 GMT + - Thu, 02 Sep 2021 03:55:31 GMT expires: - '-1' pragma: @@ -2187,7 +2236,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29976 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29976 status: code: 200 message: OK @@ -2201,10 +2250,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachineextensionx15cf0eff\",\r\n \"id\": @@ -2222,7 +2271,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:53:56 GMT + - Thu, 02 Sep 2021 03:55:31 GMT expires: - '-1' pragma: @@ -2239,7 +2288,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3991,Microsoft.Compute/LowCostGet30Min;31925 + - Microsoft.Compute/LowCostGet3Min;3997,Microsoft.Compute/LowCostGet30Min;31987 status: code: 200 message: OK @@ -2255,10 +2304,10 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/extensions/virtualmachineextensionx15cf0eff?api-version=2021-07-01 response: body: string: '' @@ -2266,17 +2315,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/dd261e5f-19d7-44c4-b430-b69e714db07f?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/27f1e174-d54b-4f05-845f-bc919d004c54?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:53:56 GMT + - Thu, 02 Sep 2021 03:55:31 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/dd261e5f-19d7-44c4-b430-b69e714db07f?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/27f1e174-d54b-4f05-845f-bc919d004c54?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -2287,9 +2336,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/UpdateVM3Min;234,Microsoft.Compute/UpdateVM30Min;1193 + - Microsoft.Compute/UpdateVM3Min;235,Microsoft.Compute/UpdateVM30Min;1193 x-ms-ratelimit-remaining-subscription-deletes: - - '14995' + - '14994' status: code: 202 message: Accepted @@ -2303,14 +2352,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/dd261e5f-19d7-44c4-b430-b69e714db07f?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/27f1e174-d54b-4f05-845f-bc919d004c54?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:53:57.3934937+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"dd261e5f-19d7-44c4-b430-b69e714db07f\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:55:31.7759019+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"27f1e174-d54b-4f05-845f-bc919d004c54\"\r\n}" headers: cache-control: - no-cache @@ -2319,7 +2368,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:54:26 GMT + - Thu, 02 Sep 2021 03:56:01 GMT expires: - '-1' pragma: @@ -2336,7 +2385,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29975 + - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29975 status: code: 200 message: OK @@ -2350,15 +2399,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/dd261e5f-19d7-44c4-b430-b69e714db07f?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/27f1e174-d54b-4f05-845f-bc919d004c54?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:53:57.3934937+00:00\",\r\n \"endTime\": - \"2021-07-22T03:54:37.6905826+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"dd261e5f-19d7-44c4-b430-b69e714db07f\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:55:31.7759019+00:00\",\r\n \"endTime\": + \"2021-09-02T03:56:02.0729857+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"27f1e174-d54b-4f05-845f-bc919d004c54\"\r\n}" headers: cache-control: - no-cache @@ -2367,7 +2416,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:54:57 GMT + - Thu, 02 Sep 2021 03:56:30 GMT expires: - '-1' pragma: @@ -2384,7 +2433,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29973 + - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29973 status: code: 200 message: OK @@ -2400,26 +2449,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/powerOff?skipShutdown=false&api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/23be329c-6130-4a74-b51b-c80fd5a2b1d4?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/73bd84d4-2f34-4d91-8153-a0833742c1b6?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:54:57 GMT + - Thu, 02 Sep 2021 03:56:31 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/23be329c-6130-4a74-b51b-c80fd5a2b1d4?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/73bd84d4-2f34-4d91-8153-a0833742c1b6?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -2430,7 +2479,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/UpdateVM3Min;234,Microsoft.Compute/UpdateVM30Min;1192 + - Microsoft.Compute/UpdateVM3Min;235,Microsoft.Compute/UpdateVM30Min;1192 x-ms-ratelimit-remaining-subscription-writes: - '1195' status: @@ -2446,15 +2495,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/23be329c-6130-4a74-b51b-c80fd5a2b1d4?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/73bd84d4-2f34-4d91-8153-a0833742c1b6?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:54:57.6750667+00:00\",\r\n \"endTime\": - \"2021-07-22T03:55:08.7845152+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"23be329c-6130-4a74-b51b-c80fd5a2b1d4\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:56:32.0107341+00:00\",\r\n \"endTime\": + \"2021-09-02T03:56:42.5576747+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"73bd84d4-2f34-4d91-8153-a0833742c1b6\"\r\n}" headers: cache-control: - no-cache @@ -2463,7 +2512,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:55:27 GMT + - Thu, 02 Sep 2021 03:57:02 GMT expires: - '-1' pragma: @@ -2480,7 +2529,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29971 + - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29971 status: code: 200 message: OK @@ -2494,10 +2543,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/23be329c-6130-4a74-b51b-c80fd5a2b1d4?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/73bd84d4-2f34-4d91-8153-a0833742c1b6?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -2507,7 +2556,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:55:27 GMT + - Thu, 02 Sep 2021 03:57:02 GMT expires: - '-1' pragma: @@ -2520,7 +2569,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29970 + - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29970 status: code: 200 message: OK @@ -2536,26 +2585,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/reapply?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/reapply?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2f4f4dc9-ceb3-494f-9014-43d17732e35e?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c9eb7be2-3a3a-40d0-a407-898061505564?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:55:27 GMT + - Thu, 02 Sep 2021 03:57:02 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2f4f4dc9-ceb3-494f-9014-43d17732e35e?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c9eb7be2-3a3a-40d0-a407-898061505564?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -2566,7 +2615,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/UpdateVM3Min;234,Microsoft.Compute/UpdateVM30Min;1191 + - Microsoft.Compute/UpdateVM3Min;235,Microsoft.Compute/UpdateVM30Min;1191 x-ms-ratelimit-remaining-subscription-writes: - '1194' status: @@ -2582,24 +2631,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2f4f4dc9-ceb3-494f-9014-43d17732e35e?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c9eb7be2-3a3a-40d0-a407-898061505564?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:55:27.8939041+00:00\",\r\n \"endTime\": - \"2021-07-22T03:55:29.7376805+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"2f4f4dc9-ceb3-494f-9014-43d17732e35e\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:57:02.2297299+00:00\",\r\n \"endTime\": + \"2021-09-02T03:57:03.776581+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"c9eb7be2-3a3a-40d0-a407-898061505564\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:55:57 GMT + - Thu, 02 Sep 2021 03:57:32 GMT expires: - '-1' pragma: @@ -2616,7 +2665,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29968 + - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29968 status: code: 200 message: OK @@ -2630,10 +2679,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/2f4f4dc9-ceb3-494f-9014-43d17732e35e?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c9eb7be2-3a3a-40d0-a407-898061505564?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -2643,7 +2692,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:55:57 GMT + - Thu, 02 Sep 2021 03:57:32 GMT expires: - '-1' pragma: @@ -2656,7 +2705,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29967 + - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29967 status: code: 200 message: OK @@ -2672,26 +2721,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/redeploy?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/redeploy?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6df7e297-b768-4647-99df-63fa4ae31da4?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bda2ab68-dc63-461b-a068-510004f5a9ad?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:55:57 GMT + - Thu, 02 Sep 2021 03:57:32 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6df7e297-b768-4647-99df-63fa4ae31da4?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bda2ab68-dc63-461b-a068-510004f5a9ad?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -2702,7 +2751,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/UpdateVM3Min;234,Microsoft.Compute/UpdateVM30Min;1190 + - Microsoft.Compute/UpdateVM3Min;235,Microsoft.Compute/UpdateVM30Min;1190 x-ms-ratelimit-remaining-subscription-writes: - '1193' status: @@ -2718,14 +2767,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6df7e297-b768-4647-99df-63fa4ae31da4?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bda2ab68-dc63-461b-a068-510004f5a9ad?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:55:58.0970403+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"6df7e297-b768-4647-99df-63fa4ae31da4\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:57:32.4955556+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"bda2ab68-dc63-461b-a068-510004f5a9ad\"\r\n}" headers: cache-control: - no-cache @@ -2734,7 +2783,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:56:27 GMT + - Thu, 02 Sep 2021 03:58:02 GMT expires: - '-1' pragma: @@ -2765,14 +2814,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6df7e297-b768-4647-99df-63fa4ae31da4?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bda2ab68-dc63-461b-a068-510004f5a9ad?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:55:58.0970403+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"6df7e297-b768-4647-99df-63fa4ae31da4\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:57:32.4955556+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"bda2ab68-dc63-461b-a068-510004f5a9ad\"\r\n}" headers: cache-control: - no-cache @@ -2781,7 +2830,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:56:57 GMT + - Thu, 02 Sep 2021 03:58:31 GMT expires: - '-1' pragma: @@ -2812,14 +2861,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6df7e297-b768-4647-99df-63fa4ae31da4?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bda2ab68-dc63-461b-a068-510004f5a9ad?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:55:58.0970403+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"6df7e297-b768-4647-99df-63fa4ae31da4\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:57:32.4955556+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"bda2ab68-dc63-461b-a068-510004f5a9ad\"\r\n}" headers: cache-control: - no-cache @@ -2828,7 +2877,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:57:27 GMT + - Thu, 02 Sep 2021 03:59:02 GMT expires: - '-1' pragma: @@ -2845,7 +2894,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29959 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29959 status: code: 200 message: OK @@ -2859,15 +2908,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6df7e297-b768-4647-99df-63fa4ae31da4?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bda2ab68-dc63-461b-a068-510004f5a9ad?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:55:58.0970403+00:00\",\r\n \"endTime\": - \"2021-07-22T03:57:50.4565077+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"6df7e297-b768-4647-99df-63fa4ae31da4\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T03:57:32.4955556+00:00\",\r\n \"endTime\": + \"2021-09-02T03:59:17.8557406+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"bda2ab68-dc63-461b-a068-510004f5a9ad\"\r\n}" headers: cache-control: - no-cache @@ -2876,7 +2925,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:57:57 GMT + - Thu, 02 Sep 2021 03:59:32 GMT expires: - '-1' pragma: @@ -2893,7 +2942,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29956 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29956 status: code: 200 message: OK @@ -2907,10 +2956,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6df7e297-b768-4647-99df-63fa4ae31da4?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/bda2ab68-dc63-461b-a068-510004f5a9ad?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -2920,7 +2969,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:57:57 GMT + - Thu, 02 Sep 2021 03:59:32 GMT expires: - '-1' pragma: @@ -2933,7 +2982,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29955 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29955 status: code: 200 message: OK @@ -2952,39 +3001,39 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2021-07-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\": \"fd19ee27-1058-4cd9-98f1-2364ada3e71a\",\r\n + \ \"properties\": {\r\n \"vmId\": \"bc737ab2-dd03-4ec7-87f5-38e7675d78af\",\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.4530.2107090502\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": + \"14393.4583.2108010852\"\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\"\r\n - \ },\r\n \"diskSizeGB\": 127,\r\n \"deleteOption\": \"Detach\"\r\n - \ },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": 0,\r\n - \ \"name\": \"virtualmachinex15cf0eff_disk2_a50e061efa8f47039c97d8ea6ef815ce\",\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 127\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"virtualmachinex15cf0eff_disk2_1c88fce1508d45f4b29540d6613f8826\",\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_a50e061efa8f47039c97d8ea6ef815ce\"\r\n - \ },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\": - false,\r\n \"deleteOption\": \"Detach\"\r\n },\r\n {\r\n - \ \"lun\": 1,\r\n \"name\": \"virtualmachinex15cf0eff_disk3_fb1d3ef280944725adf0d591e7d81e90\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk2_1c88fce1508d45f4b29540d6613f8826\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1023,\r\n \"toBeDetached\": false\r\n },\r\n {\r\n + \ \"lun\": 1,\r\n \"name\": \"virtualmachinex15cf0eff_disk3_c9ba933572224d51aaeaa2958592f548\",\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_fb1d3ef280944725adf0d591e7d81e90\"\r\n - \ },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\": - false,\r\n \"deleteOption\": \"Detach\"\r\n }\r\n ]\r\n - \ },\r\n \"osProfile\": {\r\n \"computerName\": \"myVM\",\r\n \"adminUsername\": + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk3_c9ba933572224d51aaeaa2958592f548\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\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 \"patchSettings\": {\r\n \"patchMode\": \"AutomaticByOS\",\r\n \"assessmentMode\": @@ -3000,7 +3049,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:57:57 GMT + - Thu, 02 Sep 2021 03:59:32 GMT expires: - '-1' pragma: @@ -3017,9 +3066,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/PutVM3Min;744,Microsoft.Compute/PutVM30Min;3726 + - Microsoft.Compute/PutVM3Min;744,Microsoft.Compute/PutVM30Min;3727 x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1193' status: code: 200 message: OK @@ -3033,39 +3082,39 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2021-07-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\": \"fd19ee27-1058-4cd9-98f1-2364ada3e71a\",\r\n + \ \"properties\": {\r\n \"vmId\": \"bc737ab2-dd03-4ec7-87f5-38e7675d78af\",\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.4530.2107090502\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": + \"14393.4583.2108010852\"\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\"\r\n - \ },\r\n \"diskSizeGB\": 127,\r\n \"deleteOption\": \"Detach\"\r\n - \ },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": 0,\r\n - \ \"name\": \"virtualmachinex15cf0eff_disk2_a50e061efa8f47039c97d8ea6ef815ce\",\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 127\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"virtualmachinex15cf0eff_disk2_1c88fce1508d45f4b29540d6613f8826\",\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_a50e061efa8f47039c97d8ea6ef815ce\"\r\n - \ },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\": - false,\r\n \"deleteOption\": \"Detach\"\r\n },\r\n {\r\n - \ \"lun\": 1,\r\n \"name\": \"virtualmachinex15cf0eff_disk3_fb1d3ef280944725adf0d591e7d81e90\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk2_1c88fce1508d45f4b29540d6613f8826\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1023,\r\n \"toBeDetached\": false\r\n },\r\n {\r\n + \ \"lun\": 1,\r\n \"name\": \"virtualmachinex15cf0eff_disk3_c9ba933572224d51aaeaa2958592f548\",\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_fb1d3ef280944725adf0d591e7d81e90\"\r\n - \ },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\": - false,\r\n \"deleteOption\": \"Detach\"\r\n }\r\n ]\r\n - \ },\r\n \"osProfile\": {\r\n \"computerName\": \"myVM\",\r\n \"adminUsername\": + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinex15cf0eff_disk3_c9ba933572224d51aaeaa2958592f548\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\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 \"patchSettings\": {\r\n \"patchMode\": \"AutomaticByOS\",\r\n \"assessmentMode\": @@ -3081,7 +3130,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:58:28 GMT + - Thu, 02 Sep 2021 04:00:02 GMT expires: - '-1' pragma: @@ -3098,7 +3147,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3997,Microsoft.Compute/LowCostGet30Min;31923 + - Microsoft.Compute/LowCostGet3Min;3996,Microsoft.Compute/LowCostGet30Min;31983 status: code: 200 message: OK @@ -3114,10 +3163,10 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/generalize?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/generalize?api-version=2021-07-01 response: body: string: '' @@ -3127,7 +3176,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:58:28 GMT + - Thu, 02 Sep 2021 04:00:02 GMT expires: - '-1' pragma: @@ -3158,26 +3207,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/deallocate?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff/deallocate?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6c7688e1-dd92-4262-bdd6-dd4c5b8c2d2b?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/48867fb2-1581-4445-a599-10385a0b36d7?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:58:28 GMT + - Thu, 02 Sep 2021 04:00:02 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6c7688e1-dd92-4262-bdd6-dd4c5b8c2d2b?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/48867fb2-1581-4445-a599-10385a0b36d7?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -3204,61 +3253,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6c7688e1-dd92-4262-bdd6-dd4c5b8c2d2b?api-version=2021-04-01 - response: - body: - string: "{\r\n \"startTime\": \"2021-07-22T03:58:29.0657765+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"6c7688e1-dd92-4262-bdd6-dd4c5b8c2d2b\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 22 Jul 2021 03:58:38 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;29953 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6c7688e1-dd92-4262-bdd6-dd4c5b8c2d2b?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/48867fb2-1581-4445-a599-10385a0b36d7?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:58:29.0657765+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"6c7688e1-dd92-4262-bdd6-dd4c5b8c2d2b\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:00:03.6060751+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"48867fb2-1581-4445-a599-10385a0b36d7\"\r\n}" headers: cache-control: - no-cache @@ -3267,7 +3269,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:59:14 GMT + - Thu, 02 Sep 2021 04:00:12 GMT expires: - '-1' pragma: @@ -3284,7 +3286,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29949 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29954 status: code: 200 message: OK @@ -3298,15 +3300,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6c7688e1-dd92-4262-bdd6-dd4c5b8c2d2b?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/48867fb2-1581-4445-a599-10385a0b36d7?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:58:29.0657765+00:00\",\r\n \"endTime\": - \"2021-07-22T03:59:16.2689198+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"6c7688e1-dd92-4262-bdd6-dd4c5b8c2d2b\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:00:03.6060751+00:00\",\r\n \"endTime\": + \"2021-09-02T04:00:30.8094113+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"48867fb2-1581-4445-a599-10385a0b36d7\"\r\n}" headers: cache-control: - no-cache @@ -3315,7 +3317,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:59:44 GMT + - Thu, 02 Sep 2021 04:00:49 GMT expires: - '-1' pragma: @@ -3332,7 +3334,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29947 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29950 status: code: 200 message: OK @@ -3346,10 +3348,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6c7688e1-dd92-4262-bdd6-dd4c5b8c2d2b?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/48867fb2-1581-4445-a599-10385a0b36d7?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -3359,7 +3361,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 03:59:44 GMT + - Thu, 02 Sep 2021 04:00:49 GMT expires: - '-1' pragma: @@ -3372,7 +3374,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29946 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29949 status: code: 200 message: OK @@ -3388,10 +3390,10 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/virtualmachinex15cf0eff?api-version=2021-07-01 response: body: string: '' @@ -3399,17 +3401,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fed93629-9fa8-45bc-86a1-0c66432c6b69?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9380c091-09d8-4c9c-bd12-55123295b6d2?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 03:59:44 GMT + - Thu, 02 Sep 2021 04:00:49 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fed93629-9fa8-45bc-86a1-0c66432c6b69?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9380c091-09d8-4c9c-bd12-55123295b6d2?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -3422,7 +3424,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteVM3Min;238,Microsoft.Compute/DeleteVM30Min;1198 x-ms-ratelimit-remaining-subscription-deletes: - - '14994' + - '14993' status: code: 202 message: Accepted @@ -3436,15 +3438,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fed93629-9fa8-45bc-86a1-0c66432c6b69?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9380c091-09d8-4c9c-bd12-55123295b6d2?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T03:59:45.4410141+00:00\",\r\n \"endTime\": - \"2021-07-22T03:59:45.8784131+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"fed93629-9fa8-45bc-86a1-0c66432c6b69\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:00:49.9502014+00:00\",\r\n \"endTime\": + \"2021-09-02T04:00:50.4502085+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"9380c091-09d8-4c9c-bd12-55123295b6d2\"\r\n}" headers: cache-control: - no-cache @@ -3453,7 +3455,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:59:54 GMT + - Thu, 02 Sep 2021 04:00:59 GMT expires: - '-1' pragma: @@ -3470,7 +3472,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29944 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29947 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 595fcc632ae5..96124889e678 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,10 +9,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-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=2021-07-01 response: body: string: "{\r\n \"properties\": {\r\n \"operatingSystem\": \"Windows\",\r\n @@ -28,7 +28,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:59:56 GMT + - Thu, 02 Sep 2021 04:01:01 GMT expires: - '-1' pragma: @@ -59,10 +59,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-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=2021-07-01 response: body: string: "[\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"BGInfo\",\r\n @@ -82,7 +82,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:59:56 GMT + - Thu, 02 Sep 2021 04:01:01 GMT expires: - '-1' pragma: @@ -113,10 +113,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-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=2021-07-01 response: body: string: "[\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"1.0\",\r\n @@ -158,7 +158,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:59:56 GMT + - Thu, 02 Sep 2021 04:01:01 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 89de73a149b1..0ffaff5bbe2d 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,10 +9,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-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=2021-07-01 response: body: string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"architecture\": @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:59:58 GMT + - Thu, 02 Sep 2021 04:01:02 GMT expires: - '-1' pragma: @@ -62,15 +62,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-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=2021-07-01 response: body: - string: "[\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 + string: "[\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.1518.2010132039\",\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.1518.2010132039\"\r\n @@ -96,6 +94,8 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/17763.2029.2107060607\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"17763.2061.2107070810\",\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.2061.2107070810\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"17763.2114.2108051826\",\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.2114.2108051826\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"2019.0.20181107\",\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.20181107\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"2019.0.20181122\",\r\n @@ -119,7 +119,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:59:58 GMT + - Thu, 02 Sep 2021 04:01:02 GMT expires: - '-1' pragma: @@ -150,10 +150,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers?api-version=2021-07-01 response: body: string: "[\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"19h1gen2servertest\",\r\n @@ -186,8 +186,6 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/windows-8-0-vhd-server-prod-stage\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"windows-8-1-vhd-server-prod-stage\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/windows-8-1-vhd-server-prod-stage\"\r\n - \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Windows-HUB\",\r\n - \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/Windows-HUB\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"windows-server-2012-vhd-server-prod-stage\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/windows-server-2012-vhd-server-prod-stage\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"WindowsServer\",\r\n @@ -205,11 +203,11 @@ interactions: cache-control: - no-cache content-length: - - '6381' + - '6130' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:59:58 GMT + - Thu, 02 Sep 2021 04:01:03 GMT expires: - '-1' pragma: @@ -240,10 +238,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers?api-version=2021-07-01 response: body: string: "[\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"128technology\",\r\n @@ -312,6 +310,10 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/actian_matrix\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"actifio\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/actifio\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"actiphy\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/actiphy\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"actiphyinc1627974506603\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/actiphyinc1627974506603\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"activeeon\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/activeeon\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"activeops\",\r\n @@ -374,6 +376,10 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/alienvault\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"alldigital-brevity\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/alldigital-brevity\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"almalinux\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/almalinux\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"almalinuxosfoundation1628089859865\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/almalinuxosfoundation1628089859865\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"altair-engineering-inc\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/altair-engineering-inc\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"altamira-corporation\",\r\n @@ -438,6 +444,8 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/artificial-intelligence-techniques-sl\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"arubanetworks-4922182\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/arubanetworks-4922182\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"asdivertissementinc1617837708654\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/asdivertissementinc1617837708654\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"asigra\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/asigra\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"aspentechnologyhq-1353108\",\r\n @@ -492,6 +500,8 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/axway\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"axxana\",\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\": \"azhpc\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/azhpc\"\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 @@ -966,6 +976,8 @@ interactions: \ \"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\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/edevtech\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"edgelesssystems\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/edgelesssystems\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"edgenetworks\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/edgenetworks\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"edispheresoftwareprivatelimited1606199736428\",\r\n @@ -1198,6 +1210,8 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/hillstone-networks\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"hitachi-solutions\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/hitachi-solutions\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"holo-industrie40softwaregmbh1600957636008\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/holo-industrie40softwaregmbh1600957636008\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"hortonworks\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/hortonworks\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"hpe\",\r\n @@ -1270,6 +1284,8 @@ interactions: \ \"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\": \"infinitesoftwarecorporation1579223971125\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/infinitesoftwarecorporation1579223971125\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"infiotinc1614034091460\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/infiotinc1614034091460\"\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\",\r\n @@ -1292,8 +1308,12 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ingrammicro\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"innomindssoftware\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/innomindssoftware\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"innovatorartificialtechsrl1619180685551\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/innovatorartificialtechsrl1619180685551\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"innovtech\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/innovtech\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"instight-technology\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/instight-technology\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"intel-bigdl\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/intel-bigdl\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"intel-fpga\",\r\n @@ -1308,6 +1328,8 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/intersystems\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"intigua\",\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\": \"introspecioltd1629872641188\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/introspecioltd1629872641188\"\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 @@ -1390,6 +1412,8 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/kepion\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"KevlarExtensions.M365SecurityHostIDS\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/KevlarExtensions.M365SecurityHostIDS\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"KevlarExtensions.M365SecurityInventory.NameChangeTest\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/KevlarExtensions.M365SecurityInventory.NameChangeTest\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"kinetica\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/kinetica\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"kinvolk\",\r\n @@ -1452,6 +1476,8 @@ interactions: \ \"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\": \"llcitpro\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/llcitpro\"\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 @@ -1510,6 +1536,8 @@ interactions: \ \"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\": \"meshifyappinc1622759451429\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/meshifyappinc1622759451429\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"messagesolution\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/messagesolution\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"mettainnovations-4900054\",\r\n @@ -1570,6 +1598,10 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.ChangeTracking\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.ChangeTracking.Test\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.ChangeTracking.Test\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.ChangeTrackingAndInventory\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.ChangeTrackingAndInventory\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Chaos\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Chaos\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.Compute.Security\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Compute.Security\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.Azure.ContainerUpstream\",\r\n @@ -2132,6 +2164,8 @@ interactions: \ \"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.AzureEnhancedMonitoring.Test\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.AzureCAT.AzureEnhancedMonitoring.Test\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.AzureCAT.AzureEnhancedMonitoringTest\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.AzureCAT.AzureEnhancedMonitoringTest\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.AzureData\",\r\n @@ -2274,6 +2308,8 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.WindowsAzure.Compute.test\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Microsoft.WVD\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.WVD\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"microsoftagciuk\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/microsoftagciuk\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"microsoftazurecituswarp\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/microsoftazurecituswarp\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"MicrosoftAzureSiteRecovery\",\r\n @@ -2340,6 +2376,8 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/mobilab\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"modern-systems\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/modern-systems\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"monitorapp1579029852605\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/monitorapp1579029852605\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"monitorcomputersystemsltd\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/monitorcomputersystemsltd\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"moogsoft\",\r\n @@ -2378,6 +2416,8 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ncache\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ncbi\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ncbi\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ncomputingglobalinc1604353053068\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ncomputingglobalinc1604353053068\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ndl\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ndl\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"nebbiolo-technologies-inc\",\r\n @@ -2388,6 +2428,8 @@ interactions: \ \"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\": \"neos\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/neos\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"neowaybusinesssolutions-4956350\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/neowaybusinesssolutions-4956350\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"netapp\",\r\n @@ -2524,6 +2566,8 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/opslogix\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"opswatinc1619007967290\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/opswatinc1619007967290\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"optimitiveslu1618320281443\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/optimitiveslu1618320281443\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"option3\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/option3\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"Oracle\",\r\n @@ -2608,6 +2652,8 @@ interactions: \ \"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\": \"prakshepprivatelimited1619949827900\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/prakshepprivatelimited1619949827900\"\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\",\r\n @@ -2638,6 +2684,10 @@ interactions: \ \"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\": \"proliongmbh1628175060372\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/proliongmbh1628175060372\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"protegrityusainc1627404648458\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/protegrityusainc1627404648458\"\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\": \"proventeq\",\r\n @@ -2740,6 +2790,8 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/RightScaleLinux\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"RightScaleWindowsServer\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/RightScaleWindowsServer\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"rimo3\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/rimo3\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"ringsoftwareresearchanddevelopmentinc1578946072257\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/ringsoftwareresearchanddevelopmentinc1578946072257\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"riverbed\",\r\n @@ -3300,6 +3352,8 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/viptela\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"vircom\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/vircom\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"virtamovecorp1615909247913\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/virtamovecorp1615909247913\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"virtualpulsesro1607008728942\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/virtualpulsesro1607008728942\"\r\n \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"visualsoft-center\",\r\n @@ -3435,11 +3489,11 @@ interactions: cache-control: - no-cache content-length: - - '362065' + - '368399' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:59:58 GMT + - Thu, 02 Sep 2021 04:01:03 GMT expires: - '-1' pragma: @@ -3468,10 +3522,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-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=2021-07-01 response: body: string: "[\r\n {\r\n \"properties\": {\r\n \"automaticOSUpgradeProperties\": @@ -3584,10 +3638,6 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-datacenter-with-containers-gs\"\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\": \"2016-Datacenter-with-RDSH\",\r\n - \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter-with-RDSH\"\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\": \"2016-Datacenter-zhcn\",\r\n \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter-zhcn\"\r\n \ },\r\n {\r\n \"properties\": {\r\n \"automaticOSUpgradeProperties\": @@ -3676,6 +3726,38 @@ interactions: \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-datacenter-zhcn-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\": \"2022-datacenter\",\r\n \"id\": + \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2022-datacenter\"\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\": \"2022-datacenter-core\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2022-datacenter-core\"\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\": \"2022-datacenter-core-g2\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2022-datacenter-core-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\": \"2022-datacenter-core-smalldisk\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2022-datacenter-core-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\": \"2022-datacenter-core-smalldisk-g2\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2022-datacenter-core-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\": \"2022-datacenter-g2\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2022-datacenter-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\": \"2022-datacenter-smalldisk\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2022-datacenter-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\": \"2022-datacenter-smalldisk-g2\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2022-datacenter-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-1803-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-1803-with-containers-smalldisk-g2\"\r\n \ },\r\n {\r\n \"properties\": {\r\n \"automaticOSUpgradeProperties\": @@ -3727,11 +3809,11 @@ interactions: cache-control: - no-cache content-length: - - '27002' + - '29947' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 03:59:59 GMT + - Thu, 02 Sep 2021 04:01:03 GMT expires: - '-1' pragma: 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 9fa7aae62899..09b6534f1064 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 @@ -14,17 +14,17 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356?api-version=2021-02-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/\\\"30053785-a336-4e3a-85c6-305a337c344b\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"4186975d-91a7-474f-bde2-6357d1fc1c0e\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": - \"03fe2241-03ef-4923-b57c-a754148b17ce\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + \"20e23dd9-6cee-4bb1-bc47-869680593f2e\",\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 \ }\r\n}" @@ -32,7 +32,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/5241f8ea-c230-4940-94e4-f716b1981f39?api-version=2021-02-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/e93df9cf-9164-43d8-9556-d7de8e7f9d25?api-version=2021-02-01 cache-control: - no-cache content-length: @@ -40,7 +40,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:00:01 GMT + - Thu, 02 Sep 2021 04:01:06 GMT expires: - '-1' pragma: @@ -53,9 +53,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 363ba08c-b7ff-4372-abbc-5bd93a3dedc4 + - 9a5aa273-b46e-4775-8fce-298fd7a6366c x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 201 message: Created @@ -69,10 +69,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/5241f8ea-c230-4940-94e4-f716b1981f39?api-version=2021-02-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/e93df9cf-9164-43d8-9556-d7de8e7f9d25?api-version=2021-02-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -84,7 +84,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:00:04 GMT + - Thu, 02 Sep 2021 04:01:09 GMT expires: - '-1' pragma: @@ -101,7 +101,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 6a3d5d94-595c-484a-a54c-00bd6fdb455e + - e379d9fa-03ea-4c73-a8fc-639e387235bb status: code: 200 message: OK @@ -115,17 +115,17 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356?api-version=2021-02-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/\\\"de8889e3-d450-43d3-aa07-b4e9a6d8111a\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"6cbd9ef4-3868-4d3d-bff7-7840848dbdae\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": - \"03fe2241-03ef-4923-b57c-a754148b17ce\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + \"20e23dd9-6cee-4bb1-bc47-869680593f2e\",\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 \ }\r\n}" @@ -137,9 +137,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:00:04 GMT + - Thu, 02 Sep 2021 04:01:09 GMT etag: - - W/"de8889e3-d450-43d3-aa07-b4e9a6d8111a" + - W/"6cbd9ef4-3868-4d3d-bff7-7840848dbdae" expires: - '-1' pragma: @@ -156,7 +156,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 7ef0c947-afca-43d1-a948-558492adc6f0 + - 0b73affb-80ef-478e-87d7-8f0d3cdae108 status: code: 200 message: OK @@ -174,21 +174,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356/subnets/subnetnamexd7d31356?api-version=2021-02-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/\\\"65130269-7f39-4c89-8ec9-0e113501d2f2\\\"\",\r\n \"properties\": + \ \"etag\": \"W/\\\"97471de8-793c-433f-a376-3e0975724e0e\\\"\",\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/2daee17c-2053-4ce6-b37d-4d698a319f2c?api-version=2021-02-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/e6da860b-987d-40e0-aba3-fbaea9ebf28e?api-version=2021-02-01 cache-control: - no-cache content-length: @@ -196,7 +196,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:00:04 GMT + - Thu, 02 Sep 2021 04:01:09 GMT expires: - '-1' pragma: @@ -209,9 +209,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 0151ffeb-4c75-46d0-b203-6b56cc9ae109 + - cb08f71b-058e-4150-83f9-0030be644eae x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' status: code: 201 message: Created @@ -225,56 +225,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/2daee17c-2053-4ce6-b37d-4d698a319f2c?api-version=2021-02-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: - - Thu, 22 Jul 2021 04:00:07 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: - - 547e3e8f-da97-426f-9a98-1b2e03ed6634 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/2daee17c-2053-4ce6-b37d-4d698a319f2c?api-version=2021-02-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/e6da860b-987d-40e0-aba3-fbaea9ebf28e?api-version=2021-02-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -286,7 +240,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:00:17 GMT + - Thu, 02 Sep 2021 04:01:12 GMT expires: - '-1' pragma: @@ -303,7 +257,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 212809fc-a978-47f7-9ce5-c98ca6da0896 + - ce1496b9-8031-4ccb-9044-4b555499178b status: code: 200 message: OK @@ -317,14 +271,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexd7d31356/subnets/subnetnamexd7d31356?api-version=2021-02-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/\\\"f04bf227-6912-4cce-b9ce-e11735739940\\\"\",\r\n \"properties\": + \ \"etag\": \"W/\\\"16c956eb-be15-4377-91d6-a03a73619391\\\"\",\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\n },\r\n \"type\": @@ -337,9 +291,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:00:17 GMT + - Thu, 02 Sep 2021 04:01:12 GMT etag: - - W/"f04bf227-6912-4cce-b9ce-e11735739940" + - W/"16c956eb-be15-4377-91d6-a03a73619391" expires: - '-1' pragma: @@ -356,7 +310,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 700738d9-f641-4712-b3d6-c3b7c9a76e89 + - 99947209-3a99-4ee3-a65d-b3dbfb147e75 status: code: 200 message: OK @@ -375,16 +329,16 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-02-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/\\\"20d057f6-601a-4f18-b0e8-3f0ee5e45925\\\"\",\r\n \"location\": + \ \"etag\": \"W/\\\"69fad78e-6ce7-4bc0-a4bd-68ae7eec2e27\\\"\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n - \ \"resourceGuid\": \"60b4570e-01a3-40b7-9fa7-2b3344179a86\",\r\n \"publicIPAddressVersion\": + \ \"resourceGuid\": \"505188d1-9560-40ec-bef9-0b7cda797462\",\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 \"tier\": \"Regional\"\r\n @@ -393,7 +347,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/cd5c05f3-6f98-4ccb-ab21-c57c9cdc4519?api-version=2021-02-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/0e0fdbb1-899c-4a61-8824-ea9e50ef5ae3?api-version=2021-02-01 cache-control: - no-cache content-length: @@ -401,7 +355,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:00:18 GMT + - Thu, 02 Sep 2021 04:01:13 GMT expires: - '-1' pragma: @@ -414,9 +368,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - b1b6fc94-d554-42f1-a700-dda6436d5f93 + - d4be61b7-f632-45ee-992f-1ab50dd0a84d x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1197' status: code: 201 message: Created @@ -430,10 +384,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/cd5c05f3-6f98-4ccb-ab21-c57c9cdc4519?api-version=2021-02-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/0e0fdbb1-899c-4a61-8824-ea9e50ef5ae3?api-version=2021-02-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -445,7 +399,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:00:19 GMT + - Thu, 02 Sep 2021 04:01:14 GMT expires: - '-1' pragma: @@ -462,7 +416,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - e5597df0-8f99-47b1-975a-2ab19252ed07 + - a3f73480-1035-4eda-9774-df16c487f067 status: code: 200 message: OK @@ -476,17 +430,17 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-02-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/\\\"174460b2-5df0-46b2-aea9-4816c472f81e\\\"\",\r\n \"location\": + \ \"etag\": \"W/\\\"27d76994-d85c-4e75-b96c-49f0e6c5b50f\\\"\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"resourceGuid\": \"60b4570e-01a3-40b7-9fa7-2b3344179a86\",\r\n \"ipAddress\": - \"52.170.70.120\",\r\n \"publicIPAddressVersion\": \"IPv4\",\r\n \"publicIPAllocationMethod\": + \ \"resourceGuid\": \"505188d1-9560-40ec-bef9-0b7cda797462\",\r\n \"ipAddress\": + \"52.170.197.77\",\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 \"tier\": \"Regional\"\r\n }\r\n}" @@ -498,9 +452,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:00:19 GMT + - Thu, 02 Sep 2021 04:01:14 GMT etag: - - W/"174460b2-5df0-46b2-aea9-4816c472f81e" + - W/"27d76994-d85c-4e75-b96c-49f0e6c5b50f" expires: - '-1' pragma: @@ -517,7 +471,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 76cfdc2d-49c1-4a9e-aa3e-6d0872254ea3 + - a3c7ac5d-24d0-447b-9d9c-0f51cd581404 status: code: 200 message: OK @@ -550,19 +504,19 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer?api-version=2021-02-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/\\\"45a033d3-29ac-4e53-8b02-06f70f38d723\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"c543e980-634e-470d-a377-d8e5965da2d3\\\"\",\r\n \"type\": \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"eastus\",\r\n \"properties\": - {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"7a4f9fba-b198-41db-bb73-c928b6778f19\",\r\n + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"3ac3d624-848d-4fef-a219-0457bcc08fd8\",\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/\\\"45a033d3-29ac-4e53-8b02-06f70f38d723\\\"\",\r\n + \ \"etag\": \"W/\\\"c543e980-634e-470d-a377-d8e5965da2d3\\\"\",\r\n \ \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": @@ -574,7 +528,7 @@ interactions: \ }\r\n ]\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/\\\"45a033d3-29ac-4e53-8b02-06f70f38d723\\\"\",\r\n + \ \"etag\": \"W/\\\"c543e980-634e-470d-a377-d8e5965da2d3\\\"\",\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\"\r\n @@ -583,7 +537,7 @@ interactions: \ }\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/\\\"45a033d3-29ac-4e53-8b02-06f70f38d723\\\"\",\r\n + \ \"etag\": \"W/\\\"c543e980-634e-470d-a377-d8e5965da2d3\\\"\",\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\"\r\n @@ -599,7 +553,7 @@ interactions: \"/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/\\\"45a033d3-29ac-4e53-8b02-06f70f38d723\\\"\",\r\n + \ \"etag\": \"W/\\\"c543e980-634e-470d-a377-d8e5965da2d3\\\"\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"protocol\": \"Http\",\r\n \"port\": 80,\r\n \"requestPath\": \"healthcheck.aspx\",\r\n \"intervalInSeconds\": 15,\r\n \"numberOfProbes\": @@ -608,7 +562,7 @@ interactions: \ }\r\n ]\r\n },\r\n \"type\": \"Microsoft.Network/loadBalancers/probes\"\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/\\\"45a033d3-29ac-4e53-8b02-06f70f38d723\\\"\",\r\n + \ \"etag\": \"W/\\\"c543e980-634e-470d-a377-d8e5965da2d3\\\"\",\r\n \ \"type\": \"Microsoft.Network/loadBalancers/outboundRules\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"allocatedOutboundPorts\": 1024,\r\n \"protocol\": \"All\",\r\n \"enableTcpReset\": @@ -623,7 +577,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/e6037aff-5ee7-4131-81bd-cb4767dff02c?api-version=2021-02-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/cdc10473-91f5-49e3-9d9f-76414488b61d?api-version=2021-02-01 cache-control: - no-cache content-length: @@ -631,7 +585,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:00:19 GMT + - Thu, 02 Sep 2021 04:01:15 GMT expires: - '-1' pragma: @@ -644,9 +598,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - ef84b960-c6d3-4ebd-9605-b9c841c36987 + - 7828d64e-81d2-469d-b112-e9cda54fbf12 x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1196' status: code: 201 message: Created @@ -660,10 +614,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/e6037aff-5ee7-4131-81bd-cb4767dff02c?api-version=2021-02-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/cdc10473-91f5-49e3-9d9f-76414488b61d?api-version=2021-02-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -675,7 +629,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:00:49 GMT + - Thu, 02 Sep 2021 04:01:44 GMT expires: - '-1' pragma: @@ -692,7 +646,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 9b984be6-995e-43d4-aaac-b771a809c972 + - 1392f302-7f8c-494e-9329-2e50630290c8 status: code: 200 message: OK @@ -706,19 +660,19 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/loadBalancers/myLoadBalancer?api-version=2021-02-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/\\\"45a033d3-29ac-4e53-8b02-06f70f38d723\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"c543e980-634e-470d-a377-d8e5965da2d3\\\"\",\r\n \"type\": \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"eastus\",\r\n \"properties\": - {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"7a4f9fba-b198-41db-bb73-c928b6778f19\",\r\n + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"3ac3d624-848d-4fef-a219-0457bcc08fd8\",\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/\\\"45a033d3-29ac-4e53-8b02-06f70f38d723\\\"\",\r\n + \ \"etag\": \"W/\\\"c543e980-634e-470d-a377-d8e5965da2d3\\\"\",\r\n \ \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": @@ -730,7 +684,7 @@ interactions: \ }\r\n ]\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/\\\"45a033d3-29ac-4e53-8b02-06f70f38d723\\\"\",\r\n + \ \"etag\": \"W/\\\"c543e980-634e-470d-a377-d8e5965da2d3\\\"\",\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\"\r\n @@ -739,7 +693,7 @@ interactions: \ }\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/\\\"45a033d3-29ac-4e53-8b02-06f70f38d723\\\"\",\r\n + \ \"etag\": \"W/\\\"c543e980-634e-470d-a377-d8e5965da2d3\\\"\",\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\"\r\n @@ -755,7 +709,7 @@ interactions: \"/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/\\\"45a033d3-29ac-4e53-8b02-06f70f38d723\\\"\",\r\n + \ \"etag\": \"W/\\\"c543e980-634e-470d-a377-d8e5965da2d3\\\"\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"protocol\": \"Http\",\r\n \"port\": 80,\r\n \"requestPath\": \"healthcheck.aspx\",\r\n \"intervalInSeconds\": 15,\r\n \"numberOfProbes\": @@ -764,7 +718,7 @@ interactions: \ }\r\n ]\r\n },\r\n \"type\": \"Microsoft.Network/loadBalancers/probes\"\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/\\\"45a033d3-29ac-4e53-8b02-06f70f38d723\\\"\",\r\n + \ \"etag\": \"W/\\\"c543e980-634e-470d-a377-d8e5965da2d3\\\"\",\r\n \ \"type\": \"Microsoft.Network/loadBalancers/outboundRules\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"allocatedOutboundPorts\": 1024,\r\n \"protocol\": \"All\",\r\n \"enableTcpReset\": @@ -783,9 +737,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:00:49 GMT + - Thu, 02 Sep 2021 04:01:44 GMT etag: - - W/"45a033d3-29ac-4e53-8b02-06f70f38d723" + - W/"c543e980-634e-470d-a377-d8e5965da2d3" expires: - '-1' pragma: @@ -802,7 +756,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 81239526-a32d-4587-9130-4bc1ea668666 + - 91319a8c-a37f-4f3a-8b96-411b80200d13 status: code: 200 message: OK @@ -833,10 +787,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachinescalesetd7d31356\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356\",\r\n @@ -859,14 +813,14 @@ interactions: \ \"extensionProfile\": {\r\n \"extensions\": []\r\n }\r\n \ },\r\n \"provisioningState\": \"Creating\",\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\": - \"7699a5e1-fb3e-41a7-a6ad-901df2fb879c\",\r\n \"automaticRepairsPolicy\": + \"1c4eb9d7-bc83-41d2-9568-97f8af4504e3\",\r\n \"automaticRepairsPolicy\": {\r\n \"enabled\": true,\r\n \"gracePeriod\": \"PT30M\"\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/34e42200-ae23-44d9-a119-95418d5a667d?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7198f1a3-6bd7-4d7b-bee1-9817da9bacac?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: @@ -874,7 +828,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:00:50 GMT + - Thu, 02 Sep 2021 04:01:48 GMT expires: - '-1' pragma: @@ -887,9 +841,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateVMScaleSet3Min;185,Microsoft.Compute/CreateVMScaleSet30Min;931,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3724,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/CreateVMScaleSet3Min;185,Microsoft.Compute/CreateVMScaleSet30Min;931,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3725,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1195' x-ms-request-charge: - '4' status: @@ -905,23 +859,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/34e42200-ae23-44d9-a119-95418d5a667d?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7198f1a3-6bd7-4d7b-bee1-9817da9bacac?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:00:50.7381238+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"34e42200-ae23-44d9-a119-95418d5a667d\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:01:46.420366+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"7198f1a3-6bd7-4d7b-bee1-9817da9bacac\"\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '133' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:01:00 GMT + - Thu, 02 Sep 2021 04:01:58 GMT expires: - '-1' pragma: @@ -938,7 +892,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29943 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29946 status: code: 200 message: OK @@ -952,24 +906,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/34e42200-ae23-44d9-a119-95418d5a667d?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7198f1a3-6bd7-4d7b-bee1-9817da9bacac?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:00:50.7381238+00:00\",\r\n \"endTime\": - \"2021-07-22T04:02:19.9261113+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"34e42200-ae23-44d9-a119-95418d5a667d\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:01:46.420366+00:00\",\r\n \"endTime\": + \"2021-09-02T04:03:32.3903244+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"7198f1a3-6bd7-4d7b-bee1-9817da9bacac\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:02:37 GMT + - Thu, 02 Sep 2021 04:03:34 GMT expires: - '-1' pragma: @@ -986,7 +940,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14997,Microsoft.Compute/GetOperation30Min;29941 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29944 status: code: 200 message: OK @@ -1000,10 +954,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachinescalesetd7d31356\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356\",\r\n @@ -1026,7 +980,7 @@ interactions: \ \"extensionProfile\": {\r\n \"extensions\": []\r\n }\r\n \ },\r\n \"provisioningState\": \"Succeeded\",\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\": - \"7699a5e1-fb3e-41a7-a6ad-901df2fb879c\",\r\n \"automaticRepairsPolicy\": + \"1c4eb9d7-bc83-41d2-9568-97f8af4504e3\",\r\n \"automaticRepairsPolicy\": {\r\n \"enabled\": true,\r\n \"gracePeriod\": \"PT30M\"\r\n }\r\n \ }\r\n}" headers: @@ -1037,7 +991,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:02:37 GMT + - Thu, 02 Sep 2021 04:03:34 GMT expires: - '-1' pragma: @@ -1072,26 +1026,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356/setOrchestrationServiceState?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356/setOrchestrationServiceState?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0101fb33-050d-425e-b918-11ebb2c258ad?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5692ff19-c4df-457f-a57d-45273ae13bef?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:02:37 GMT + - Thu, 02 Sep 2021 04:03:34 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0101fb33-050d-425e-b918-11ebb2c258ad?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5692ff19-c4df-457f-a57d-45273ae13bef?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1124,26 +1078,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356/reimage?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356/reimage?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0d9807df-2d83-4d34-ac16-e9757c2b9974?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:02:37 GMT + - Thu, 02 Sep 2021 04:03:35 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0d9807df-2d83-4d34-ac16-e9757c2b9974?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1154,7 +1108,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1198,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3722,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1198,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3723,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - '1196' x-ms-request-charge: @@ -1172,14 +1126,61 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5692ff19-c4df-457f-a57d-45273ae13bef?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + response: + body: + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.546574+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"5692ff19-c4df-457f-a57d-45273ae13bef\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '133' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 02 Sep 2021 04:04: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;14994,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/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0101fb33-050d-425e-b918-11ebb2c258ad?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:02:38.3793397+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"0101fb33-050d-425e-b918-11ebb2c258ad\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.6872142+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b\"\r\n}" headers: cache-control: - no-cache @@ -1188,7 +1189,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:03:08 GMT + - Thu, 02 Sep 2021 04:04:04 GMT expires: - '-1' pragma: @@ -1205,7 +1206,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29938 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29940 status: code: 200 message: OK @@ -1219,14 +1220,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0d9807df-2d83-4d34-ac16-e9757c2b9974?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5692ff19-c4df-457f-a57d-45273ae13bef?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:02:38.504338+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"0d9807df-2d83-4d34-ac16-e9757c2b9974\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.546574+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"5692ff19-c4df-457f-a57d-45273ae13bef\"\r\n}" headers: cache-control: - no-cache @@ -1235,7 +1236,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:03:08 GMT + - Thu, 02 Sep 2021 04:04:35 GMT expires: - '-1' pragma: @@ -1252,7 +1253,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29937 + - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29935 status: code: 200 message: OK @@ -1266,14 +1267,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0101fb33-050d-425e-b918-11ebb2c258ad?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:02:38.3793397+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"0101fb33-050d-425e-b918-11ebb2c258ad\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.6872142+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b\"\r\n}" headers: cache-control: - no-cache @@ -1282,7 +1283,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:03:38 GMT + - Thu, 02 Sep 2021 04:04:35 GMT expires: - '-1' pragma: @@ -1299,7 +1300,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29932 + - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29934 status: code: 200 message: OK @@ -1313,14 +1314,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0d9807df-2d83-4d34-ac16-e9757c2b9974?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5692ff19-c4df-457f-a57d-45273ae13bef?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:02:38.504338+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"0d9807df-2d83-4d34-ac16-e9757c2b9974\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.546574+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"5692ff19-c4df-457f-a57d-45273ae13bef\"\r\n}" headers: cache-control: - no-cache @@ -1329,7 +1330,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:03:38 GMT + - Thu, 02 Sep 2021 04:05:05 GMT expires: - '-1' pragma: @@ -1346,7 +1347,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29931 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29929 status: code: 200 message: OK @@ -1360,14 +1361,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0101fb33-050d-425e-b918-11ebb2c258ad?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:02:38.3793397+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"0101fb33-050d-425e-b918-11ebb2c258ad\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.6872142+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b\"\r\n}" headers: cache-control: - no-cache @@ -1376,7 +1377,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:04:08 GMT + - Thu, 02 Sep 2021 04:05:05 GMT expires: - '-1' pragma: @@ -1393,7 +1394,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29926 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29928 status: code: 200 message: OK @@ -1407,14 +1408,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0d9807df-2d83-4d34-ac16-e9757c2b9974?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5692ff19-c4df-457f-a57d-45273ae13bef?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:02:38.504338+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"0d9807df-2d83-4d34-ac16-e9757c2b9974\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.546574+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"5692ff19-c4df-457f-a57d-45273ae13bef\"\r\n}" headers: cache-control: - no-cache @@ -1423,7 +1424,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:04:08 GMT + - Thu, 02 Sep 2021 04:05:35 GMT expires: - '-1' pragma: @@ -1440,7 +1441,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29925 + - Microsoft.Compute/GetOperation3Min;14977,Microsoft.Compute/GetOperation30Min;29923 status: code: 200 message: OK @@ -1454,24 +1455,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0101fb33-050d-425e-b918-11ebb2c258ad?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:02:38.3793397+00:00\",\r\n \"endTime\": - \"2021-07-22T04:04:12.6923802+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"0101fb33-050d-425e-b918-11ebb2c258ad\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.6872142+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '134' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:04:38 GMT + - Thu, 02 Sep 2021 04:05:35 GMT expires: - '-1' pragma: @@ -1488,7 +1488,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14977,Microsoft.Compute/GetOperation30Min;29920 + - Microsoft.Compute/GetOperation3Min;14976,Microsoft.Compute/GetOperation30Min;29922 status: code: 200 message: OK @@ -1502,20 +1502,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0101fb33-050d-425e-b918-11ebb2c258ad?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5692ff19-c4df-457f-a57d-45273ae13bef?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: '' + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.546574+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"5692ff19-c4df-457f-a57d-45273ae13bef\"\r\n}" headers: cache-control: - no-cache content-length: - - '0' + - '133' + content-type: + - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:04:38 GMT + - Thu, 02 Sep 2021 04:06:05 GMT expires: - '-1' pragma: @@ -1525,10 +1528,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;14976,Microsoft.Compute/GetOperation30Min;29919 + - Microsoft.Compute/GetOperation3Min;14971,Microsoft.Compute/GetOperation30Min;29917 status: code: 200 message: OK @@ -1542,24 +1549,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0d9807df-2d83-4d34-ac16-e9757c2b9974?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:02:38.504338+00:00\",\r\n \"endTime\": - \"2021-07-22T04:04:12.6923802+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"0d9807df-2d83-4d34-ac16-e9757c2b9974\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.6872142+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '134' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:04:38 GMT + - Thu, 02 Sep 2021 04:06:05 GMT expires: - '-1' pragma: @@ -1576,7 +1582,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14975,Microsoft.Compute/GetOperation30Min;29918 + - Microsoft.Compute/GetOperation3Min;14970,Microsoft.Compute/GetOperation30Min;29916 status: code: 200 message: OK @@ -1590,20 +1596,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0d9807df-2d83-4d34-ac16-e9757c2b9974?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5692ff19-c4df-457f-a57d-45273ae13bef?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: '' + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.546574+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"5692ff19-c4df-457f-a57d-45273ae13bef\"\r\n}" headers: cache-control: - no-cache content-length: - - '0' + - '133' + content-type: + - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:04:38 GMT + - Thu, 02 Sep 2021 04:06:35 GMT expires: - '-1' pragma: @@ -1613,10 +1622,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;14974,Microsoft.Compute/GetOperation30Min;29917 + - Microsoft.Compute/GetOperation3Min;14969,Microsoft.Compute/GetOperation30Min;29911 status: code: 200 message: OK @@ -1629,31 +1642,26 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '0' - Content-Type: - - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356/reimageall?api-version=2021-04-01 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: '' + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.6872142+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b\"\r\n}" headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/027446bf-f894-49ef-9861-53ee43bc40a5?api-version=2021-04-01 cache-control: - no-cache content-length: - - '0' + - '134' + content-type: + - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:04:38 GMT + - Thu, 02 Sep 2021 04:06:35 GMT expires: - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/027446bf-f894-49ef-9861-53ee43bc40a5?monitor=true&api-version=2021-04-01 pragma: - no-cache server: @@ -1661,17 +1669,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;236,Microsoft.Compute/VMScaleSetActions30Min;1196,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3720,Microsoft.Compute/VmssQueuedVMOperations;0 - x-ms-ratelimit-remaining-subscription-writes: - - '1195' - x-ms-request-charge: - - '2' + - Microsoft.Compute/GetOperation3Min;14968,Microsoft.Compute/GetOperation30Min;29910 status: - code: 202 - message: Accepted + code: 200 + message: OK - request: body: null headers: @@ -1682,23 +1690,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/027446bf-f894-49ef-9861-53ee43bc40a5?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5692ff19-c4df-457f-a57d-45273ae13bef?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:04:39.0518693+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"027446bf-f894-49ef-9861-53ee43bc40a5\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.546574+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"5692ff19-c4df-457f-a57d-45273ae13bef\"\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '133' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:05:08 GMT + - Thu, 02 Sep 2021 04:07:06 GMT expires: - '-1' pragma: @@ -1715,7 +1723,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14973,Microsoft.Compute/GetOperation30Min;29915 + - Microsoft.Compute/GetOperation3Min;14969,Microsoft.Compute/GetOperation30Min;29905 status: code: 200 message: OK @@ -1729,14 +1737,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/027446bf-f894-49ef-9861-53ee43bc40a5?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:04:39.0518693+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"027446bf-f894-49ef-9861-53ee43bc40a5\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.6872142+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b\"\r\n}" headers: cache-control: - no-cache @@ -1745,7 +1753,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:05:39 GMT + - Thu, 02 Sep 2021 04:07:06 GMT expires: - '-1' pragma: @@ -1762,7 +1770,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14973,Microsoft.Compute/GetOperation30Min;29912 + - Microsoft.Compute/GetOperation3Min;14968,Microsoft.Compute/GetOperation30Min;29904 status: code: 200 message: OK @@ -1776,24 +1784,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/027446bf-f894-49ef-9861-53ee43bc40a5?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5692ff19-c4df-457f-a57d-45273ae13bef?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:04:39.0518693+00:00\",\r\n \"endTime\": - \"2021-07-22T04:06:08.2242221+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"027446bf-f894-49ef-9861-53ee43bc40a5\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.546574+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"5692ff19-c4df-457f-a57d-45273ae13bef\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '133' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:06:08 GMT + - Thu, 02 Sep 2021 04:07:35 GMT expires: - '-1' pragma: @@ -1810,7 +1817,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14976,Microsoft.Compute/GetOperation30Min;29909 + - Microsoft.Compute/GetOperation3Min;14969,Microsoft.Compute/GetOperation30Min;29899 status: code: 200 message: OK @@ -1824,20 +1831,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/027446bf-f894-49ef-9861-53ee43bc40a5?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: '' + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.6872142+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b\"\r\n}" headers: cache-control: - no-cache content-length: - - '0' + - '134' + content-type: + - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:06:08 GMT + - Thu, 02 Sep 2021 04:07:36 GMT expires: - '-1' pragma: @@ -1847,10 +1857,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;14975,Microsoft.Compute/GetOperation30Min;29908 + - Microsoft.Compute/GetOperation3Min;14968,Microsoft.Compute/GetOperation30Min;29898 status: code: 200 message: OK @@ -1863,31 +1877,26 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356?api-version=2021-04-01 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5692ff19-c4df-457f-a57d-45273ae13bef?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: '' + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.546574+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"5692ff19-c4df-457f-a57d-45273ae13bef\"\r\n}" headers: - azure-asyncnotification: - - Enabled - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/896e7f05-f124-4e1b-8144-3a7eb9804feb?api-version=2021-04-01 cache-control: - no-cache content-length: - - '0' + - '133' + content-type: + - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:06:09 GMT + - Thu, 02 Sep 2021 04:08:05 GMT expires: - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/896e7f05-f124-4e1b-8144-3a7eb9804feb?monitor=true&api-version=2021-04-01 pragma: - no-cache server: @@ -1895,17 +1904,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/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;399,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3722,Microsoft.Compute/VmssQueuedVMOperations;0 - x-ms-ratelimit-remaining-subscription-deletes: - - '14996' - x-ms-request-charge: - - '2' + - Microsoft.Compute/GetOperation3Min;14969,Microsoft.Compute/GetOperation30Min;29893 status: - code: 202 - message: Accepted + code: 200 + message: OK - request: body: null headers: @@ -1916,14 +1925,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/896e7f05-f124-4e1b-8144-3a7eb9804feb?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:06:09.4586253+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"896e7f05-f124-4e1b-8144-3a7eb9804feb\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.6872142+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b\"\r\n}" headers: cache-control: - no-cache @@ -1932,7 +1941,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:06:19 GMT + - Thu, 02 Sep 2021 04:08:05 GMT expires: - '-1' pragma: @@ -1949,7 +1958,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14973,Microsoft.Compute/GetOperation30Min;29906 + - Microsoft.Compute/GetOperation3Min;14968,Microsoft.Compute/GetOperation30Min;29892 status: code: 200 message: OK @@ -1963,23 +1972,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/896e7f05-f124-4e1b-8144-3a7eb9804feb?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5692ff19-c4df-457f-a57d-45273ae13bef?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:06:09.4586253+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"896e7f05-f124-4e1b-8144-3a7eb9804feb\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.546574+00:00\",\r\n \"endTime\": + \"2021-09-02T04:08:08.1424063+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"5692ff19-c4df-457f-a57d-45273ae13bef\"\r\n}" headers: cache-control: - no-cache content-length: - - '134' + - '183' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:06:30 GMT + - Thu, 02 Sep 2021 04:08:35 GMT expires: - '-1' pragma: @@ -1996,7 +2006,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14978,Microsoft.Compute/GetOperation30Min;29905 + - Microsoft.Compute/GetOperation3Min;14971,Microsoft.Compute/GetOperation30Min;29889 status: code: 200 message: OK @@ -2010,24 +2020,626 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/896e7f05-f124-4e1b-8144-3a7eb9804feb?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5692ff19-c4df-457f-a57d-45273ae13bef?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:06:09.4586253+00:00\",\r\n \"endTime\": - \"2021-07-22T04:06:56.911989+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"896e7f05-f124-4e1b-8144-3a7eb9804feb\"\r\n}" + string: '' headers: cache-control: - no-cache content-length: - - '183' + - '0' + date: + - Thu, 02 Sep 2021 04:08:35 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;14970,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/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + response: + body: + string: "{\r\n \"startTime\": \"2021-09-02T04:03:35.6872142+00:00\",\r\n \"endTime\": + \"2021-09-02T04:08:08.1424063+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '184' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 02 Sep 2021 04:08: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-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14969,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/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/707c2805-3a4a-4bec-91eb-8c6c1f1d5c4b?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 02 Sep 2021 04:08:35 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;14968,Microsoft.Compute/GetOperation30Min;29886 + 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/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356/reimageall?api-version=2021-07-01 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1bee8dda-12dc-4272-953b-8f81314d470e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 02 Sep 2021 04:08:36 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1bee8dda-12dc-4272-953b-8f81314d470e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-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;1193,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3727,Microsoft.Compute/VmssQueuedVMOperations;0 + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + 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/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1bee8dda-12dc-4272-953b-8f81314d470e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + response: + body: + string: "{\r\n \"startTime\": \"2021-09-02T04:08:36.5957563+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"1bee8dda-12dc-4272-953b-8f81314d470e\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 02 Sep 2021 04:09:06 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;14972,Microsoft.Compute/GetOperation30Min;29884 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1bee8dda-12dc-4272-953b-8f81314d470e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + response: + body: + string: "{\r\n \"startTime\": \"2021-09-02T04:08:36.5957563+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"1bee8dda-12dc-4272-953b-8f81314d470e\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 02 Sep 2021 04:09: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-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14975,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/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1bee8dda-12dc-4272-953b-8f81314d470e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + response: + body: + string: "{\r\n \"startTime\": \"2021-09-02T04:08:36.5957563+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"1bee8dda-12dc-4272-953b-8f81314d470e\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 02 Sep 2021 04:10:06 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;29878 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1bee8dda-12dc-4272-953b-8f81314d470e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + response: + body: + string: "{\r\n \"startTime\": \"2021-09-02T04:08:36.5957563+00:00\",\r\n \"endTime\": + \"2021-09-02T04:10:23.3934632+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"1bee8dda-12dc-4272-953b-8f81314d470e\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '184' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 02 Sep 2021 04:10:36 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;29875 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1bee8dda-12dc-4272-953b-8f81314d470e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 02 Sep 2021 04:10:36 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;29874 + 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/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetd7d31356?api-version=2021-07-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/16316a9f-d2eb-41b7-8221-5d9e22aba2ee?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 02 Sep 2021 04:10:36 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/16316a9f-d2eb-41b7-8221-5d9e22aba2ee?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-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;3725,Microsoft.Compute/VmssQueuedVMOperations;0 + x-ms-ratelimit-remaining-subscription-deletes: + - '14997' + 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/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/16316a9f-d2eb-41b7-8221-5d9e22aba2ee?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + response: + body: + string: "{\r\n \"startTime\": \"2021-09-02T04:10:37.1435503+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"16316a9f-d2eb-41b7-8221-5d9e22aba2ee\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 02 Sep 2021 04:10: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;14979,Microsoft.Compute/GetOperation30Min;29873 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/16316a9f-d2eb-41b7-8221-5d9e22aba2ee?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + response: + body: + string: "{\r\n \"startTime\": \"2021-09-02T04:10:37.1435503+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"16316a9f-d2eb-41b7-8221-5d9e22aba2ee\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 02 Sep 2021 04:10:58 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;29872 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/16316a9f-d2eb-41b7-8221-5d9e22aba2ee?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + response: + body: + string: "{\r\n \"startTime\": \"2021-09-02T04:10:37.1435503+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"16316a9f-d2eb-41b7-8221-5d9e22aba2ee\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 02 Sep 2021 04:11:28 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;29871 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/16316a9f-d2eb-41b7-8221-5d9e22aba2ee?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + response: + body: + string: "{\r\n \"startTime\": \"2021-09-02T04:10:37.1435503+00:00\",\r\n \"endTime\": + \"2021-09-02T04:11:34.3627744+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"16316a9f-d2eb-41b7-8221-5d9e22aba2ee\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '184' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:06:59 GMT + - Thu, 02 Sep 2021 04:11:58 GMT expires: - '-1' pragma: @@ -2044,7 +2656,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29903 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29869 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 708232e54e9c..f677915f9a7f 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 @@ -14,17 +14,17 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907?api-version=2021-02-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/\\\"591412c8-b23b-4038-ac3b-c98abdc08a81\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"32386bbe-70c6-4fee-b347-f348664355ca\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": - \"81bbeb0c-e78c-4996-8d17-a1806a4eb73d\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + \"25bab451-b857-489f-a333-73daa262060c\",\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 \ }\r\n}" @@ -32,7 +32,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/19276b3d-ed96-49dc-8ea4-37a45a9999f1?api-version=2021-02-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/c7c52a4d-18b1-4ece-aadc-86ed38e8f593?api-version=2021-02-01 cache-control: - no-cache content-length: @@ -40,7 +40,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:07:02 GMT + - Thu, 02 Sep 2021 04:12:03 GMT expires: - '-1' pragma: @@ -53,9 +53,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - a0dd4af4-e05a-41b0-862a-44bb9bf0febc + - f1a3c730-87e5-4b25-a6f6-ba84377409d9 x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1190' status: code: 201 message: Created @@ -69,10 +69,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/19276b3d-ed96-49dc-8ea4-37a45a9999f1?api-version=2021-02-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/c7c52a4d-18b1-4ece-aadc-86ed38e8f593?api-version=2021-02-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -84,7 +84,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:07:05 GMT + - Thu, 02 Sep 2021 04:12:06 GMT expires: - '-1' pragma: @@ -101,7 +101,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 5b81862d-a46d-4a34-a429-77d30a27871d + - e3b2f773-1002-4da8-9253-92ee68c56a5d status: code: 200 message: OK @@ -115,17 +115,17 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907?api-version=2021-02-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/\\\"ea9bf0e8-e4d0-4859-ba05-8eccaf5e8da0\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"c5c0cb07-2475-4396-9c34-f2df68764f1a\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": - \"81bbeb0c-e78c-4996-8d17-a1806a4eb73d\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + \"25bab451-b857-489f-a333-73daa262060c\",\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 \ }\r\n}" @@ -137,9 +137,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:07:05 GMT + - Thu, 02 Sep 2021 04:12:06 GMT etag: - - W/"ea9bf0e8-e4d0-4859-ba05-8eccaf5e8da0" + - W/"c5c0cb07-2475-4396-9c34-f2df68764f1a" expires: - '-1' pragma: @@ -156,7 +156,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 0f97c3e0-8640-4010-91cf-5998108cf315 + - 54f20442-229b-463c-9c01-516ac7e743e2 status: code: 200 message: OK @@ -174,21 +174,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907/subnets/subnetnamexfe411907?api-version=2021-02-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/\\\"7132d1b9-c64c-4a94-b3cc-c1750265e504\\\"\",\r\n \"properties\": + \ \"etag\": \"W/\\\"cfe5072e-917e-46fd-8579-0de2f0562a1a\\\"\",\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/f155207b-6ac0-4663-8cc9-aebd17485017?api-version=2021-02-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/4d71d3ea-b255-43fd-8f06-bee2509f7ec7?api-version=2021-02-01 cache-control: - no-cache content-length: @@ -196,7 +196,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:07:05 GMT + - Thu, 02 Sep 2021 04:12:07 GMT expires: - '-1' pragma: @@ -209,9 +209,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - b8c0ac34-864b-4c54-ad98-b7d38ad5dce2 + - 312133f0-c00e-4b31-a972-ecb418be089f x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1189' status: code: 201 message: Created @@ -225,10 +225,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/f155207b-6ac0-4663-8cc9-aebd17485017?api-version=2021-02-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/4d71d3ea-b255-43fd-8f06-bee2509f7ec7?api-version=2021-02-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -240,7 +240,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:07:09 GMT + - Thu, 02 Sep 2021 04:12:10 GMT expires: - '-1' pragma: @@ -257,7 +257,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 48fc03fd-3673-41bc-9d65-66beeca0964e + - 0bfdd306-8af1-4af3-a9ea-ec4646e3d3e1 status: code: 200 message: OK @@ -271,14 +271,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexfe411907/subnets/subnetnamexfe411907?api-version=2021-02-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/\\\"45248c61-3752-4013-87a2-50ead222e65a\\\"\",\r\n \"properties\": + \ \"etag\": \"W/\\\"6786da2f-25ac-40a7-bd74-d75a319b6e33\\\"\",\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\n },\r\n \"type\": @@ -291,9 +291,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:07:09 GMT + - Thu, 02 Sep 2021 04:12:10 GMT etag: - - W/"45248c61-3752-4013-87a2-50ead222e65a" + - W/"6786da2f-25ac-40a7-bd74-d75a319b6e33" expires: - '-1' pragma: @@ -310,7 +310,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 284cc39d-91c5-4d82-875c-7828c05a4ebe + - 734ac235-c7fe-4915-a632-776d4ad01969 status: code: 200 message: OK @@ -338,10 +338,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachinescalesetfe411907\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907\",\r\n @@ -363,12 +363,12 @@ interactions: \"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/networknamexfe411907/subnets/subnetnamexfe411907\"},\"privateIPAddressVersion\":\"IPv4\"}}]}}]}\r\n \ },\r\n \"provisioningState\": \"Creating\",\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\": - \"d1e30b1a-9950-4abe-91cf-7be59b965f59\"\r\n }\r\n}" + \"6f2381d0-a3f6-4d07-9481-0916dec213e2\"\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/6a56cb64-dd4a-4aed-af30-60f32adb37ec?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/addd5b19-0b97-4057-9962-96e90e533853?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: @@ -376,7 +376,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:07:10 GMT + - Thu, 02 Sep 2021 04:12:12 GMT expires: - '-1' pragma: @@ -389,9 +389,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateVMScaleSet3Min;185,Microsoft.Compute/CreateVMScaleSet30Min;930,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3722,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/CreateVMScaleSet3Min;185,Microsoft.Compute/CreateVMScaleSet30Min;930,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3723,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - - '1192' + - '1197' x-ms-request-charge: - '2' status: @@ -407,14 +407,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6a56cb64-dd4a-4aed-af30-60f32adb37ec?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/addd5b19-0b97-4057-9962-96e90e533853?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:07:10.2870636+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"6a56cb64-dd4a-4aed-af30-60f32adb37ec\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:12:11.6287125+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"addd5b19-0b97-4057-9962-96e90e533853\"\r\n}" headers: cache-control: - no-cache @@ -423,7 +423,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:07:20 GMT + - Thu, 02 Sep 2021 04:12:22 GMT expires: - '-1' pragma: @@ -440,7 +440,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29902 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29868 status: code: 200 message: OK @@ -454,15 +454,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6a56cb64-dd4a-4aed-af30-60f32adb37ec?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/addd5b19-0b97-4057-9962-96e90e533853?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:07:10.2870636+00:00\",\r\n \"endTime\": - \"2021-07-22T04:08:39.0532107+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"6a56cb64-dd4a-4aed-af30-60f32adb37ec\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:12:11.6287125+00:00\",\r\n \"endTime\": + \"2021-09-02T04:13:40.3637995+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"addd5b19-0b97-4057-9962-96e90e533853\"\r\n}" headers: cache-control: - no-cache @@ -471,7 +471,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:08:56 GMT + - Thu, 02 Sep 2021 04:13:59 GMT expires: - '-1' pragma: @@ -488,7 +488,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29900 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29866 status: code: 200 message: OK @@ -502,10 +502,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachinescalesetfe411907\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907\",\r\n @@ -527,7 +527,7 @@ interactions: \"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/networknamexfe411907/subnets/subnetnamexfe411907\"},\"privateIPAddressVersion\":\"IPv4\"}}]}}]}\r\n \ },\r\n \"provisioningState\": \"Succeeded\",\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\": - \"d1e30b1a-9950-4abe-91cf-7be59b965f59\"\r\n }\r\n}" + \"6f2381d0-a3f6-4d07-9481-0916dec213e2\"\r\n }\r\n}" headers: cache-control: - no-cache @@ -536,7 +536,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:08:56 GMT + - Thu, 02 Sep 2021 04:13:59 GMT expires: - '-1' pragma: @@ -553,7 +553,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSet3Min;396,Microsoft.Compute/GetVMScaleSet30Min;2591 + - Microsoft.Compute/GetVMScaleSet3Min;396,Microsoft.Compute/GetVMScaleSet30Min;2593 status: code: 200 message: OK @@ -567,10 +567,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907/virtualmachines/0/instanceView?api-version=2021-07-01 response: body: string: "{\r\n \"error\": {\r\n \"code\": \"NotFound\",\r\n \"message\": @@ -583,7 +583,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:11:57 GMT + - Thu, 02 Sep 2021 04:17:00 GMT expires: - '-1' pragma: @@ -612,13 +612,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907/virtualmachines/1/instanceView?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907/virtualmachines/1/instanceView?api-version=2021-07-01 response: body: - string: "{\r\n \"placementGroupId\": \"eac7daf8-3ee8-4ab6-a1ae-31b11fa2fddc\",\r\n + string: "{\r\n \"placementGroupId\": \"38005476-ed00-47e7-af09-31952882452e\",\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\": @@ -626,26 +626,26 @@ interactions: \ {\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\": - \"2021-07-22T04:11:40+00:00\"\r\n }\r\n ]\r\n },\r\n \"disks\": - [\r\n {\r\n \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_a9738578c17241308e83664a868e2276\",\r\n + \"2021-09-02T04:16:51+00:00\"\r\n }\r\n ]\r\n },\r\n \"disks\": + [\r\n {\r\n \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_7f7865e6c778436e90b6e382dda83932\",\r\n \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning - succeeded\",\r\n \"time\": \"2021-07-22T04:07:17.2089672+00:00\"\r\n + succeeded\",\r\n \"time\": \"2021-09-02T04:12:16.691229+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\": \"2021-07-22T04:08:38.9906944+00:00\"\r\n },\r\n {\r\n + \ \"time\": \"2021-09-02T04:13:40.3168583+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: - - '1318' + - '1317' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:11:57 GMT + - Thu, 02 Sep 2021 04:17:00 GMT expires: - '-1' pragma: @@ -682,10 +682,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907/performMaintenance?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907/performMaintenance?api-version=2021-07-01 response: body: string: "{\r\n \"error\": {\r\n \"code\": \"OperationNotAllowed\",\r\n \"message\": @@ -699,7 +699,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:11:57 GMT + - Thu, 02 Sep 2021 04:17:00 GMT expires: - '-1' pragma: @@ -712,7 +712,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1192 + - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1189 x-ms-ratelimit-remaining-subscription-writes: - '1190' status: @@ -730,10 +730,10 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907/virtualmachines/1/performMaintenance?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907/virtualmachines/1/performMaintenance?api-version=2021-07-01 response: body: string: "{\r\n \"error\": {\r\n \"code\": \"OperationNotAllowed\",\r\n \"message\": @@ -747,7 +747,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:11:57 GMT + - Thu, 02 Sep 2021 04:17:00 GMT expires: - '-1' pragma: @@ -760,7 +760,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1191 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1188 x-ms-ratelimit-remaining-subscription-writes: - '1189' status: @@ -778,10 +778,10 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetfe411907?api-version=2021-07-01 response: body: string: '' @@ -789,17 +789,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cd6e8a6b-6ecc-4979-9b79-d2a874c2e8f6?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/994552d5-b2c2-4d2c-b228-f9a5a82ee815?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:11:57 GMT + - Thu, 02 Sep 2021 04:17:00 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cd6e8a6b-6ecc-4979-9b79-d2a874c2e8f6?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/994552d5-b2c2-4d2c-b228-f9a5a82ee815?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -810,9 +810,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;398,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3725,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;398,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3728,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-deletes: - - '14992' + - '14991' x-ms-request-charge: - '1' status: @@ -828,14 +828,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cd6e8a6b-6ecc-4979-9b79-d2a874c2e8f6?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/994552d5-b2c2-4d2c-b228-f9a5a82ee815?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:11:58.2573948+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"cd6e8a6b-6ecc-4979-9b79-d2a874c2e8f6\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:17:01.3183771+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"994552d5-b2c2-4d2c-b228-f9a5a82ee815\"\r\n}" headers: cache-control: - no-cache @@ -844,7 +844,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:12:07 GMT + - Thu, 02 Sep 2021 04:17:10 GMT expires: - '-1' pragma: @@ -861,7 +861,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29899 + - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29866 status: code: 200 message: OK @@ -875,14 +875,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cd6e8a6b-6ecc-4979-9b79-d2a874c2e8f6?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/994552d5-b2c2-4d2c-b228-f9a5a82ee815?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:11:58.2573948+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"cd6e8a6b-6ecc-4979-9b79-d2a874c2e8f6\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:17:01.3183771+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"994552d5-b2c2-4d2c-b228-f9a5a82ee815\"\r\n}" headers: cache-control: - no-cache @@ -891,7 +891,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:12:18 GMT + - Thu, 02 Sep 2021 04:17:21 GMT expires: - '-1' pragma: @@ -908,7 +908,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29898 + - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29865 status: code: 200 message: OK @@ -922,15 +922,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/cd6e8a6b-6ecc-4979-9b79-d2a874c2e8f6?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/994552d5-b2c2-4d2c-b228-f9a5a82ee815?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:11:58.2573948+00:00\",\r\n \"endTime\": - \"2021-07-22T04:12:43.3356499+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"cd6e8a6b-6ecc-4979-9b79-d2a874c2e8f6\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:17:01.3183771+00:00\",\r\n \"endTime\": + \"2021-09-02T04:17:51.3187723+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"994552d5-b2c2-4d2c-b228-f9a5a82ee815\"\r\n}" headers: cache-control: - no-cache @@ -939,7 +939,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:12:48 GMT + - Thu, 02 Sep 2021 04:17:51 GMT expires: - '-1' pragma: @@ -956,7 +956,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29896 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29863 status: code: 200 message: OK 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 6656923af792..252daf7649d9 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 @@ -14,17 +14,17 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d?api-version=2021-02-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/\\\"2ffcf851-d811-4551-9e2a-4ccbcfef6196\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"254038ad-ab43-4219-a81b-92f85dfbf41c\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": - \"564b77b8-dd65-4054-9881-7126f268f840\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + \"12e6562e-9226-40c7-b588-96f0bc0a6b33\",\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 \ }\r\n}" @@ -32,7 +32,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/5fb0ee37-6a94-4e23-909b-9831271d79bb?api-version=2021-02-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/3756dfe7-cda4-40d9-9283-12f99038a667?api-version=2021-02-01 cache-control: - no-cache content-length: @@ -40,7 +40,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:12:50 GMT + - Thu, 02 Sep 2021 04:17:54 GMT expires: - '-1' pragma: @@ -53,9 +53,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 88e7a447-28dc-4c55-be87-4dfb736e1015 + - 020d7580-b440-4636-9c6c-f24cbf450d2c x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1188' status: code: 201 message: Created @@ -69,10 +69,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/5fb0ee37-6a94-4e23-909b-9831271d79bb?api-version=2021-02-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/3756dfe7-cda4-40d9-9283-12f99038a667?api-version=2021-02-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -84,7 +84,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:12:53 GMT + - Thu, 02 Sep 2021 04:17:57 GMT expires: - '-1' pragma: @@ -101,7 +101,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 80b70333-3e2d-49dc-a6b2-a1a7b16ba0cb + - bb68a01e-5221-4753-9e3b-262208f35294 status: code: 200 message: OK @@ -115,17 +115,17 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d?api-version=2021-02-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/\\\"cda6eff3-243f-47aa-a5ec-f6f47635c677\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"d7f60b9b-d70d-4886-8741-d2594343b438\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": - \"564b77b8-dd65-4054-9881-7126f268f840\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + \"12e6562e-9226-40c7-b588-96f0bc0a6b33\",\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 \ }\r\n}" @@ -137,9 +137,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:12:53 GMT + - Thu, 02 Sep 2021 04:17:57 GMT etag: - - W/"cda6eff3-243f-47aa-a5ec-f6f47635c677" + - W/"d7f60b9b-d70d-4886-8741-d2594343b438" expires: - '-1' pragma: @@ -156,7 +156,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 145ed85b-2a01-4313-82cf-9cb17216b3cb + - 571f01f9-c158-4bfc-b316-32e21caab911 status: code: 200 message: OK @@ -174,21 +174,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d/subnets/subnetnamex8c68120d?api-version=2021-02-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/\\\"d3ad2e9c-e504-4432-a223-6cc42152d8a7\\\"\",\r\n \"properties\": + \ \"etag\": \"W/\\\"dfb9dbb3-f85c-4993-b191-f024fda43b8b\\\"\",\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/47354484-7bf6-4cd9-ac50-8e06a8ba3075?api-version=2021-02-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/55a8b2cb-7c76-4437-9d71-27fed6cfeac1?api-version=2021-02-01 cache-control: - no-cache content-length: @@ -196,7 +196,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:12:53 GMT + - Thu, 02 Sep 2021 04:17:57 GMT expires: - '-1' pragma: @@ -209,9 +209,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 926569d9-18c4-41cc-bc0d-d066fa25c23b + - 50b50a9e-12ff-4d6e-abf9-35cf5ff9fc75 x-ms-ratelimit-remaining-subscription-writes: - - '1192' + - '1187' status: code: 201 message: Created @@ -225,10 +225,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/47354484-7bf6-4cd9-ac50-8e06a8ba3075?api-version=2021-02-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/55a8b2cb-7c76-4437-9d71-27fed6cfeac1?api-version=2021-02-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -240,7 +240,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:12:57 GMT + - Thu, 02 Sep 2021 04:18:00 GMT expires: - '-1' pragma: @@ -257,7 +257,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 964740e4-d6af-4ef9-b7f9-66ea3129a0fb + - dcdb8521-2014-4097-940f-9cbec556f75c status: code: 200 message: OK @@ -271,14 +271,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamex8c68120d/subnets/subnetnamex8c68120d?api-version=2021-02-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/\\\"67668621-fb4b-4731-bbd5-c28c18ffb0fc\\\"\",\r\n \"properties\": + \ \"etag\": \"W/\\\"6b08a197-5a32-4dc9-8857-2e3a2ecff696\\\"\",\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\n },\r\n \"type\": @@ -291,9 +291,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:12:57 GMT + - Thu, 02 Sep 2021 04:18:00 GMT etag: - - W/"67668621-fb4b-4731-bbd5-c28c18ffb0fc" + - W/"6b08a197-5a32-4dc9-8857-2e3a2ecff696" expires: - '-1' pragma: @@ -310,7 +310,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 2cdb0cbf-6de6-42d9-9f73-6c1ad5fca948 + - 2022e9a8-118f-4d60-8cdd-487360cb852d status: code: 200 message: OK @@ -338,10 +338,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachinescaleset8c68120d\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d\",\r\n @@ -363,12 +363,12 @@ interactions: \"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/networknamex8c68120d/subnets/subnetnamex8c68120d\"},\"privateIPAddressVersion\":\"IPv4\"}}]}}]}\r\n \ },\r\n \"provisioningState\": \"Creating\",\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\": - \"867dad3b-c465-4506-b437-463def1275b7\"\r\n }\r\n}" + \"e6167767-ffdd-47ba-bc91-df084faec608\"\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/4ba10ce8-4db2-4111-bf1c-1a90a1bf2194?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b313e56b-016d-4b98-b7c6-e167beedb138?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: @@ -376,7 +376,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:12:58 GMT + - Thu, 02 Sep 2021 04:18:03 GMT expires: - '-1' pragma: @@ -389,9 +389,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateVMScaleSet3Min;185,Microsoft.Compute/CreateVMScaleSet30Min;929,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3725,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/CreateVMScaleSet3Min;185,Microsoft.Compute/CreateVMScaleSet30Min;929,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3726,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - - '1191' + - '1196' x-ms-request-charge: - '2' status: @@ -407,14 +407,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4ba10ce8-4db2-4111-bf1c-1a90a1bf2194?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b313e56b-016d-4b98-b7c6-e167beedb138?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:12:58.1012516+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"4ba10ce8-4db2-4111-bf1c-1a90a1bf2194\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:18:01.7251077+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"b313e56b-016d-4b98-b7c6-e167beedb138\"\r\n}" headers: cache-control: - no-cache @@ -423,7 +423,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:13:08 GMT + - Thu, 02 Sep 2021 04:18:12 GMT expires: - '-1' pragma: @@ -440,7 +440,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29895 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29862 status: code: 200 message: OK @@ -454,15 +454,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4ba10ce8-4db2-4111-bf1c-1a90a1bf2194?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b313e56b-016d-4b98-b7c6-e167beedb138?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:12:58.1012516+00:00\",\r\n \"endTime\": - \"2021-07-22T04:14:28.0858025+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"4ba10ce8-4db2-4111-bf1c-1a90a1bf2194\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:18:01.7251077+00:00\",\r\n \"endTime\": + \"2021-09-02T04:19:50.1019932+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"b313e56b-016d-4b98-b7c6-e167beedb138\"\r\n}" headers: cache-control: - no-cache @@ -471,7 +471,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:14:44 GMT + - Thu, 02 Sep 2021 04:19:50 GMT expires: - '-1' pragma: @@ -488,7 +488,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29893 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29861 status: code: 200 message: OK @@ -502,10 +502,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachinescaleset8c68120d\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d\",\r\n @@ -527,7 +527,7 @@ interactions: \"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/networknamex8c68120d/subnets/subnetnamex8c68120d\"},\"privateIPAddressVersion\":\"IPv4\"}}]}}]}\r\n \ },\r\n \"provisioningState\": \"Succeeded\",\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\": - \"867dad3b-c465-4506-b437-463def1275b7\"\r\n }\r\n}" + \"e6167767-ffdd-47ba-bc91-df084faec608\"\r\n }\r\n}" headers: cache-control: - no-cache @@ -536,7 +536,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:14:44 GMT + - Thu, 02 Sep 2021 04:19:50 GMT expires: - '-1' pragma: @@ -553,7 +553,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSet3Min;396,Microsoft.Compute/GetVMScaleSet30Min;2586 + - Microsoft.Compute/GetVMScaleSet3Min;397,Microsoft.Compute/GetVMScaleSet30Min;2589 status: code: 200 message: OK @@ -567,13 +567,13 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0/instanceView?api-version=2021-07-01 response: body: - string: "{\r\n \"placementGroupId\": \"8657a2e3-c76c-48d7-8c43-12f32caccdd4\",\r\n + string: "{\r\n \"placementGroupId\": \"35b46b0d-7127-4f6a-8e62-125c4dd517bd\",\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\": @@ -581,15 +581,15 @@ interactions: \ {\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\": - \"2021-07-22T04:17:25+00:00\"\r\n }\r\n ]\r\n },\r\n \"disks\": - [\r\n {\r\n \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_828953c6ac444c8594b0b24f572ebe0f\",\r\n + \"2021-09-02T04:22:37+00:00\"\r\n }\r\n ]\r\n },\r\n \"disks\": + [\r\n {\r\n \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_78f0d7d835f740a79c068d3a92c0b7cc\",\r\n \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning - succeeded\",\r\n \"time\": \"2021-07-22T04:14:28.5858023+00:00\"\r\n + succeeded\",\r\n \"time\": \"2021-09-02T04:19:50.6332441+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\": \"2021-07-22T04:15:27.8361234+00:00\"\r\n },\r\n {\r\n + \ \"time\": \"2021-09-02T04:20:27.7739531+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: @@ -600,7 +600,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:17:45 GMT + - Thu, 02 Sep 2021 04:22:50 GMT expires: - '-1' pragma: @@ -633,10 +633,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachinescaleset8c68120d_0\",\r\n \"id\": @@ -646,15 +646,15 @@ interactions: \ \"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\": \"c9b6d68c-76c1-452e-88ec-5a38e5f38ac0\",\r\n \"hardwareProfile\": + \ \"vmId\": \"87fd7ff9-ebe6-427f-ac65-87fd66c60d6c\",\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.4530.2107090502\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": - \"Windows\",\r\n \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_828953c6ac444c8594b0b24f572ebe0f\",\r\n + \"14393.4583.2108010852\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": + \"Windows\",\r\n \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_78f0d7d835f740a79c068d3a92c0b7cc\",\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_828953c6ac444c8594b0b24f572ebe0f\"\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinescalesvirtualmachinescaleseOS__1_78f0d7d835f740a79c068d3a92c0b7cc\"\r\n \ },\r\n \"diskSizeGB\": 512\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"testPC000000\",\r\n \ \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\": @@ -671,7 +671,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:17:45 GMT + - Thu, 02 Sep 2021 04:22:50 GMT expires: - '-1' pragma: @@ -708,10 +708,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachinescaleset8c68120d_0\",\r\n \"id\": @@ -721,15 +721,15 @@ interactions: \ \"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\": \"c9b6d68c-76c1-452e-88ec-5a38e5f38ac0\",\r\n \"hardwareProfile\": + \ \"vmId\": \"87fd7ff9-ebe6-427f-ac65-87fd66c60d6c\",\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.4530.2107090502\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": - \"Windows\",\r\n \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_828953c6ac444c8594b0b24f572ebe0f\",\r\n + \"14393.4583.2108010852\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": + \"Windows\",\r\n \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_78f0d7d835f740a79c068d3a92c0b7cc\",\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_828953c6ac444c8594b0b24f572ebe0f\"\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinescalesvirtualmachinescaleseOS__1_78f0d7d835f740a79c068d3a92c0b7cc\"\r\n \ },\r\n \"diskSizeGB\": 512\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"testPC000000\",\r\n \ \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\": @@ -740,7 +740,7 @@ interactions: \ \"provisioningState\": \"Updating\"\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9be6a0ca-eb37-44b1-bb55-ff56194fbe8f?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e2c7ed3c-e2cb-46fd-ad07-ecf95a6fde7c?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: @@ -748,7 +748,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:17:46 GMT + - Thu, 02 Sep 2021 04:22:51 GMT expires: - '-1' pragma: @@ -765,7 +765,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1190,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1187,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - '1193' x-ms-request-charge: @@ -783,24 +783,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9be6a0ca-eb37-44b1-bb55-ff56194fbe8f?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e2c7ed3c-e2cb-46fd-ad07-ecf95a6fde7c?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:17:45.977526+00:00\",\r\n \"endTime\": - \"2021-07-22T04:17:46.1493881+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"9be6a0ca-eb37-44b1-bb55-ff56194fbe8f\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:22:51.1500262+00:00\",\r\n \"endTime\": + \"2021-09-02T04:22:51.2593814+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"e2c7ed3c-e2cb-46fd-ad07-ecf95a6fde7c\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:18:16 GMT + - Thu, 02 Sep 2021 04:23:22 GMT expires: - '-1' pragma: @@ -817,7 +817,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29896 + - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29878 status: code: 200 message: OK @@ -831,10 +831,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0?api-version=2021-07-01 response: body: string: "{\r\n \"name\": \"virtualmachinescaleset8c68120d_0\",\r\n \"id\": @@ -844,15 +844,15 @@ interactions: \ \"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\": \"c9b6d68c-76c1-452e-88ec-5a38e5f38ac0\",\r\n \"hardwareProfile\": + \ \"vmId\": \"87fd7ff9-ebe6-427f-ac65-87fd66c60d6c\",\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.4530.2107090502\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": - \"Windows\",\r\n \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_828953c6ac444c8594b0b24f572ebe0f\",\r\n + \"14393.4583.2108010852\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": + \"Windows\",\r\n \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_78f0d7d835f740a79c068d3a92c0b7cc\",\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_828953c6ac444c8594b0b24f572ebe0f\"\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/virtualmachinescalesvirtualmachinescaleseOS__1_78f0d7d835f740a79c068d3a92c0b7cc\"\r\n \ },\r\n \"diskSizeGB\": 512\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"testPC000000\",\r\n \ \"adminUsername\": \"testuser\",\r\n \"windowsConfiguration\": @@ -869,7 +869,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:18:16 GMT + - Thu, 02 Sep 2021 04:23:22 GMT expires: - '-1' pragma: @@ -904,26 +904,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0/restart?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4a8334da-0acf-4751-8377-a7bff034d53a?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e7102e4c-c427-46a5-8f0e-d8f8492564b8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:18:16 GMT + - Thu, 02 Sep 2021 04:23:22 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4a8334da-0acf-4751-8377-a7bff034d53a?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e7102e4c-c427-46a5-8f0e-d8f8492564b8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -934,7 +934,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1189,Microsoft.Compute/VMScaleSetVMActions3Min;199,Microsoft.Compute/VMScaleSetVMActions30Min;999,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3727,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1186,Microsoft.Compute/VMScaleSetVMActions3Min;199,Microsoft.Compute/VMScaleSetVMActions30Min;999,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3728,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - '1188' x-ms-request-charge: @@ -952,15 +952,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4a8334da-0acf-4751-8377-a7bff034d53a?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e7102e4c-c427-46a5-8f0e-d8f8492564b8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:18:16.9464439+00:00\",\r\n \"endTime\": - \"2021-07-22T04:18:18.2432999+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"4a8334da-0acf-4751-8377-a7bff034d53a\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:23:22.1190283+00:00\",\r\n \"endTime\": + \"2021-09-02T04:23:23.4940159+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"e7102e4c-c427-46a5-8f0e-d8f8492564b8\"\r\n}" headers: cache-control: - no-cache @@ -969,7 +969,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:18:46 GMT + - Thu, 02 Sep 2021 04:23:52 GMT expires: - '-1' pragma: @@ -986,7 +986,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14997,Microsoft.Compute/GetOperation30Min;29894 + - Microsoft.Compute/GetOperation3Min;14997,Microsoft.Compute/GetOperation30Min;29876 status: code: 200 message: OK @@ -1000,10 +1000,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/4a8334da-0acf-4751-8377-a7bff034d53a?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e7102e4c-c427-46a5-8f0e-d8f8492564b8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -1013,7 +1013,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 04:18:46 GMT + - Thu, 02 Sep 2021 04:23:52 GMT expires: - '-1' pragma: @@ -1026,7 +1026,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29893 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29875 status: code: 200 message: OK @@ -1042,26 +1042,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + 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=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a389be92-47a5-4d02-9929-a1390b68f1c5?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b287c469-8fba-4e2b-a7ba-782cb7dd5ac8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:18:46 GMT + - Thu, 02 Sep 2021 04:23:52 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a389be92-47a5-4d02-9929-a1390b68f1c5?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b287c469-8fba-4e2b-a7ba-782cb7dd5ac8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1072,7 +1072,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSetVM3Min;239,Microsoft.Compute/DeleteVMScaleSetVM30Min;1199,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3726,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/DeleteVMScaleSetVM3Min;239,Microsoft.Compute/DeleteVMScaleSetVM30Min;1199,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3727,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - '1187' x-ms-request-charge: @@ -1090,15 +1090,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a389be92-47a5-4d02-9929-a1390b68f1c5?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b287c469-8fba-4e2b-a7ba-782cb7dd5ac8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:18:47.1965892+00:00\",\r\n \"endTime\": - \"2021-07-22T04:18:58.0091485+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"a389be92-47a5-4d02-9929-a1390b68f1c5\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:23:52.4317259+00:00\",\r\n \"endTime\": + \"2021-09-02T04:24:03.8068482+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"b287c469-8fba-4e2b-a7ba-782cb7dd5ac8\"\r\n}" headers: cache-control: - no-cache @@ -1107,7 +1107,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:19:17 GMT + - Thu, 02 Sep 2021 04:24:22 GMT expires: - '-1' pragma: @@ -1124,7 +1124,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29891 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29873 status: code: 200 message: OK @@ -1138,10 +1138,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a389be92-47a5-4d02-9929-a1390b68f1c5?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/b287c469-8fba-4e2b-a7ba-782cb7dd5ac8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -1151,7 +1151,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 04:19:17 GMT + - Thu, 02 Sep 2021 04:24:22 GMT expires: - '-1' pragma: @@ -1164,7 +1164,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29890 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29872 status: code: 200 message: OK @@ -1180,26 +1180,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0/start?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/da3e5da2-9624-4bc7-89a7-5a3961317597?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e73aaf0b-1bdc-4988-9da6-7aea56bde6c8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:19:17 GMT + - Thu, 02 Sep 2021 04:24:22 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/da3e5da2-9624-4bc7-89a7-5a3961317597?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e73aaf0b-1bdc-4988-9da6-7aea56bde6c8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1210,7 +1210,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;237,Microsoft.Compute/VMScaleSetActions30Min;1188,Microsoft.Compute/VMScaleSetVMActions3Min;198,Microsoft.Compute/VMScaleSetVMActions30Min;998,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3725,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/VMScaleSetActions3Min;237,Microsoft.Compute/VMScaleSetActions30Min;1185,Microsoft.Compute/VMScaleSetVMActions3Min;198,Microsoft.Compute/VMScaleSetVMActions30Min;998,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3726,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - '1186' x-ms-request-charge: @@ -1228,24 +1228,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/da3e5da2-9624-4bc7-89a7-5a3961317597?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e73aaf0b-1bdc-4988-9da6-7aea56bde6c8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:19:17.4467715+00:00\",\r\n \"endTime\": - \"2021-07-22T04:19:24.3842804+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"da3e5da2-9624-4bc7-89a7-5a3961317597\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:24:22.697618+00:00\",\r\n \"endTime\": + \"2021-09-02T04:24:27.7288976+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"e73aaf0b-1bdc-4988-9da6-7aea56bde6c8\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:19:47 GMT + - Thu, 02 Sep 2021 04:24:52 GMT expires: - '-1' pragma: @@ -1262,7 +1262,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29888 + - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29870 status: code: 200 message: OK @@ -1276,10 +1276,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/da3e5da2-9624-4bc7-89a7-5a3961317597?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/e73aaf0b-1bdc-4988-9da6-7aea56bde6c8?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -1289,7 +1289,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 04:19:47 GMT + - Thu, 02 Sep 2021 04:24:52 GMT expires: - '-1' pragma: @@ -1302,7 +1302,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29887 + - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29869 status: code: 200 message: OK @@ -1320,26 +1320,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0/runCommand?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/053ea3ee-66bf-4102-a1c2-2dab25da55e0?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6a5a665b-509b-40e0-a298-c52e9b5e9f00?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:19:47 GMT + - Thu, 02 Sep 2021 04:24:52 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/053ea3ee-66bf-4102-a1c2-2dab25da55e0?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6a5a665b-509b-40e0-a298-c52e9b5e9f00?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1350,7 +1350,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;236,Microsoft.Compute/VMScaleSetActions30Min;1187,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3724,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/VMScaleSetActions3Min;236,Microsoft.Compute/VMScaleSetActions30Min;1184,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3725,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - '1185' x-ms-request-charge: @@ -1368,14 +1368,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/053ea3ee-66bf-4102-a1c2-2dab25da55e0?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6a5a665b-509b-40e0-a298-c52e9b5e9f00?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:19:47.6812881+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"053ea3ee-66bf-4102-a1c2-2dab25da55e0\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:24:52.9790869+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"6a5a665b-509b-40e0-a298-c52e9b5e9f00\"\r\n}" headers: cache-control: - no-cache @@ -1384,7 +1384,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:20:17 GMT + - Thu, 02 Sep 2021 04:25:22 GMT expires: - '-1' pragma: @@ -1401,7 +1401,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29908 + - Microsoft.Compute/GetOperation3Min;14988,Microsoft.Compute/GetOperation30Min;29892 status: code: 200 message: OK @@ -1415,14 +1415,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/053ea3ee-66bf-4102-a1c2-2dab25da55e0?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6a5a665b-509b-40e0-a298-c52e9b5e9f00?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:19:47.6812881+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"053ea3ee-66bf-4102-a1c2-2dab25da55e0\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:24:52.9790869+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"6a5a665b-509b-40e0-a298-c52e9b5e9f00\"\r\n}" headers: cache-control: - no-cache @@ -1431,7 +1431,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:20:47 GMT + - Thu, 02 Sep 2021 04:25:53 GMT expires: - '-1' pragma: @@ -1448,7 +1448,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29905 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29889 status: code: 200 message: OK @@ -1462,17 +1462,17 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/053ea3ee-66bf-4102-a1c2-2dab25da55e0?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6a5a665b-509b-40e0-a298-c52e9b5e9f00?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:19:47.6812881+00:00\",\r\n \"endTime\": - \"2021-07-22T04:20:48.1347418+00:00\",\r\n \"status\": \"Succeeded\",\r\n + string: "{\r\n \"startTime\": \"2021-09-02T04:24:52.9790869+00:00\",\r\n \"endTime\": + \"2021-09-02T04:26:03.4327399+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\": \"053ea3ee-66bf-4102-a1c2-2dab25da55e0\"\r\n}" + succeeded\",\"message\":\"\"}]}\r\n },\r\n \"name\": \"6a5a665b-509b-40e0-a298-c52e9b5e9f00\"\r\n}" headers: cache-control: - no-cache @@ -1481,7 +1481,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:21:17 GMT + - Thu, 02 Sep 2021 04:26:23 GMT expires: - '-1' pragma: @@ -1498,7 +1498,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29903 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29886 status: code: 200 message: OK @@ -1512,10 +1512,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/053ea3ee-66bf-4102-a1c2-2dab25da55e0?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6a5a665b-509b-40e0-a298-c52e9b5e9f00?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '{"value":[{"code":"ComponentStatus/StdOut/succeeded","level":"Info","displayStatus":"Provisioning @@ -1529,7 +1529,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:21:17 GMT + - Thu, 02 Sep 2021 04:26:23 GMT expires: - '-1' pragma: @@ -1546,7 +1546,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29902 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29885 status: code: 200 message: OK @@ -1564,26 +1564,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/manualupgrade?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/manualupgrade?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d704e260-a31c-49b1-b0db-503fb0ba45c8?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6d61f499-0c7a-44d2-9e49-b5e48880c707?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:21:18 GMT + - Thu, 02 Sep 2021 04:26:23 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d704e260-a31c-49b1-b0db-503fb0ba45c8?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6d61f499-0c7a-44d2-9e49-b5e48880c707?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1594,7 +1594,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;237,Microsoft.Compute/VMScaleSetActions30Min;1186,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/VMScaleSetActions3Min;237,Microsoft.Compute/VMScaleSetActions30Min;1183,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - '1184' x-ms-request-charge: @@ -1612,15 +1612,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d704e260-a31c-49b1-b0db-503fb0ba45c8?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6d61f499-0c7a-44d2-9e49-b5e48880c707?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:21:18.1193284+00:00\",\r\n \"endTime\": - \"2021-07-22T04:21:18.2911632+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"d704e260-a31c-49b1-b0db-503fb0ba45c8\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:26:23.4953734+00:00\",\r\n \"endTime\": + \"2021-09-02T04:26:23.6985072+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"6d61f499-0c7a-44d2-9e49-b5e48880c707\"\r\n}" headers: cache-control: - no-cache @@ -1629,7 +1629,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:21:47 GMT + - Thu, 02 Sep 2021 04:26:53 GMT expires: - '-1' pragma: @@ -1646,7 +1646,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29900 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29883 status: code: 200 message: OK @@ -1660,10 +1660,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/d704e260-a31c-49b1-b0db-503fb0ba45c8?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/6d61f499-0c7a-44d2-9e49-b5e48880c707?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -1673,7 +1673,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 04:21:48 GMT + - Thu, 02 Sep 2021 04:26:53 GMT expires: - '-1' pragma: @@ -1686,7 +1686,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29899 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29882 status: code: 200 message: OK @@ -1702,26 +1702,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0/deallocate?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e23e63d-74ef-4b91-9f81-67af908265c5?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a8c09dde-196f-46be-9e6c-73f4eae1b8c2?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:21:48 GMT + - Thu, 02 Sep 2021 04:26:53 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e23e63d-74ef-4b91-9f81-67af908265c5?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a8c09dde-196f-46be-9e6c-73f4eae1b8c2?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1732,7 +1732,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSetVM3Min;239,Microsoft.Compute/DeleteVMScaleSetVM30Min;1198,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3723,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/DeleteVMScaleSetVM3Min;239,Microsoft.Compute/DeleteVMScaleSetVM30Min;1198,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3724,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - '1183' x-ms-request-charge: @@ -1750,14 +1750,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e23e63d-74ef-4b91-9f81-67af908265c5?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a8c09dde-196f-46be-9e6c-73f4eae1b8c2?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:21:48.4319046+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"1e23e63d-74ef-4b91-9f81-67af908265c5\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:26:53.7924845+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"a8c09dde-196f-46be-9e6c-73f4eae1b8c2\"\r\n}" headers: cache-control: - no-cache @@ -1766,7 +1766,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:22:17 GMT + - Thu, 02 Sep 2021 04:27:23 GMT expires: - '-1' pragma: @@ -1783,7 +1783,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;29880 status: code: 200 message: OK @@ -1797,24 +1797,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e23e63d-74ef-4b91-9f81-67af908265c5?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a8c09dde-196f-46be-9e6c-73f4eae1b8c2?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:21:48.4319046+00:00\",\r\n \"endTime\": - \"2021-07-22T04:22:40.8381825+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"1e23e63d-74ef-4b91-9f81-67af908265c5\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:26:53.7924845+00:00\",\r\n \"endTime\": + \"2021-09-02T04:27:44.996015+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"a8c09dde-196f-46be-9e6c-73f4eae1b8c2\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:22:47 GMT + - Thu, 02 Sep 2021 04:27:53 GMT expires: - '-1' pragma: @@ -1831,7 +1831,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29894 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29877 status: code: 200 message: OK @@ -1845,10 +1845,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/1e23e63d-74ef-4b91-9f81-67af908265c5?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a8c09dde-196f-46be-9e6c-73f4eae1b8c2?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -1858,7 +1858,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 04:22:48 GMT + - Thu, 02 Sep 2021 04:27:53 GMT expires: - '-1' pragma: @@ -1871,7 +1871,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29893 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29876 status: code: 200 message: OK @@ -1889,26 +1889,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/delete?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/delete?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/49fcad8e-558e-43c2-8a81-f961bd5be86f?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0fa076a3-c853-441b-a07b-f9f9c307c5a0?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:22:48 GMT + - Thu, 02 Sep 2021 04:27:54 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/49fcad8e-558e-43c2-8a81-f961bd5be86f?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0fa076a3-c853-441b-a07b-f9f9c307c5a0?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1919,7 +1919,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1185,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3722,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1182,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3723,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - '1182' x-ms-request-charge: @@ -1937,24 +1937,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/49fcad8e-558e-43c2-8a81-f961bd5be86f?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0fa076a3-c853-441b-a07b-f9f9c307c5a0?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:22:48.7600688+00:00\",\r\n \"endTime\": - \"2021-07-22T04:22:50.6819466+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"49fcad8e-558e-43c2-8a81-f961bd5be86f\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:27:54.121089+00:00\",\r\n \"endTime\": + \"2021-09-02T04:27:55.8867116+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"0fa076a3-c853-441b-a07b-f9f9c307c5a0\"\r\n}" headers: cache-control: - no-cache content-length: - - '184' + - '183' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:23:18 GMT + - Thu, 02 Sep 2021 04:28:24 GMT expires: - '-1' pragma: @@ -1971,7 +1971,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29890 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29873 status: code: 200 message: OK @@ -1985,10 +1985,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/49fcad8e-558e-43c2-8a81-f961bd5be86f?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/0fa076a3-c853-441b-a07b-f9f9c307c5a0?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -1998,7 +1998,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 04:23:18 GMT + - Thu, 02 Sep 2021 04:28:24 GMT expires: - '-1' pragma: @@ -2011,7 +2011,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29889 + - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29872 status: code: 200 message: OK @@ -2027,26 +2027,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d/virtualmachines/0?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5e501263-48a3-4ab1-a3c7-f9c0246834c6?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/86075990-e96f-4a79-9ab2-435e3e234a34?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:23:18 GMT + - Thu, 02 Sep 2021 04:28:24 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5e501263-48a3-4ab1-a3c7-f9c0246834c6?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/86075990-e96f-4a79-9ab2-435e3e234a34?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -2059,7 +2059,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteVMScaleSetVM3Min;238,Microsoft.Compute/DeleteVMScaleSetVM30Min;1197,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-deletes: - - '14992' + - '14993' x-ms-request-charge: - '0' status: @@ -2075,15 +2075,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/5e501263-48a3-4ab1-a3c7-f9c0246834c6?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/86075990-e96f-4a79-9ab2-435e3e234a34?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:23:19.0727011+00:00\",\r\n \"endTime\": - \"2021-07-22T04:23:19.1508098+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"5e501263-48a3-4ab1-a3c7-f9c0246834c6\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:28:24.3244025+00:00\",\r\n \"endTime\": + \"2021-09-02T04:28:24.4025273+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"86075990-e96f-4a79-9ab2-435e3e234a34\"\r\n}" headers: cache-control: - no-cache @@ -2092,7 +2092,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:23:49 GMT + - Thu, 02 Sep 2021 04:28:54 GMT expires: - '-1' pragma: @@ -2109,7 +2109,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29887 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29870 status: code: 200 message: OK @@ -2125,10 +2125,10 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescaleset8c68120d?api-version=2021-07-01 response: body: string: '' @@ -2136,17 +2136,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a8d7d609-2b27-4f06-8e14-6d0f270f3d96?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/87d51e70-3e22-425c-823d-abd0023cd07d?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:23:49 GMT + - Thu, 02 Sep 2021 04:28:54 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a8d7d609-2b27-4f06-8e14-6d0f270f3d96?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/87d51e70-3e22-425c-823d-abd0023cd07d?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -2159,7 +2159,7 @@ interactions: x-ms-ratelimit-remaining-resource: - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;397,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-deletes: - - '14991' + - '14992' x-ms-request-charge: - '0' status: @@ -2175,15 +2175,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a8d7d609-2b27-4f06-8e14-6d0f270f3d96?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/87d51e70-3e22-425c-823d-abd0023cd07d?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:23:49.5572056+00:00\",\r\n \"endTime\": - \"2021-07-22T04:23:49.6509916+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"a8d7d609-2b27-4f06-8e14-6d0f270f3d96\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:28:54.5121273+00:00\",\r\n \"endTime\": + \"2021-09-02T04:28:54.6371274+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"87d51e70-3e22-425c-823d-abd0023cd07d\"\r\n}" headers: cache-control: - no-cache @@ -2192,7 +2192,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:23:59 GMT + - Thu, 02 Sep 2021 04:29:04 GMT expires: - '-1' pragma: @@ -2209,7 +2209,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29885 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29868 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 063f7e31d877..9990f2e431cd 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 @@ -14,17 +14,17 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e?api-version=2021-02-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/\\\"18ced800-19b2-4e87-8ec9-880be304afc9\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"703b0170-aadc-4075-bd7f-b35ea485c5eb\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": - \"c104653a-42eb-4657-b508-e8d1f1dc427b\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + \"0b401b7c-7cb1-499d-9d24-85588c3c72dd\",\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 \ }\r\n}" @@ -32,7 +32,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/eb5e5d80-7a0e-4eb8-b9b1-3ce283187f75?api-version=2021-02-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/a26bf891-8f30-4204-8644-4c2771aec615?api-version=2021-02-01 cache-control: - no-cache content-length: @@ -40,7 +40,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:24:01 GMT + - Thu, 02 Sep 2021 04:29:06 GMT expires: - '-1' pragma: @@ -53,7 +53,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 252ac0d0-38a9-43bf-b2f0-eea13bd6e3a4 + - f96baca2-1b24-4cc9-95da-ad304e7f71e7 x-ms-ratelimit-remaining-subscription-writes: - '1192' status: @@ -69,10 +69,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/eb5e5d80-7a0e-4eb8-b9b1-3ce283187f75?api-version=2021-02-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/a26bf891-8f30-4204-8644-4c2771aec615?api-version=2021-02-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -84,7 +84,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:24:04 GMT + - Thu, 02 Sep 2021 04:29:09 GMT expires: - '-1' pragma: @@ -101,7 +101,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 87064de3-5980-4029-8f5b-706c8a2f5135 + - a5dcbaa6-ca91-4546-a218-57a5fdd0f571 status: code: 200 message: OK @@ -115,17 +115,17 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e?api-version=2021-02-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/\\\"f492324d-4ab3-42a4-8e57-e6824fd3f761\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"2887cfc0-48e7-49c7-bc1d-0bd36e639461\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": - \"c104653a-42eb-4657-b508-e8d1f1dc427b\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + \"0b401b7c-7cb1-499d-9d24-85588c3c72dd\",\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 \ }\r\n}" @@ -137,9 +137,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:24:04 GMT + - Thu, 02 Sep 2021 04:29:09 GMT etag: - - W/"f492324d-4ab3-42a4-8e57-e6824fd3f761" + - W/"2887cfc0-48e7-49c7-bc1d-0bd36e639461" expires: - '-1' pragma: @@ -156,7 +156,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 03f405a0-4c82-49d1-a6d2-746574141196 + - 2d2ecfe7-eb39-4922-8ccb-263a92037ce4 status: code: 200 message: OK @@ -174,21 +174,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e/subnets/subnetnamexb172129e?api-version=2021-02-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/\\\"1185d954-0f76-4177-9a89-41f0945dc5a7\\\"\",\r\n \"properties\": + \ \"etag\": \"W/\\\"a82c55f4-f3c7-4669-b289-fbf4c15d89dd\\\"\",\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/e22cf8b7-c2fc-4e88-8583-c9bbf18bf20c?api-version=2021-02-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/c53c0624-f5bb-46ef-ad14-70e063e45006?api-version=2021-02-01 cache-control: - no-cache content-length: @@ -196,7 +196,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:24:05 GMT + - Thu, 02 Sep 2021 04:29:09 GMT expires: - '-1' pragma: @@ -209,7 +209,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 3f633206-450b-4343-b405-ca8f0e3af83b + - 71c6a28c-048c-4a4d-9782-7a8482e1d9e3 x-ms-ratelimit-remaining-subscription-writes: - '1191' status: @@ -225,10 +225,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/e22cf8b7-c2fc-4e88-8583-c9bbf18bf20c?api-version=2021-02-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/c53c0624-f5bb-46ef-ad14-70e063e45006?api-version=2021-02-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -240,7 +240,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:24:08 GMT + - Thu, 02 Sep 2021 04:29:12 GMT expires: - '-1' pragma: @@ -257,7 +257,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 9ae628d3-aedb-4400-8859-7bbc85404e06 + - 6c4d9e91-dc3f-45bb-b2fa-57857853dbac status: code: 200 message: OK @@ -271,14 +271,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networknamexb172129e/subnets/subnetnamexb172129e?api-version=2021-02-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/\\\"45e090dd-3345-4d8a-bf33-e0def23bd40c\\\"\",\r\n \"properties\": + \ \"etag\": \"W/\\\"11e3f905-a94e-40f0-b895-f4a10d42cc5d\\\"\",\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\n },\r\n \"type\": @@ -291,9 +291,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:24:08 GMT + - Thu, 02 Sep 2021 04:29:12 GMT etag: - - W/"45e090dd-3345-4d8a-bf33-e0def23bd40c" + - W/"11e3f905-a94e-40f0-b895-f4a10d42cc5d" expires: - '-1' pragma: @@ -310,7 +310,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - e0aee6d6-193e-4efa-82cd-192304f50731 + - 64140626-2fae-4c5e-bd5e-e186ba27b4f8 status: code: 200 message: OK @@ -338,10 +338,10 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e?api-version=2021-07-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 @@ -363,12 +363,12 @@ interactions: \"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 \ },\r\n \"provisioningState\": \"Creating\",\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\": - \"c1ae1982-e1d9-4e6d-937b-e491b8f43549\"\r\n }\r\n}" + \"bd924eab-28f8-4c18-89e9-f9bcc7f04907\"\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/451fdb84-cfc2-47c0-8d3a-c8bf81b632f9?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/03c6482a-660b-482d-b6fd-172f578ba6c6?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: @@ -376,7 +376,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:24:08 GMT + - Thu, 02 Sep 2021 04:29:15 GMT expires: - '-1' pragma: @@ -389,9 +389,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateVMScaleSet3Min;185,Microsoft.Compute/CreateVMScaleSet30Min;928,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3724,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/CreateVMScaleSet3Min;185,Microsoft.Compute/CreateVMScaleSet30Min;928,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3725,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - - '1191' + - '1196' x-ms-request-charge: - '2' status: @@ -407,14 +407,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/451fdb84-cfc2-47c0-8d3a-c8bf81b632f9?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/03c6482a-660b-482d-b6fd-172f578ba6c6?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:24:08.9791991+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"451fdb84-cfc2-47c0-8d3a-c8bf81b632f9\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:29:13.8092045+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"03c6482a-660b-482d-b6fd-172f578ba6c6\"\r\n}" headers: cache-control: - no-cache @@ -423,7 +423,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:24:19 GMT + - Thu, 02 Sep 2021 04:29:25 GMT expires: - '-1' pragma: @@ -440,7 +440,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29884 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29867 status: code: 200 message: OK @@ -454,15 +454,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/451fdb84-cfc2-47c0-8d3a-c8bf81b632f9?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/03c6482a-660b-482d-b6fd-172f578ba6c6?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:24:08.9791991+00:00\",\r\n \"endTime\": - \"2021-07-22T04:25:37.0578147+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"451fdb84-cfc2-47c0-8d3a-c8bf81b632f9\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:29:13.8092045+00:00\",\r\n \"endTime\": + \"2021-09-02T04:30:58.1537196+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"03c6482a-660b-482d-b6fd-172f578ba6c6\"\r\n}" headers: cache-control: - no-cache @@ -471,7 +471,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:25:56 GMT + - Thu, 02 Sep 2021 04:31:02 GMT expires: - '-1' pragma: @@ -488,7 +488,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29911 + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29890 status: code: 200 message: OK @@ -502,10 +502,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e?api-version=2021-07-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 @@ -527,7 +527,7 @@ interactions: \"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 \ },\r\n \"provisioningState\": \"Succeeded\",\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\": false,\r\n \"uniqueId\": - \"c1ae1982-e1d9-4e6d-937b-e491b8f43549\"\r\n }\r\n}" + \"bd924eab-28f8-4c18-89e9-f9bcc7f04907\"\r\n }\r\n}" headers: cache-control: - no-cache @@ -536,7 +536,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:25:56 GMT + - Thu, 02 Sep 2021 04:31:02 GMT expires: - '-1' pragma: @@ -553,7 +553,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSet3Min;393,Microsoft.Compute/GetVMScaleSet30Min;2571 + - Microsoft.Compute/GetVMScaleSet3Min;396,Microsoft.Compute/GetVMScaleSet30Min;2577 status: code: 200 message: OK @@ -567,40 +567,85 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/0/instanceView?api-version=2021-07-01 response: body: - string: "{\r\n \"placementGroupId\": \"37bbc1c2-890c-4193-a7ec-8bdcf3cddd21\",\r\n - \ \"platformUpdateDomain\": 0,\r\n \"platformFaultDomain\": 0,\r\n \"computerName\": - \"testPC000000\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\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: + - '115' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 02 Sep 2021 04:34:02 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;4994,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/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/1/instanceView?api-version=2021-07-01 + response: + body: + string: "{\r\n \"placementGroupId\": \"f02587ec-11e5-426a-9e0e-3e8ae54c1c3c\",\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.1010\",\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\": - \"2021-07-22T04:28:50+00:00\"\r\n }\r\n ]\r\n },\r\n \"disks\": - [\r\n {\r\n \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_faeb6de86bc8438fa2efb45b560da398\",\r\n + \"2021-09-02T04:33:25+00:00\"\r\n }\r\n ]\r\n },\r\n \"disks\": + [\r\n {\r\n \"name\": \"virtualmachinescalesvirtualmachinescaleseOS__1_51887191af02458c9c8faa0e24457f63\",\r\n \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning - succeeded\",\r\n \"time\": \"2021-07-22T04:25:37.604691+00:00\"\r\n + succeeded\",\r\n \"time\": \"2021-09-02T04:29:18.8404815+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\": \"2021-07-22T04:26:39.1363048+00:00\"\r\n },\r\n {\r\n + \ \"time\": \"2021-09-02T04:30:58.0756177+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: - - '1317' + - '1318' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:28:56 GMT + - Thu, 02 Sep 2021 04:34:02 GMT expires: - '-1' pragma: @@ -617,7 +662,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSetVM3Min;999,Microsoft.Compute/GetVMScaleSetVM30Min;4994,Microsoft.Compute/VMScaleSetVMViews3Min;4999 + - Microsoft.Compute/GetVMScaleSetVM3Min;998,Microsoft.Compute/GetVMScaleSetVM30Min;4993,Microsoft.Compute/VMScaleSetVMViews3Min;4998 x-ms-request-charge: - '1' status: @@ -635,26 +680,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/1/redeploy?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/80c35678-9172-4f21-ac6b-594d63c4b09b?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a7873cf8-6497-454c-ae69-d905b9a798f1?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:28:56 GMT + - Thu, 02 Sep 2021 04:34:02 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/80c35678-9172-4f21-ac6b-594d63c4b09b?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a7873cf8-6497-454c-ae69-d905b9a798f1?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -665,7 +710,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1184,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3725,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/VMScaleSetActions3Min;239,Microsoft.Compute/VMScaleSetActions30Min;1184,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3728,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - '1181' x-ms-request-charge: @@ -683,14 +728,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/80c35678-9172-4f21-ac6b-594d63c4b09b?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a7873cf8-6497-454c-ae69-d905b9a798f1?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:28:56.8089824+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"80c35678-9172-4f21-ac6b-594d63c4b09b\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:34:03.1551023+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"a7873cf8-6497-454c-ae69-d905b9a798f1\"\r\n}" headers: cache-control: - no-cache @@ -699,7 +744,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:29:26 GMT + - Thu, 02 Sep 2021 04:34:32 GMT expires: - '-1' pragma: @@ -716,7 +761,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29909 + - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29888 status: code: 200 message: OK @@ -730,14 +775,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/80c35678-9172-4f21-ac6b-594d63c4b09b?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a7873cf8-6497-454c-ae69-d905b9a798f1?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:28:56.8089824+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"80c35678-9172-4f21-ac6b-594d63c4b09b\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:34:03.1551023+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"a7873cf8-6497-454c-ae69-d905b9a798f1\"\r\n}" headers: cache-control: - no-cache @@ -746,7 +791,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:29:56 GMT + - Thu, 02 Sep 2021 04:35:02 GMT expires: - '-1' pragma: @@ -763,7 +808,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29906 + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29936 status: code: 200 message: OK @@ -777,14 +822,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/80c35678-9172-4f21-ac6b-594d63c4b09b?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a7873cf8-6497-454c-ae69-d905b9a798f1?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:28:56.8089824+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"80c35678-9172-4f21-ac6b-594d63c4b09b\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:34:03.1551023+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"a7873cf8-6497-454c-ae69-d905b9a798f1\"\r\n}" headers: cache-control: - no-cache @@ -793,7 +838,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:30:26 GMT + - Thu, 02 Sep 2021 04:35:33 GMT expires: - '-1' pragma: @@ -810,7 +855,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29931 + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29933 status: code: 200 message: OK @@ -824,14 +869,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/80c35678-9172-4f21-ac6b-594d63c4b09b?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a7873cf8-6497-454c-ae69-d905b9a798f1?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:28:56.8089824+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"80c35678-9172-4f21-ac6b-594d63c4b09b\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:34:03.1551023+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"a7873cf8-6497-454c-ae69-d905b9a798f1\"\r\n}" headers: cache-control: - no-cache @@ -840,7 +885,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:30:56 GMT + - Thu, 02 Sep 2021 04:36:03 GMT expires: - '-1' pragma: @@ -857,7 +902,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29928 + - Microsoft.Compute/GetOperation3Min;14989,Microsoft.Compute/GetOperation30Min;29930 status: code: 200 message: OK @@ -871,24 +916,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/80c35678-9172-4f21-ac6b-594d63c4b09b?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a7873cf8-6497-454c-ae69-d905b9a798f1?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:28:56.8089824+00:00\",\r\n \"endTime\": - \"2021-07-22T04:30:58.871513+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"80c35678-9172-4f21-ac6b-594d63c4b09b\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:34:03.1551023+00:00\",\r\n \"endTime\": + \"2021-09-02T04:36:12.5321495+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"a7873cf8-6497-454c-ae69-d905b9a798f1\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:31:26 GMT + - Thu, 02 Sep 2021 04:36:33 GMT expires: - '-1' pragma: @@ -905,7 +950,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14987,Microsoft.Compute/GetOperation30Min;29926 + - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29927 status: code: 200 message: OK @@ -919,10 +964,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/80c35678-9172-4f21-ac6b-594d63c4b09b?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/a7873cf8-6497-454c-ae69-d905b9a798f1?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -932,7 +977,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 04:31:27 GMT + - Thu, 02 Sep 2021 04:36:33 GMT expires: - '-1' pragma: @@ -945,7 +990,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14986,Microsoft.Compute/GetOperation30Min;29925 + - Microsoft.Compute/GetOperation3Min;14985,Microsoft.Compute/GetOperation30Min;29926 status: code: 200 message: OK @@ -963,26 +1008,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/1/reimage?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ab691baf-367c-48fe-9b98-8b53da194bae?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fea2c0ea-810f-4129-982f-88cda4da046e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:31:27 GMT + - Thu, 02 Sep 2021 04:36:33 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ab691baf-367c-48fe-9b98-8b53da194bae?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fea2c0ea-810f-4129-982f-88cda4da046e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -993,7 +1038,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1188,Microsoft.Compute/VMScaleSetVMActions3Min;199,Microsoft.Compute/VMScaleSetVMActions30Min;997,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3726,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1188,Microsoft.Compute/VMScaleSetVMActions3Min;199,Microsoft.Compute/VMScaleSetVMActions30Min;997,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3727,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - '1180' x-ms-request-charge: @@ -1011,23 +1056,70 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fea2c0ea-810f-4129-982f-88cda4da046e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + response: + body: + string: "{\r\n \"startTime\": \"2021-09-02T04:36:33.8136157+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"fea2c0ea-810f-4129-982f-88cda4da046e\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 02 Sep 2021 04:37: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;14984,Microsoft.Compute/GetOperation30Min;29924 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ab691baf-367c-48fe-9b98-8b53da194bae?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fea2c0ea-810f-4129-982f-88cda4da046e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:31:27.434207+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"ab691baf-367c-48fe-9b98-8b53da194bae\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:36:33.8136157+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"fea2c0ea-810f-4129-982f-88cda4da046e\"\r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '134' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:31:57 GMT + - Thu, 02 Sep 2021 04:37:33 GMT expires: - '-1' pragma: @@ -1044,7 +1136,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29923 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29921 status: code: 200 message: OK @@ -1058,23 +1150,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ab691baf-367c-48fe-9b98-8b53da194bae?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fea2c0ea-810f-4129-982f-88cda4da046e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:31:27.434207+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"ab691baf-367c-48fe-9b98-8b53da194bae\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:36:33.8136157+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"fea2c0ea-810f-4129-982f-88cda4da046e\"\r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '134' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:32:27 GMT + - Thu, 02 Sep 2021 04:38:03 GMT expires: - '-1' pragma: @@ -1091,7 +1183,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29920 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29918 status: code: 200 message: OK @@ -1105,23 +1197,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ab691baf-367c-48fe-9b98-8b53da194bae?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fea2c0ea-810f-4129-982f-88cda4da046e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:31:27.434207+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"ab691baf-367c-48fe-9b98-8b53da194bae\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:36:33.8136157+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"fea2c0ea-810f-4129-982f-88cda4da046e\"\r\n}" headers: cache-control: - no-cache content-length: - - '133' + - '134' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:32:56 GMT + - Thu, 02 Sep 2021 04:38:33 GMT expires: - '-1' pragma: @@ -1138,7 +1230,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29917 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29915 status: code: 200 message: OK @@ -1152,24 +1244,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ab691baf-367c-48fe-9b98-8b53da194bae?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fea2c0ea-810f-4129-982f-88cda4da046e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:31:27.434207+00:00\",\r\n \"endTime\": - \"2021-07-22T04:33:16.5285757+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"ab691baf-367c-48fe-9b98-8b53da194bae\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:36:33.8136157+00:00\",\r\n \"endTime\": + \"2021-09-02T04:38:44.1583737+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"fea2c0ea-810f-4129-982f-88cda4da046e\"\r\n}" headers: cache-control: - no-cache content-length: - - '183' + - '184' content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:33:27 GMT + - Thu, 02 Sep 2021 04:39:03 GMT expires: - '-1' pragma: @@ -1186,7 +1278,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29914 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29912 status: code: 200 message: OK @@ -1200,10 +1292,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/ab691baf-367c-48fe-9b98-8b53da194bae?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/fea2c0ea-810f-4129-982f-88cda4da046e?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -1213,7 +1305,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 04:33:27 GMT + - Thu, 02 Sep 2021 04:39:03 GMT expires: - '-1' pragma: @@ -1226,7 +1318,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29913 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29911 status: code: 200 message: OK @@ -1242,26 +1334,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 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=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e/virtualmachines/1/reimageall?api-version=2021-07-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7a15fc99-e185-4e8d-90fa-e735b49fb187?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8d975cc2-92a4-4860-9159-2e475e0ca408?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:33:27 GMT + - Thu, 02 Sep 2021 04:39:03 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7a15fc99-e185-4e8d-90fa-e735b49fb187?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8d975cc2-92a4-4860-9159-2e475e0ca408?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1272,7 +1364,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1187,Microsoft.Compute/VMScaleSetVMActions3Min;198,Microsoft.Compute/VMScaleSetVMActions30Min;996,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3726,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/VMScaleSetActions3Min;238,Microsoft.Compute/VMScaleSetActions30Min;1187,Microsoft.Compute/VMScaleSetVMActions3Min;198,Microsoft.Compute/VMScaleSetVMActions30Min;996,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3727,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-writes: - '1179' x-ms-request-charge: @@ -1290,14 +1382,61 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) + VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8d975cc2-92a4-4860-9159-2e475e0ca408?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 + response: + body: + string: "{\r\n \"startTime\": \"2021-09-02T04:39:04.3147747+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"8d975cc2-92a4-4860-9159-2e475e0ca408\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 02 Sep 2021 04:39: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;14984,Microsoft.Compute/GetOperation30Min;29909 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7a15fc99-e185-4e8d-90fa-e735b49fb187?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8d975cc2-92a4-4860-9159-2e475e0ca408?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:33:28.0129974+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"7a15fc99-e185-4e8d-90fa-e735b49fb187\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:39:04.3147747+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"8d975cc2-92a4-4860-9159-2e475e0ca408\"\r\n}" headers: cache-control: - no-cache @@ -1306,7 +1445,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:33:57 GMT + - Thu, 02 Sep 2021 04:40:04 GMT expires: - '-1' pragma: @@ -1323,7 +1462,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29910 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29919 status: code: 200 message: OK @@ -1337,14 +1476,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7a15fc99-e185-4e8d-90fa-e735b49fb187?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8d975cc2-92a4-4860-9159-2e475e0ca408?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:33:28.0129974+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"7a15fc99-e185-4e8d-90fa-e735b49fb187\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:39:04.3147747+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"8d975cc2-92a4-4860-9159-2e475e0ca408\"\r\n}" headers: cache-control: - no-cache @@ -1353,7 +1492,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:34:27 GMT + - Thu, 02 Sep 2021 04:40:34 GMT expires: - '-1' pragma: @@ -1370,7 +1509,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29907 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29916 status: code: 200 message: OK @@ -1384,14 +1523,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7a15fc99-e185-4e8d-90fa-e735b49fb187?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8d975cc2-92a4-4860-9159-2e475e0ca408?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:33:28.0129974+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"7a15fc99-e185-4e8d-90fa-e735b49fb187\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:39:04.3147747+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"8d975cc2-92a4-4860-9159-2e475e0ca408\"\r\n}" headers: cache-control: - no-cache @@ -1400,7 +1539,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:34:57 GMT + - Thu, 02 Sep 2021 04:41:04 GMT expires: - '-1' pragma: @@ -1417,7 +1556,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;29913 status: code: 200 message: OK @@ -1431,15 +1570,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7a15fc99-e185-4e8d-90fa-e735b49fb187?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8d975cc2-92a4-4860-9159-2e475e0ca408?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:33:28.0129974+00:00\",\r\n \"endTime\": - \"2021-07-22T04:35:02.9666546+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"7a15fc99-e185-4e8d-90fa-e735b49fb187\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:39:04.3147747+00:00\",\r\n \"endTime\": + \"2021-09-02T04:41:11.4563689+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"8d975cc2-92a4-4860-9159-2e475e0ca408\"\r\n}" headers: cache-control: - no-cache @@ -1448,7 +1587,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:35:28 GMT + - Thu, 02 Sep 2021 04:41:34 GMT expires: - '-1' pragma: @@ -1465,7 +1604,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29917 + - Microsoft.Compute/GetOperation3Min;14984,Microsoft.Compute/GetOperation30Min;29910 status: code: 200 message: OK @@ -1479,10 +1618,10 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/7a15fc99-e185-4e8d-90fa-e735b49fb187?monitor=true&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/8d975cc2-92a4-4860-9159-2e475e0ca408?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 response: body: string: '' @@ -1492,7 +1631,7 @@ interactions: content-length: - '0' date: - - Thu, 22 Jul 2021 04:35:28 GMT + - Thu, 02 Sep 2021 04:41:34 GMT expires: - '-1' pragma: @@ -1505,7 +1644,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29916 + - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29909 status: code: 200 message: OK @@ -1521,10 +1660,10 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/virtualmachinescalesetb172129e?api-version=2021-07-01 response: body: string: '' @@ -1532,17 +1671,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c1999817-9f40-4e65-8b33-e63ac00bdb1a?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f8f19fc8-2868-4a24-aca0-370186edaa69?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 22 Jul 2021 04:35:28 GMT + - Thu, 02 Sep 2021 04:41:34 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c1999817-9f40-4e65-8b33-e63ac00bdb1a?monitor=true&api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f8f19fc8-2868-4a24-aca0-370186edaa69?p=54253b73-cb53-496f-ab42-5e5ee19426f8&monitor=true&api-version=2021-07-01 pragma: - no-cache server: @@ -1553,7 +1692,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;397,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3725,Microsoft.Compute/VmssQueuedVMOperations;0 + - Microsoft.Compute/DeleteVMScaleSet3Min;79,Microsoft.Compute/DeleteVMScaleSet30Min;397,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;3727,Microsoft.Compute/VmssQueuedVMOperations;0 x-ms-ratelimit-remaining-subscription-deletes: - '14992' x-ms-request-charge: @@ -1571,14 +1710,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c1999817-9f40-4e65-8b33-e63ac00bdb1a?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f8f19fc8-2868-4a24-aca0-370186edaa69?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:35:28.4980743+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"c1999817-9f40-4e65-8b33-e63ac00bdb1a\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:41:35.1440482+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"f8f19fc8-2868-4a24-aca0-370186edaa69\"\r\n}" headers: cache-control: - no-cache @@ -1587,7 +1726,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:35:38 GMT + - Thu, 02 Sep 2021 04:41:44 GMT expires: - '-1' pragma: @@ -1604,7 +1743,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29915 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29908 status: code: 200 message: OK @@ -1618,14 +1757,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c1999817-9f40-4e65-8b33-e63ac00bdb1a?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f8f19fc8-2868-4a24-aca0-370186edaa69?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:35:28.4980743+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"c1999817-9f40-4e65-8b33-e63ac00bdb1a\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:41:35.1440482+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"f8f19fc8-2868-4a24-aca0-370186edaa69\"\r\n}" headers: cache-control: - no-cache @@ -1634,7 +1773,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:35:49 GMT + - Thu, 02 Sep 2021 04:41:55 GMT expires: - '-1' pragma: @@ -1651,7 +1790,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29914 + - Microsoft.Compute/GetOperation3Min;14981,Microsoft.Compute/GetOperation30Min;29907 status: code: 200 message: OK @@ -1665,15 +1804,15 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) + - azsdk-python-azure-mgmt-compute/23.0.0 Python/3.8.11 (Linux-5.8.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/c1999817-9f40-4e65-8b33-e63ac00bdb1a?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f8f19fc8-2868-4a24-aca0-370186edaa69?p=54253b73-cb53-496f-ab42-5e5ee19426f8&api-version=2021-07-01 response: body: - string: "{\r\n \"startTime\": \"2021-07-22T04:35:28.4980743+00:00\",\r\n \"endTime\": - \"2021-07-22T04:36:01.5295463+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"c1999817-9f40-4e65-8b33-e63ac00bdb1a\"\r\n}" + string: "{\r\n \"startTime\": \"2021-09-02T04:41:35.1440482+00:00\",\r\n \"endTime\": + \"2021-09-02T04:42:14.0662266+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"f8f19fc8-2868-4a24-aca0-370186edaa69\"\r\n}" headers: cache-control: - no-cache @@ -1682,7 +1821,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 22 Jul 2021 04:36:19 GMT + - Thu, 02 Sep 2021 04:42:25 GMT expires: - '-1' pragma: @@ -1699,7 +1838,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29912 + - Microsoft.Compute/GetOperation3Min;14982,Microsoft.Compute/GetOperation30Min;29905 status: code: 200 message: OK 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 effd2bc7d3e9..0d6ca413e51b 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 @@ -845,6 +845,7 @@ def test_compute(self, resource_group): result = self.mgmt_client.virtual_machine_scale_sets.begin_delete(resource_group.name, VIRTUAL_MACHINE_SCALE_SET_NAME) result = result.result() + @unittest.skip('hard to test') @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) def test_compute_vmss_base_2(self, resource_group):