diff --git a/sdk/compute/azure-mgmt-compute/_meta.json b/sdk/compute/azure-mgmt-compute/_meta.json index c01a567cc22b..b7e6d44a485d 100644 --- a/sdk/compute/azure-mgmt-compute/_meta.json +++ b/sdk/compute/azure-mgmt-compute/_meta.json @@ -1,11 +1,57 @@ { - "commit": "07f6af5ba991088995d774e80e3d94b364611baf", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "commit": "adec94a7eece4f91ca08c4a42b3ccddbccd87eaa", + "repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs", "autorest": "3.9.7", "use": [ "@autorest/python@6.13.7", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/compute/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False", - "readme": "specification/compute/resource-manager/readme.md" + "autorest_command": "autorest specification/compute/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False", + "readme": "specification/compute/resource-manager/readme.md", + "package-2024-03-01-only": "2024-03-21 12:47:45 -0400 5312cc6da7d6c051e0e96902f3718a9fb3e9e021 Microsoft.Compute/ComputeRP/stable/2024-03-01/virtualMachineScaleSet.json", + "package-2023-10-02-only": "2023-12-19 03:18:52 -0500 4a4e7c0083937d49061641e857bc876043bb1f5b Microsoft.Compute/DiskRP/stable/2023-10-02/snapshot.json", + "package-2023-09-01-only": "2023-12-05 16:05:55 -0500 378977e71101fdf224414b86e9f7d8c776cd07ec Microsoft.Compute/ComputeRP/stable/2023-09-01/virtualMachineScaleSet.json", + "package-2023-07-03-only": "2024-02-08 13:16:01 -0500 f715b7fee5e648d06b17467b08473f6cbeee84e0 Microsoft.Compute/GalleryRP/stable/2023-07-03/sharedGallery.json", + "package-2023-07-01-only": "2023-08-10 16:21:40 -0400 1a925d1afe288a5f20d078bbc89214a36a0e4287 Microsoft.Compute/ComputeRP/stable/2023-07-01/virtualMachineScaleSet.json", + "package-2023-04-02-only": "2023-08-07 20:58:57 -0400 b9403296f0b0e112b0d8222ad05fd1d79ee10e03 Microsoft.Compute/DiskRP/stable/2023-04-02/diskRestorePoint.json", + "package-2023-03-01-only": "2023-04-17 22:42:05 -0400 b06a6f45e472dd07c2e0dab06b1e52dfe2684c88 Microsoft.Compute/ComputeRP/stable/2023-03-01/virtualMachineScaleSet.json", + "package-2023-01-02-only": "2023-06-28 00:48:15 -0400 b1d41f8dc643415d4dc6ee82bdb2fef04ef45bc9 Microsoft.Compute/DiskRP/stable/2023-01-02/snapshot.json", + "package-2022-11-01-only": "2023-03-01 02:28:46 -0500 03261080b3083a9e8cb0b61d840cc8291c596590 Microsoft.Compute/common-types/v1/common.json", + "package-2022-09-04-only": "2023-03-01 02:28:46 -0500 03261080b3083a9e8cb0b61d840cc8291c596590 Microsoft.Compute/common-types/v1/common.json", + "package-2022-08-03-only": "2023-11-28 14:37:35 -0500 a4d77e0bd0f00b66d42940a9be143fdb38534b1e Microsoft.Compute/GalleryRP/stable/2022-08-03/sharedGallery.json", + "package-2022-08-01-only": "2023-07-25 07:16:18 +0530 324d833f80ccd86dfd5b8035625ea17b537edf51 Microsoft.Compute/ComputeRP/stable/2022-08-01/computeRPCommon.json", + "package-2022-07-02-only": "2023-03-01 02:28:46 -0500 03261080b3083a9e8cb0b61d840cc8291c596590 Microsoft.Compute/common-types/v1/common.json", + "package-2022-04-04-only": "2022-08-04 22:48:19 -0400 a31c376ede1e91abc3ab476ae8e8d316e80541c0 Microsoft.Compute/CloudserviceRP/stable/2022-04-04/cloudService.json", + "package-2022-03-03-only": "2023-05-16 23:00:04 -0400 a2140e7ff0a6c28df501b16c51fe85b762a386fc Microsoft.Compute/GalleryRP/stable/2022-03-03/communityGallery.json", + "package-2022-03-02-only": "2022-08-04 22:48:19 -0400 a31c376ede1e91abc3ab476ae8e8d316e80541c0 Microsoft.Compute/DiskRP/stable/2022-03-02/snapshot.json", + "package-2022-03-01-only": "2022-10-13 19:55:58 -0700 ab898cdcc6e69ae41cb27ceee6abbe4e505e4a73 Microsoft.Compute/ComputeRP/stable/2022-03-01/virtualMachineScaleSet.json", + "package-2022-01-03-only": "2023-02-02 02:56:58 -0600 5920340193de5e6cbfdc514218bd76a602c22b4b Microsoft.Compute/GalleryRP/stable/2022-01-03/gallery.json", + "package-2021-12-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/DiskRP/stable/2021-12-01/disk.json", + "package-2021-11-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/ComputeRP/stable/2021-11-01/runCommands.json", + "package-2021-10-01-only": "2023-02-02 02:56:58 -0600 5920340193de5e6cbfdc514218bd76a602c22b4b Microsoft.Compute/GalleryRP/stable/2021-10-01/gallery.json", + "package-2021-08-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/DiskRP/stable/2021-08-01/disk.json", + "package-2021-07-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/Skus/stable/2021-07-01/skus.json", + "package-2021-04-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/DiskRP/stable/2021-04-01/disk.json", + "package-2021-03-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/ComputeRP/stable/2021-03-01/runCommands.json", + "package-2020-12-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/DiskRP/stable/2020-12-01/disk.json", + "package-2020-10-01-preview-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/CloudserviceRP/preview/2020-10-01-preview/cloudService.json", + "package-2020-09-30-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/GalleryRP/preview/2020-09-30/sharedGallery.json", + "package-2020-06-30-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/DiskRP/stable/2020-06-30/disk.json", + "package-2020-06-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/ComputeRP/stable/2020-06-01/runCommands.json", + "package-2020-05-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/DiskRP/stable/2020-05-01/disk.json", + "package-2019-12-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/GalleryRP/stable/2019-12-01/gallery.json", + "package-2019-11-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/DiskRP/stable/2019-11-01/disk.json", + "package-2019-07-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/GalleryRP/stable/2019-07-01/gallery.json", + "package-2019-04-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/Skus/stable/2019-04-01/skus.json", + "package-2019-03-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/GalleryRP/stable/2019-03-01/gallery.json", + "package-2018-10-01-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/ComputeRP/stable/2018-10-01/runCommands.json", + "package-2018-09-30-only": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/DiskRP/stable/2018-09-30/disk.json", + "package-compute-only-2018-06": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/GalleryRP/stable/2018-06-01/gallery.json", + "package-compute-2018-04": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/DiskRP/stable/2018-04-01/disk.json", + "package-compute-only-2017-12": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/ComputeRP/stable/2017-12-01/runCommands.json", + "package-skus-2017-09": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/Skus/stable/2017-09-01/skus.json", + "package-compute-2017-03": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/DiskRP/stable/2017-03-30/disk.json", + "package-compute-2016-04-preview": "2023-12-25 16:40:38 +0800 862e338466eccd19028eceb689b3a23f625a6f0c Microsoft.Compute/ComputeRP/preview/2016-04-30-preview/compute.json", + "package-compute-2016-03": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/ComputeRP/stable/2016-03-30/compute.json", + "package-compute-2015-06": "2022-07-31 21:47:43 -0400 2dcad6d6e9a96882eb6d317e7500a94be007a9c6 Microsoft.Compute/ComputeRP/stable/2015-06-15/compute.json" } \ No newline at end of file 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 49cd123a55f8..3f8b54d12187 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 @@ -1756,7 +1756,6 @@ def snapshots(self): * 2022-03-02: :class:`SnapshotsOperations` * 2022-07-02: :class:`SnapshotsOperations` * 2023-01-02: :class:`SnapshotsOperations` - * 2023-04-02: :class:`SnapshotsOperations` * 2023-10-02: :class:`SnapshotsOperations` """ api_version = self._get_api_version('snapshots') @@ -1796,8 +1795,6 @@ def snapshots(self): from .v2022_07_02.operations import SnapshotsOperations as OperationClass elif api_version == '2023-01-02': from .v2023_01_02.operations import SnapshotsOperations as OperationClass - elif api_version == '2023-04-02': - from .v2023_04_02.operations import SnapshotsOperations as OperationClass elif api_version == '2023-10-02': from .v2023_10_02.operations import SnapshotsOperations as OperationClass else: 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 ad02debf9559..56a2fbe1dfc8 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 @@ -1756,7 +1756,6 @@ def snapshots(self): * 2022-03-02: :class:`SnapshotsOperations` * 2022-07-02: :class:`SnapshotsOperations` * 2023-01-02: :class:`SnapshotsOperations` - * 2023-04-02: :class:`SnapshotsOperations` * 2023-10-02: :class:`SnapshotsOperations` """ api_version = self._get_api_version('snapshots') @@ -1796,8 +1795,6 @@ def snapshots(self): from ..v2022_07_02.aio.operations import SnapshotsOperations as OperationClass elif api_version == '2023-01-02': from ..v2023_01_02.aio.operations import SnapshotsOperations as OperationClass - elif api_version == '2023-04-02': - from ..v2023_04_02.aio.operations import SnapshotsOperations as OperationClass elif api_version == '2023-10-02': from ..v2023_10_02.aio.operations import SnapshotsOperations as OperationClass else: 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_operations.py index 78ec13713707..0f50e6c45b17 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_operations.py @@ -50,7 +50,6 @@ build_images_delete_request, build_images_get_request, build_images_list_by_resource_group_request, - build_images_list_request, build_snapshots_create_or_update_request, build_snapshots_delete_request, build_snapshots_get_request, @@ -4153,86 +4152,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: - """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. - - :return: An iterator like instance of either Image or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.Image] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2016-04-30-preview") - ) - cls: ClsType[_models.ImageListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_images_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - 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) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_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) - class VirtualMachineScaleSetsOperations: # pylint: disable=too-many-public-methods """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_operations.py index 8e8ace59b7be..bf4590b6a67d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_operations.py @@ -1298,30 +1298,6 @@ def build_images_list_by_resource_group_request( # pylint: disable=name-too-lon return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_images_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - def build_virtual_machine_scale_sets_create_or_update_request( # pylint: disable=name-too-long resource_group_name: str, name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: @@ -6656,85 +6632,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Image"]: - """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. - - :return: An iterator like instance of either Image or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.Image] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2016-04-30-preview") - ) - cls: ClsType[_models.ImageListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_images_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - 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) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_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) - class VirtualMachineScaleSetsOperations: # pylint: disable=too-many-public-methods """ 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 99d6c5c9fdaf..e5754a47ce68 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 = "31.0.0" +VERSION = "1.0.0b1" 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 index 99d6c5c9fdaf..e5754a47ce68 100644 --- 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 @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_03/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_03/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_03/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_03/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_09_04/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_09_04/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_09_04/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_09_04/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_11_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_11_01/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_11_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_01_02/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_01_02/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_01_02/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_01_02/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_03_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_03_01/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_03_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/_compute_management_client.py index 480bed24ed42..4b7ccabeb22b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/_compute_management_client.py @@ -22,7 +22,6 @@ DiskEncryptionSetsOperations, DiskRestorePointOperations, DisksOperations, - SnapshotsOperations, ) if TYPE_CHECKING: @@ -43,8 +42,6 @@ class ComputeManagementClient: # pylint: disable=client-accepts-api-version-key :ivar disk_restore_point: DiskRestorePointOperations operations :vartype disk_restore_point: azure.mgmt.compute.v2023_04_02.operations.DiskRestorePointOperations - :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.compute.v2023_04_02.operations.SnapshotsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure @@ -103,9 +100,6 @@ def __init__( self.disk_restore_point = DiskRestorePointOperations( self._client, self._config, self._serialize, self._deserialize, "2023-04-02" ) - self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize, "2023-04-02" - ) def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/_metadata.json index 167d7124f447..27fbab861ac5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/_metadata.json @@ -108,7 +108,6 @@ "disks": "DisksOperations", "disk_accesses": "DiskAccessesOperations", "disk_encryption_sets": "DiskEncryptionSetsOperations", - "disk_restore_point": "DiskRestorePointOperations", - "snapshots": "SnapshotsOperations" + "disk_restore_point": "DiskRestorePointOperations" } } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/aio/_compute_management_client.py index 9d080222f45c..8e54c8bad40b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/aio/_compute_management_client.py @@ -22,7 +22,6 @@ DiskEncryptionSetsOperations, DiskRestorePointOperations, DisksOperations, - SnapshotsOperations, ) if TYPE_CHECKING: @@ -43,8 +42,6 @@ class ComputeManagementClient: # pylint: disable=client-accepts-api-version-key :ivar disk_restore_point: DiskRestorePointOperations operations :vartype disk_restore_point: azure.mgmt.compute.v2023_04_02.aio.operations.DiskRestorePointOperations - :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.compute.v2023_04_02.aio.operations.SnapshotsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure @@ -103,9 +100,6 @@ def __init__( self.disk_restore_point = DiskRestorePointOperations( self._client, self._config, self._serialize, self._deserialize, "2023-04-02" ) - self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize, "2023-04-02" - ) def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/aio/operations/__init__.py index 8ca1cc2598c3..e88e031d26d8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/aio/operations/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/aio/operations/__init__.py @@ -10,7 +10,6 @@ from ._operations import DiskAccessesOperations from ._operations import DiskEncryptionSetsOperations from ._operations import DiskRestorePointOperations -from ._operations import SnapshotsOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -21,7 +20,6 @@ "DiskAccessesOperations", "DiskEncryptionSetsOperations", "DiskRestorePointOperations", - "SnapshotsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/aio/operations/_operations.py index 0ae26d870891..7aae3f80a254 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/aio/operations/_operations.py @@ -62,14 +62,6 @@ build_disks_list_request, build_disks_revoke_access_request, build_disks_update_request, - build_snapshots_create_or_update_request, - build_snapshots_delete_request, - build_snapshots_get_request, - build_snapshots_grant_access_request, - build_snapshots_list_by_resource_group_request, - build_snapshots_list_request, - build_snapshots_revoke_access_request, - build_snapshots_update_request, ) T = TypeVar("T") @@ -3655,1010 +3647,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class SnapshotsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2023_04_02.aio.ComputeManagementClient`'s - :attr:`snapshots` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - async def _create_or_update_initial( - self, resource_group_name: str, snapshot_name: str, snapshot: Union[_models.Snapshot, IO[bytes]], **kwargs: Any - ) -> _models.Snapshot: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(snapshot, (IOBase, bytes)): - _content = snapshot - else: - _json = self._serialize.body(snapshot, "Snapshot") - - _request = build_snapshots_create_or_update_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: _models.Snapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Snapshot]: - """Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Put disk operation. Required. - :type snapshot: ~azure.mgmt.compute.v2023_04_02.models.Snapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Snapshot or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Snapshot]: - """Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Put disk operation. Required. - :type snapshot: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Snapshot or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, resource_group_name: str, snapshot_name: str, snapshot: Union[_models.Snapshot, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Snapshot]: - """Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Put disk operation. Is either a - Snapshot type or a IO[bytes] type. Required. - :type snapshot: ~azure.mgmt.compute.v2023_04_02.models.Snapshot or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Snapshot or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - snapshot=snapshot, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Snapshot", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Snapshot].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Snapshot]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: Union[_models.SnapshotUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.Snapshot: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(snapshot, (IOBase, bytes)): - _content = snapshot - else: - _json = self._serialize.body(snapshot, "SnapshotUpdate") - - _request = build_snapshots_update_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: _models.SnapshotUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Snapshot]: - """Updates (patches) a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. - Required. - :type snapshot: ~azure.mgmt.compute.v2023_04_02.models.SnapshotUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Snapshot or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Snapshot]: - """Updates (patches) a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. - Required. - :type snapshot: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Snapshot or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: Union[_models.SnapshotUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Snapshot]: - """Updates (patches) a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. Is - either a SnapshotUpdate type or a IO[bytes] type. Required. - :type snapshot: ~azure.mgmt.compute.v2023_04_02.models.SnapshotUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Snapshot or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - snapshot=snapshot, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Snapshot", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Snapshot].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Snapshot]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _models.Snapshot: - """Gets information about a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2023_04_02.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - - _request = build_snapshots_get_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Snapshot", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, snapshot_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_snapshots_delete_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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, {}) # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Deletes a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: - """Lists snapshots under a resource group. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[_models.SnapshotList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_snapshots_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SnapshotList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_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) - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: - """Lists snapshots under a subscription. - - :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[_models.SnapshotList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_snapshots_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SnapshotList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_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) - - async def _grant_access_initial( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: Union[_models.GrantAccessData, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.AccessUri]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AccessUri]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(grant_access_data, (IOBase, bytes)): - _content = grant_access_data - else: - _json = self._serialize.body(grant_access_data, "GrantAccessData") - - _request = build_snapshots_grant_access_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AccessUri", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_grant_access( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: _models.GrantAccessData, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessUri]: - """Grants access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. Required. - :type grant_access_data: ~azure.mgmt.compute.v2023_04_02.models.GrantAccessData - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either AccessUri or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2023_04_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_grant_access( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessUri]: - """Grants access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. Required. - :type grant_access_data: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either AccessUri or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2023_04_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_grant_access( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: Union[_models.GrantAccessData, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessUri]: - """Grants access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. Is either a GrantAccessData type or a IO[bytes] type. Required. - :type grant_access_data: ~azure.mgmt.compute.v2023_04_02.models.GrantAccessData or IO[bytes] - :return: An instance of AsyncLROPoller that returns either AccessUri or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2023_04_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessUri] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._grant_access_initial( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - grant_access_data=grant_access_data, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AccessUri", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.AccessUri].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.AccessUri]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _revoke_access_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, snapshot_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_snapshots_revoke_access_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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, {}) # type: ignore - - @distributed_trace_async - async def begin_revoke_access( - self, resource_group_name: str, snapshot_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Revokes access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._revoke_access_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/models/__init__.py index da6dfe3cf02d..23b29bc4c226 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/models/__init__.py @@ -48,10 +48,6 @@ from ._models_py3 import ResourceUriList from ._models_py3 import ResourceWithOptionalLocation from ._models_py3 import ShareInfoElement -from ._models_py3 import Snapshot -from ._models_py3 import SnapshotList -from ._models_py3 import SnapshotSku -from ._models_py3 import SnapshotUpdate from ._models_py3 import SourceVault from ._models_py3 import SubResource from ._models_py3 import SubResourceReadOnly @@ -78,7 +74,6 @@ from ._compute_management_client_enums import PrivateEndpointConnectionProvisioningState from ._compute_management_client_enums import PrivateEndpointServiceConnectionStatus from ._compute_management_client_enums import PublicNetworkAccess -from ._compute_management_client_enums import SnapshotStorageAccountTypes from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk @@ -126,10 +121,6 @@ "ResourceUriList", "ResourceWithOptionalLocation", "ShareInfoElement", - "Snapshot", - "SnapshotList", - "SnapshotSku", - "SnapshotUpdate", "SourceVault", "SubResource", "SubResourceReadOnly", @@ -155,7 +146,6 @@ "PrivateEndpointConnectionProvisioningState", "PrivateEndpointServiceConnectionStatus", "PublicNetworkAccess", - "SnapshotStorageAccountTypes", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/models/_compute_management_client_enums.py index 10d4a44fa9f0..e4a264476eb7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/models/_compute_management_client_enums.py @@ -252,14 +252,3 @@ class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): """You cannot access the underlying data of the disk publicly on the internet even when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate.""" - - -class SnapshotStorageAccountTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The sku name.""" - - STANDARD_LRS = "Standard_LRS" - """Standard HDD locally redundant storage""" - PREMIUM_LRS = "Premium_LRS" - """Premium SSD locally redundant storage""" - STANDARD_ZRS = "Standard_ZRS" - """Standard zone redundant storage""" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/models/_models_py3.py index 8aa04712cad0..8a054ac24177 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/models/_models_py3.py @@ -2551,480 +2551,6 @@ def __init__(self, **kwargs: Any) -> None: self.vm_uri = None -class Snapshot(Resource): # pylint: disable=too-many-instance-attributes - """Snapshot resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar managed_by: Unused. Always Null. - :vartype managed_by: str - :ivar sku: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is - an optional parameter for incremental snapshot and the default behavior is the SKU will be set - to the same sku as the previous snapshot. - :vartype sku: ~azure.mgmt.compute.v2023_04_02.models.SnapshotSku - :ivar extended_location: The extended location where the snapshot will be created. Extended - location cannot be changed. - :vartype extended_location: ~azure.mgmt.compute.v2023_04_02.models.ExtendedLocation - :ivar time_created: The time when the snapshot was created. - :vartype time_created: ~datetime.datetime - :ivar os_type: The Operating System type. Known values are: "Windows" and "Linux". - :vartype os_type: str or ~azure.mgmt.compute.v2023_04_02.models.OperatingSystemTypes - :ivar hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :vartype hyper_v_generation: str or ~azure.mgmt.compute.v2023_04_02.models.HyperVGeneration - :ivar purchase_plan: Purchase plan information for the image from which the source disk for the - snapshot was originally created. - :vartype purchase_plan: ~azure.mgmt.compute.v2023_04_02.models.PurchasePlan - :ivar supported_capabilities: List of supported capabilities for the image from which the - source disk from the snapshot was originally created. - :vartype supported_capabilities: ~azure.mgmt.compute.v2023_04_02.models.SupportedCapabilities - :ivar creation_data: Disk source information. CreationData information cannot be changed after - the disk has been created. - :vartype creation_data: ~azure.mgmt.compute.v2023_04_02.models.CreationData - :ivar disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it - indicates the size of the disk to create. If this field is present for updates or creation with - other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a - running VM, and can only increase the disk's size. - :vartype disk_size_gb: int - :ivar disk_size_bytes: The size of the disk in bytes. This field is read only. - :vartype disk_size_bytes: int - :ivar disk_state: The state of the snapshot. Known values are: "Unattached", "Attached", - "Reserved", "Frozen", "ActiveSAS", "ActiveSASFrozen", "ReadyToUpload", and "ActiveUpload". - :vartype disk_state: str or ~azure.mgmt.compute.v2023_04_02.models.DiskState - :ivar unique_id: Unique Guid identifying the resource. - :vartype unique_id: str - :ivar encryption_settings_collection: Encryption settings collection used be Azure Disk - Encryption, can contain multiple encryption settings per disk or snapshot. - :vartype encryption_settings_collection: - ~azure.mgmt.compute.v2023_04_02.models.EncryptionSettingsCollection - :ivar provisioning_state: The disk provisioning state. - :vartype provisioning_state: str - :ivar incremental: Whether a snapshot is incremental. Incremental snapshots on the same disk - occupy less space than full snapshots and can be diffed. - :vartype incremental: bool - :ivar incremental_snapshot_family_id: Incremental snapshots for a disk share an incremental - snapshot family id. The Get Page Range Diff API can only be called on incremental snapshots - with the same family id. - :vartype incremental_snapshot_family_id: str - :ivar encryption: Encryption property can be used to encrypt data at rest with customer managed - keys or platform managed keys. - :vartype encryption: ~azure.mgmt.compute.v2023_04_02.models.Encryption - :ivar network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :vartype network_access_policy: str or - ~azure.mgmt.compute.v2023_04_02.models.NetworkAccessPolicy - :ivar disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. - :vartype disk_access_id: str - :ivar security_profile: Contains the security related information for the resource. - :vartype security_profile: ~azure.mgmt.compute.v2023_04_02.models.DiskSecurityProfile - :ivar supports_hibernation: Indicates the OS on a snapshot supports hibernation. - :vartype supports_hibernation: bool - :ivar public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.compute.v2023_04_02.models.PublicNetworkAccess - :ivar completion_percent: Percentage complete for the background copy when a resource is - created via the CopyStart operation. - :vartype completion_percent: float - :ivar copy_completion_error: Indicates the error details if the background copy of a resource - created via the CopyStart operation fails. - :vartype copy_completion_error: ~azure.mgmt.compute.v2023_04_02.models.CopyCompletionError - :ivar data_access_auth_mode: Additional authentication requirements when exporting or uploading - to a disk or snapshot. Known values are: "AzureActiveDirectory" and "None". - :vartype data_access_auth_mode: str or - ~azure.mgmt.compute.v2023_04_02.models.DataAccessAuthMode - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "managed_by": {"readonly": True}, - "time_created": {"readonly": True}, - "disk_size_bytes": {"readonly": True}, - "disk_state": {"readonly": True}, - "unique_id": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "incremental_snapshot_family_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}"}, - "managed_by": {"key": "managedBy", "type": "str"}, - "sku": {"key": "sku", "type": "SnapshotSku"}, - "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, - "time_created": {"key": "properties.timeCreated", "type": "iso-8601"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "hyper_v_generation": {"key": "properties.hyperVGeneration", "type": "str"}, - "purchase_plan": {"key": "properties.purchasePlan", "type": "PurchasePlan"}, - "supported_capabilities": {"key": "properties.supportedCapabilities", "type": "SupportedCapabilities"}, - "creation_data": {"key": "properties.creationData", "type": "CreationData"}, - "disk_size_gb": {"key": "properties.diskSizeGB", "type": "int"}, - "disk_size_bytes": {"key": "properties.diskSizeBytes", "type": "int"}, - "disk_state": {"key": "properties.diskState", "type": "str"}, - "unique_id": {"key": "properties.uniqueId", "type": "str"}, - "encryption_settings_collection": { - "key": "properties.encryptionSettingsCollection", - "type": "EncryptionSettingsCollection", - }, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "incremental": {"key": "properties.incremental", "type": "bool"}, - "incremental_snapshot_family_id": {"key": "properties.incrementalSnapshotFamilyId", "type": "str"}, - "encryption": {"key": "properties.encryption", "type": "Encryption"}, - "network_access_policy": {"key": "properties.networkAccessPolicy", "type": "str"}, - "disk_access_id": {"key": "properties.diskAccessId", "type": "str"}, - "security_profile": {"key": "properties.securityProfile", "type": "DiskSecurityProfile"}, - "supports_hibernation": {"key": "properties.supportsHibernation", "type": "bool"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "completion_percent": {"key": "properties.completionPercent", "type": "float"}, - "copy_completion_error": {"key": "properties.copyCompletionError", "type": "CopyCompletionError"}, - "data_access_auth_mode": {"key": "properties.dataAccessAuthMode", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - sku: Optional["_models.SnapshotSku"] = None, - extended_location: Optional["_models.ExtendedLocation"] = None, - os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, - hyper_v_generation: Optional[Union[str, "_models.HyperVGeneration"]] = None, - purchase_plan: Optional["_models.PurchasePlan"] = None, - supported_capabilities: Optional["_models.SupportedCapabilities"] = None, - creation_data: Optional["_models.CreationData"] = None, - disk_size_gb: Optional[int] = None, - encryption_settings_collection: Optional["_models.EncryptionSettingsCollection"] = None, - incremental: Optional[bool] = None, - encryption: Optional["_models.Encryption"] = None, - network_access_policy: Optional[Union[str, "_models.NetworkAccessPolicy"]] = None, - disk_access_id: Optional[str] = None, - security_profile: Optional["_models.DiskSecurityProfile"] = None, - supports_hibernation: Optional[bool] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - completion_percent: Optional[float] = None, - copy_completion_error: Optional["_models.CopyCompletionError"] = None, - data_access_auth_mode: Optional[Union[str, "_models.DataAccessAuthMode"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This - is an optional parameter for incremental snapshot and the default behavior is the SKU will be - set to the same sku as the previous snapshot. - :paramtype sku: ~azure.mgmt.compute.v2023_04_02.models.SnapshotSku - :keyword extended_location: The extended location where the snapshot will be created. Extended - location cannot be changed. - :paramtype extended_location: ~azure.mgmt.compute.v2023_04_02.models.ExtendedLocation - :keyword os_type: The Operating System type. Known values are: "Windows" and "Linux". - :paramtype os_type: str or ~azure.mgmt.compute.v2023_04_02.models.OperatingSystemTypes - :keyword hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :paramtype hyper_v_generation: str or ~azure.mgmt.compute.v2023_04_02.models.HyperVGeneration - :keyword purchase_plan: Purchase plan information for the image from which the source disk for - the snapshot was originally created. - :paramtype purchase_plan: ~azure.mgmt.compute.v2023_04_02.models.PurchasePlan - :keyword supported_capabilities: List of supported capabilities for the image from which the - source disk from the snapshot was originally created. - :paramtype supported_capabilities: ~azure.mgmt.compute.v2023_04_02.models.SupportedCapabilities - :keyword creation_data: Disk source information. CreationData information cannot be changed - after the disk has been created. - :paramtype creation_data: ~azure.mgmt.compute.v2023_04_02.models.CreationData - :keyword disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it - indicates the size of the disk to create. If this field is present for updates or creation with - other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a - running VM, and can only increase the disk's size. - :paramtype disk_size_gb: int - :keyword encryption_settings_collection: Encryption settings collection used be Azure Disk - Encryption, can contain multiple encryption settings per disk or snapshot. - :paramtype encryption_settings_collection: - ~azure.mgmt.compute.v2023_04_02.models.EncryptionSettingsCollection - :keyword incremental: Whether a snapshot is incremental. Incremental snapshots on the same disk - occupy less space than full snapshots and can be diffed. - :paramtype incremental: bool - :keyword encryption: Encryption property can be used to encrypt data at rest with customer - managed keys or platform managed keys. - :paramtype encryption: ~azure.mgmt.compute.v2023_04_02.models.Encryption - :keyword network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :paramtype network_access_policy: str or - ~azure.mgmt.compute.v2023_04_02.models.NetworkAccessPolicy - :keyword disk_access_id: ARM id of the DiskAccess resource for using private endpoints on - disks. - :paramtype disk_access_id: str - :keyword security_profile: Contains the security related information for the resource. - :paramtype security_profile: ~azure.mgmt.compute.v2023_04_02.models.DiskSecurityProfile - :keyword supports_hibernation: Indicates the OS on a snapshot supports hibernation. - :paramtype supports_hibernation: bool - :keyword public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.compute.v2023_04_02.models.PublicNetworkAccess - :keyword completion_percent: Percentage complete for the background copy when a resource is - created via the CopyStart operation. - :paramtype completion_percent: float - :keyword copy_completion_error: Indicates the error details if the background copy of a - resource created via the CopyStart operation fails. - :paramtype copy_completion_error: ~azure.mgmt.compute.v2023_04_02.models.CopyCompletionError - :keyword data_access_auth_mode: Additional authentication requirements when exporting or - uploading to a disk or snapshot. Known values are: "AzureActiveDirectory" and "None". - :paramtype data_access_auth_mode: str or - ~azure.mgmt.compute.v2023_04_02.models.DataAccessAuthMode - """ - super().__init__(location=location, tags=tags, **kwargs) - self.managed_by = None - self.sku = sku - self.extended_location = extended_location - self.time_created = None - self.os_type = os_type - self.hyper_v_generation = hyper_v_generation - self.purchase_plan = purchase_plan - self.supported_capabilities = supported_capabilities - self.creation_data = creation_data - self.disk_size_gb = disk_size_gb - self.disk_size_bytes = None - self.disk_state = None - self.unique_id = None - self.encryption_settings_collection = encryption_settings_collection - self.provisioning_state = None - self.incremental = incremental - self.incremental_snapshot_family_id = None - self.encryption = encryption - self.network_access_policy = network_access_policy - self.disk_access_id = disk_access_id - self.security_profile = security_profile - self.supports_hibernation = supports_hibernation - self.public_network_access = public_network_access - self.completion_percent = completion_percent - self.copy_completion_error = copy_completion_error - self.data_access_auth_mode = data_access_auth_mode - - -class SnapshotList(_serialization.Model): - """The List Snapshots operation response. - - All required parameters must be populated in order to send to server. - - :ivar value: A list of snapshots. Required. - :vartype value: list[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :ivar next_link: The uri to fetch the next page of snapshots. Call ListNext() with this to - fetch the next page of snapshots. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Snapshot]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.Snapshot"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: A list of snapshots. Required. - :paramtype value: list[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :keyword next_link: The uri to fetch the next page of snapshots. Call ListNext() with this to - fetch the next page of snapshots. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SnapshotSku(_serialization.Model): - """The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional - parameter for incremental snapshot and the default behavior is the SKU will be set to the same - sku as the previous snapshot. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The sku name. Known values are: "Standard_LRS", "Premium_LRS", and "Standard_ZRS". - :vartype name: str or ~azure.mgmt.compute.v2023_04_02.models.SnapshotStorageAccountTypes - :ivar tier: The sku tier. - :vartype tier: str - """ - - _validation = { - "tier": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, - } - - def __init__( - self, *, name: Optional[Union[str, "_models.SnapshotStorageAccountTypes"]] = None, **kwargs: Any - ) -> None: - """ - :keyword name: The sku name. Known values are: "Standard_LRS", "Premium_LRS", and - "Standard_ZRS". - :paramtype name: str or ~azure.mgmt.compute.v2023_04_02.models.SnapshotStorageAccountTypes - """ - super().__init__(**kwargs) - self.name = name - self.tier = None - - -class SnapshotUpdate(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Snapshot update resource. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar sku: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is - an optional parameter for incremental snapshot and the default behavior is the SKU will be set - to the same sku as the previous snapshot. - :vartype sku: ~azure.mgmt.compute.v2023_04_02.models.SnapshotSku - :ivar os_type: the Operating System type. Known values are: "Windows" and "Linux". - :vartype os_type: str or ~azure.mgmt.compute.v2023_04_02.models.OperatingSystemTypes - :ivar disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it - indicates the size of the disk to create. If this field is present for updates or creation with - other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a - running VM, and can only increase the disk's size. - :vartype disk_size_gb: int - :ivar encryption_settings_collection: Encryption settings collection used be Azure Disk - Encryption, can contain multiple encryption settings per disk or snapshot. - :vartype encryption_settings_collection: - ~azure.mgmt.compute.v2023_04_02.models.EncryptionSettingsCollection - :ivar encryption: Encryption property can be used to encrypt data at rest with customer managed - keys or platform managed keys. - :vartype encryption: ~azure.mgmt.compute.v2023_04_02.models.Encryption - :ivar network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :vartype network_access_policy: str or - ~azure.mgmt.compute.v2023_04_02.models.NetworkAccessPolicy - :ivar disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. - :vartype disk_access_id: str - :ivar supports_hibernation: Indicates the OS on a snapshot supports hibernation. - :vartype supports_hibernation: bool - :ivar public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.compute.v2023_04_02.models.PublicNetworkAccess - :ivar data_access_auth_mode: Additional authentication requirements when exporting or uploading - to a disk or snapshot. Known values are: "AzureActiveDirectory" and "None". - :vartype data_access_auth_mode: str or - ~azure.mgmt.compute.v2023_04_02.models.DataAccessAuthMode - :ivar supported_capabilities: List of supported capabilities for the image from which the OS - disk was created. - :vartype supported_capabilities: ~azure.mgmt.compute.v2023_04_02.models.SupportedCapabilities - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "SnapshotSku"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "disk_size_gb": {"key": "properties.diskSizeGB", "type": "int"}, - "encryption_settings_collection": { - "key": "properties.encryptionSettingsCollection", - "type": "EncryptionSettingsCollection", - }, - "encryption": {"key": "properties.encryption", "type": "Encryption"}, - "network_access_policy": {"key": "properties.networkAccessPolicy", "type": "str"}, - "disk_access_id": {"key": "properties.diskAccessId", "type": "str"}, - "supports_hibernation": {"key": "properties.supportsHibernation", "type": "bool"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "data_access_auth_mode": {"key": "properties.dataAccessAuthMode", "type": "str"}, - "supported_capabilities": {"key": "properties.supportedCapabilities", "type": "SupportedCapabilities"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["_models.SnapshotSku"] = None, - os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, - disk_size_gb: Optional[int] = None, - encryption_settings_collection: Optional["_models.EncryptionSettingsCollection"] = None, - encryption: Optional["_models.Encryption"] = None, - network_access_policy: Optional[Union[str, "_models.NetworkAccessPolicy"]] = None, - disk_access_id: Optional[str] = None, - supports_hibernation: Optional[bool] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - data_access_auth_mode: Optional[Union[str, "_models.DataAccessAuthMode"]] = None, - supported_capabilities: Optional["_models.SupportedCapabilities"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This - is an optional parameter for incremental snapshot and the default behavior is the SKU will be - set to the same sku as the previous snapshot. - :paramtype sku: ~azure.mgmt.compute.v2023_04_02.models.SnapshotSku - :keyword os_type: the Operating System type. Known values are: "Windows" and "Linux". - :paramtype os_type: str or ~azure.mgmt.compute.v2023_04_02.models.OperatingSystemTypes - :keyword disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it - indicates the size of the disk to create. If this field is present for updates or creation with - other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a - running VM, and can only increase the disk's size. - :paramtype disk_size_gb: int - :keyword encryption_settings_collection: Encryption settings collection used be Azure Disk - Encryption, can contain multiple encryption settings per disk or snapshot. - :paramtype encryption_settings_collection: - ~azure.mgmt.compute.v2023_04_02.models.EncryptionSettingsCollection - :keyword encryption: Encryption property can be used to encrypt data at rest with customer - managed keys or platform managed keys. - :paramtype encryption: ~azure.mgmt.compute.v2023_04_02.models.Encryption - :keyword network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :paramtype network_access_policy: str or - ~azure.mgmt.compute.v2023_04_02.models.NetworkAccessPolicy - :keyword disk_access_id: ARM id of the DiskAccess resource for using private endpoints on - disks. - :paramtype disk_access_id: str - :keyword supports_hibernation: Indicates the OS on a snapshot supports hibernation. - :paramtype supports_hibernation: bool - :keyword public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.compute.v2023_04_02.models.PublicNetworkAccess - :keyword data_access_auth_mode: Additional authentication requirements when exporting or - uploading to a disk or snapshot. Known values are: "AzureActiveDirectory" and "None". - :paramtype data_access_auth_mode: str or - ~azure.mgmt.compute.v2023_04_02.models.DataAccessAuthMode - :keyword supported_capabilities: List of supported capabilities for the image from which the OS - disk was created. - :paramtype supported_capabilities: ~azure.mgmt.compute.v2023_04_02.models.SupportedCapabilities - """ - super().__init__(**kwargs) - self.tags = tags - self.sku = sku - self.os_type = os_type - self.disk_size_gb = disk_size_gb - self.encryption_settings_collection = encryption_settings_collection - self.encryption = encryption - self.network_access_policy = network_access_policy - self.disk_access_id = disk_access_id - self.supports_hibernation = supports_hibernation - self.public_network_access = public_network_access - self.data_access_auth_mode = data_access_auth_mode - self.supported_capabilities = supported_capabilities - - class SourceVault(_serialization.Model): """The vault id is an Azure Resource Manager Resource id in the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/operations/__init__.py index 8ca1cc2598c3..e88e031d26d8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/operations/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/operations/__init__.py @@ -10,7 +10,6 @@ from ._operations import DiskAccessesOperations from ._operations import DiskEncryptionSetsOperations from ._operations import DiskRestorePointOperations -from ._operations import SnapshotsOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -21,7 +20,6 @@ "DiskAccessesOperations", "DiskEncryptionSetsOperations", "DiskRestorePointOperations", - "SnapshotsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/operations/_operations.py index 492cfbf5ca13..d77852c97309 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_04_02/operations/_operations.py @@ -1015,243 +1015,6 @@ def build_disk_restore_point_revoke_access_request( # pylint: disable=name-too- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_snapshots_create_or_update_request( - resource_group_name: str, snapshot_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_snapshots_update_request( - resource_group_name: str, snapshot_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_snapshots_get_request( - resource_group_name: str, snapshot_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-02")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_snapshots_delete_request( - resource_group_name: str, snapshot_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-02")) - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_snapshots_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-02")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_snapshots_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-02")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_snapshots_grant_access_request( - resource_group_name: str, snapshot_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_snapshots_revoke_access_request( - resource_group_name: str, snapshot_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-02")) - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - class DisksOperations: """ .. warning:: @@ -4798,997 +4561,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class SnapshotsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2023_04_02.ComputeManagementClient`'s - :attr:`snapshots` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - def _create_or_update_initial( - self, resource_group_name: str, snapshot_name: str, snapshot: Union[_models.Snapshot, IO[bytes]], **kwargs: Any - ) -> _models.Snapshot: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(snapshot, (IOBase, bytes)): - _content = snapshot - else: - _json = self._serialize.body(snapshot, "Snapshot") - - _request = build_snapshots_create_or_update_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: _models.Snapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Put disk operation. Required. - :type snapshot: ~azure.mgmt.compute.v2023_04_02.models.Snapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Put disk operation. Required. - :type snapshot: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, resource_group_name: str, snapshot_name: str, snapshot: Union[_models.Snapshot, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Put disk operation. Is either a - Snapshot type or a IO[bytes] type. Required. - :type snapshot: ~azure.mgmt.compute.v2023_04_02.models.Snapshot or IO[bytes] - :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - snapshot=snapshot, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Snapshot", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Snapshot].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Snapshot]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: Union[_models.SnapshotUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.Snapshot: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(snapshot, (IOBase, bytes)): - _content = snapshot - else: - _json = self._serialize.body(snapshot, "SnapshotUpdate") - - _request = build_snapshots_update_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: _models.SnapshotUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Updates (patches) a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. - Required. - :type snapshot: ~azure.mgmt.compute.v2023_04_02.models.SnapshotUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Updates (patches) a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. - Required. - :type snapshot: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: Union[_models.SnapshotUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Updates (patches) a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. Is - either a SnapshotUpdate type or a IO[bytes] type. Required. - :type snapshot: ~azure.mgmt.compute.v2023_04_02.models.SnapshotUpdate or IO[bytes] - :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - snapshot=snapshot, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Snapshot", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Snapshot].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Snapshot]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _models.Snapshot: - """Gets information about a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2023_04_02.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - - _request = build_snapshots_get_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Snapshot", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, snapshot_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_snapshots_delete_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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, {}) # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :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: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Snapshot"]: - """Lists snapshots under a resource group. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[_models.SnapshotList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_snapshots_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SnapshotList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_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) - - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: - """Lists snapshots under a subscription. - - :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2023_04_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[_models.SnapshotList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_snapshots_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SnapshotList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_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) - - def _grant_access_initial( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: Union[_models.GrantAccessData, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.AccessUri]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AccessUri]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(grant_access_data, (IOBase, bytes)): - _content = grant_access_data - else: - _json = self._serialize.body(grant_access_data, "GrantAccessData") - - _request = build_snapshots_grant_access_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AccessUri", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_grant_access( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: _models.GrantAccessData, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AccessUri]: - """Grants access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. Required. - :type grant_access_data: ~azure.mgmt.compute.v2023_04_02.models.GrantAccessData - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2023_04_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_grant_access( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AccessUri]: - """Grants access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. Required. - :type grant_access_data: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2023_04_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_grant_access( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: Union[_models.GrantAccessData, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.AccessUri]: - """Grants access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. Is either a GrantAccessData type or a IO[bytes] type. Required. - :type grant_access_data: ~azure.mgmt.compute.v2023_04_02.models.GrantAccessData or IO[bytes] - :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2023_04_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessUri] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._grant_access_initial( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - grant_access_data=grant_access_data, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AccessUri", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.AccessUri].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.AccessUri]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _revoke_access_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, snapshot_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_snapshots_revoke_access_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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, {}) # type: ignore - - @distributed_trace - def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> LROPoller[None]: - """Revokes access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :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: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-02")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._revoke_access_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_07_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_07_01/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_07_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_07_03/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_07_03/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_07_03/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_07_03/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_09_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_09_01/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_09_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_10_02/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_10_02/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_10_02/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2023_10_02/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2024_03_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2024_03_01/_version.py index 99d6c5c9fdaf..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2024_03_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2024_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "31.0.0" +VERSION = "1.0.0b1"