diff --git a/sdk/netapp/azure-mgmt-netapp/_meta.json b/sdk/netapp/azure-mgmt-netapp/_meta.json index a1aa105d0c05..e134f8276f96 100644 --- a/sdk/netapp/azure-mgmt-netapp/_meta.json +++ b/sdk/netapp/azure-mgmt-netapp/_meta.json @@ -1,11 +1,11 @@ { - "commit": "2dc0129e1e3f5dfb6c86195aae57fc19e7c72e01", + "commit": "6d38dec057bde1ae17494ec59a9437d82206db95", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.7", + "autorest": "3.10.2", "use": [ - "@autorest/python@6.13.7", + "@autorest/python@6.13.16", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/netapp/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", + "autorest_command": "autorest specification/netapp/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.16 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/netapp/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py index 8db5ffe9bc4f..f77e3a43f775 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py @@ -28,13 +28,13 @@ class NetAppManagementClientConfiguration: # pylint: disable=too-many-instance- :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-11-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-11-01-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2023-11-01") + api_version: str = kwargs.pop("api_version", "2023-11-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_net_app_management_client.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_net_app_management_client.py index 8a1ed18753e5..1a372274fd09 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_net_app_management_client.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_net_app_management_client.py @@ -91,8 +91,8 @@ class NetAppManagementClient: # pylint: disable=client-accepts-api-version-keyw :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-11-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-11-01-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_patch.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_patch.py index f99e77fef986..17dbc073e01b 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_patch.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_patch.py @@ -25,6 +25,7 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py index fa8e008c199f..e786ca9d2565 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "13.0.0" +VERSION = "5.1.0" diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py index d8ccabc4571e..48fe3c10ab1b 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py @@ -28,13 +28,13 @@ class NetAppManagementClientConfiguration: # pylint: disable=too-many-instance- :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-11-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-11-01-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2023-11-01") + api_version: str = kwargs.pop("api_version", "2023-11-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_net_app_management_client.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_net_app_management_client.py index 3f4826a58e77..f781babe5b14 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_net_app_management_client.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_net_app_management_client.py @@ -91,8 +91,8 @@ class NetAppManagementClient: # pylint: disable=client-accepts-api-version-keyw :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-11-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-11-01-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_patch.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_patch.py index f99e77fef986..17dbc073e01b 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_patch.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_patch.py @@ -25,6 +25,7 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py index 371bbfe1111f..40a789aaa698 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -32,15 +33,22 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._accounts_operations import ( + build_change_key_vault_request, build_create_or_update_request, build_delete_request, + build_get_change_key_vault_information_request, build_get_request, build_list_by_subscription_request, build_list_request, + build_migrate_encryption_key_request, build_renew_credentials_request, build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +88,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.NetAppAc api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NetAppAccountList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +170,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NetAppAccountList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -241,7 +249,7 @@ async def get(self, resource_group_name: str, account_name: str, **kwargs: Any) :rtype: ~azure.mgmt.netapp.models.NetAppAccount :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -288,7 +296,7 @@ async def get(self, resource_group_name: str, account_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, account_name: str, body: Union[_models.NetAppAccount, IO[bytes]], **kwargs: Any ) -> _models.NetAppAccount: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -481,7 +489,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -584,7 +592,7 @@ async def _update_initial( body: Union[_models.NetAppAccountPatch, IO[bytes]], **kwargs: Any ) -> _models.NetAppAccount: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -780,7 +788,7 @@ def get_long_running_output(pipeline_response): async def _renew_credentials_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -880,3 +888,500 @@ 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 + + async def _migrate_encryption_key_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + account_name: str, + body: Optional[Union[_models.EncryptionMigrationRequest, IO[bytes]]] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "EncryptionMigrationRequest") + else: + _json = None + + _request = build_migrate_encryption_key_request( + resource_group_name=resource_group_name, + account_name=account_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 [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_migrate_encryption_key( + self, + resource_group_name: str, + account_name: str, + body: Optional[_models.EncryptionMigrationRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Migrate volumes encryption key source. + + Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or + Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes + from another account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param body: The required parameters to perform encryption migration. Default value is None. + :type body: ~azure.mgmt.netapp.models.EncryptionMigrationRequest + :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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_migrate_encryption_key( + self, + resource_group_name: str, + account_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Migrate volumes encryption key source. + + Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or + Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes + from another account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param body: The required parameters to perform encryption migration. Default value is None. + :type body: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_migrate_encryption_key( + self, + resource_group_name: str, + account_name: str, + body: Optional[Union[_models.EncryptionMigrationRequest, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Migrate volumes encryption key source. + + Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or + Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes + from another account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param body: The required parameters to perform encryption migration. Is either a + EncryptionMigrationRequest type or a IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.netapp.models.EncryptionMigrationRequest or IO[bytes] + :return: An 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 = 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._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + 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._migrate_encryption_key_initial( # type: ignore + resource_group_name=resource_group_name, + account_name=account_name, + body=body, + 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): # 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 + + async def _get_change_key_vault_information_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, resource_group_name: str, account_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_get_change_key_vault_information_request( + resource_group_name=resource_group_name, + account_name=account_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 [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_get_change_key_vault_information( + self, resource_group_name: str, account_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Get information about how volumes under NetApp account are encrypted. + + Contains data from encryption.keyVaultProperties as well as information about which private + endpoint is used by each encryption sibling set. Response from this endpoint can be modified + and used as request body for POST request. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_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._config.api_version)) + 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._get_change_key_vault_information_initial( # type: ignore + resource_group_name=resource_group_name, + account_name=account_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 + + async def _change_key_vault_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + account_name: str, + body: Optional[Union[_models.ChangeKeyVault, IO[bytes]]] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "ChangeKeyVault") + else: + _json = None + + _request = build_change_key_vault_request( + resource_group_name=resource_group_name, + account_name=account_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 [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_change_key_vault( + self, + resource_group_name: str, + account_name: str, + body: Optional[_models.ChangeKeyVault] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Change Key Vault/Managed HSM that is used for encryption of volumes under NetApp account. + + Affects existing volumes that are encrypted with Key Vault/Managed HSM, and new volumes. + Supports MHSM to Key Vault, Key Vault to MHSM, MHSM to MHSM and Key Vault to Key Vault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param body: The required parameters to perform encryption migration. Default value is None. + :type body: ~azure.mgmt.netapp.models.ChangeKeyVault + :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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_change_key_vault( + self, + resource_group_name: str, + account_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Change Key Vault/Managed HSM that is used for encryption of volumes under NetApp account. + + Affects existing volumes that are encrypted with Key Vault/Managed HSM, and new volumes. + Supports MHSM to Key Vault, Key Vault to MHSM, MHSM to MHSM and Key Vault to Key Vault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param body: The required parameters to perform encryption migration. Default value is None. + :type body: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_change_key_vault( + self, + resource_group_name: str, + account_name: str, + body: Optional[Union[_models.ChangeKeyVault, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Change Key Vault/Managed HSM that is used for encryption of volumes under NetApp account. + + Affects existing volumes that are encrypted with Key Vault/Managed HSM, and new volumes. + Supports MHSM to Key Vault, Key Vault to MHSM, MHSM to MHSM and Key Vault to Key Vault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param body: The required parameters to perform encryption migration. Is either a + ChangeKeyVault type or a IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.netapp.models.ChangeKeyVault or IO[bytes] + :return: An 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 = 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._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + 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._change_key_vault_initial( # type: ignore + resource_group_name=resource_group_name, + account_name=account_name, + body=body, + 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): # 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/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_operations.py index 4706e9d249cf..2a0d41349200 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> As api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BackupPoliciesList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.netapp.models.BackupPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_initial( body: Union[_models.BackupPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.BackupPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -434,7 +439,7 @@ async def _update_initial( body: Union[_models.BackupPolicyPatch, IO[bytes]], **kwargs: Any ) -> _models.BackupPolicy: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -642,7 +647,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_vaults_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_vaults_operations.py index 61612cfe10d4..d841db1a5afd 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_vaults_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_vaults_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_net_app_account( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BackupVaultsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ async def get( :rtype: ~azure.mgmt.netapp.models.BackupVault :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def _create_or_update_initial( body: Union[_models.BackupVault, IO[bytes]], **kwargs: Any ) -> _models.BackupVault: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +440,7 @@ async def _update_initial( body: Union[_models.BackupVaultPatch, IO[bytes]], **kwargs: Any ) -> _models.BackupVault: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -645,7 +650,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py index 2397449d7e93..f46fa9abbb59 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ async def get_latest_status( :rtype: ~azure.mgmt.netapp.models.BackupStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -152,7 +157,7 @@ async def get_volume_latest_restore_status( :rtype: ~azure.mgmt.netapp.models.RestoreStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -231,7 +236,7 @@ def list_by_vault( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BackupsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -319,7 +324,7 @@ async def get( :rtype: ~azure.mgmt.netapp.models.Backup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -374,7 +379,7 @@ async def _create_initial( body: Union[_models.Backup, IO[bytes]], **kwargs: Any ) -> _models.Backup: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -599,7 +604,7 @@ async def _update_initial( body: Optional[Union[_models.BackupPatch, IO[bytes]]] = None, **kwargs: Any ) -> _models.Backup: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -823,7 +828,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_under_account_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_under_account_operations.py index c7ef4668801b..06ee3726030f 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_under_account_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_under_account_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._backups_under_account_operations import build_migrate_backups_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,7 +65,7 @@ async def _migrate_backups_initial( # pylint: disable=inconsistent-return-state body: Union[_models.BackupsMigrationRequest, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_under_backup_vault_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_under_backup_vault_operations.py index 8f614b86d4b0..48edca1de576 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_under_backup_vault_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_under_backup_vault_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._backups_under_backup_vault_operations import build_restore_files_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,7 +67,7 @@ async def _restore_files_initial( # pylint: disable=inconsistent-return-stateme body: Union[_models.BackupRestoreFiles, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_under_volume_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_under_volume_operations.py index 90d9430c84ea..17993be12add 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_under_volume_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_under_volume_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._backups_under_volume_operations import build_migrate_backups_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,7 +67,7 @@ async def _migrate_backups_initial( # pylint: disable=inconsistent-return-state body: Union[_models.BackupsMigrationRequest, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_operations.py index cb774bb8e6fb..75fb2893499e 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -36,6 +37,10 @@ build_update_network_sibling_set_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.netapp.models.CheckAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +143,7 @@ async def check_name_availability( @distributed_trace_async async def check_file_path_availability( - self, location: str, name: str, subnet_id: str, **kwargs: Any + self, location: str, name: str, subnet_id: str, availability_zone: Optional[str] = None, **kwargs: Any ) -> _models.CheckAvailabilityResponse: """Check file path availability. @@ -151,11 +156,15 @@ async def check_file_path_availability( :param subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Required. :type subnet_id: str + :param availability_zone: The Azure Resource logical availability zone which is used within + zone mapping lookup for the subscription and region. The lookup will retrieve the physical zone + where volume is placed. Default value is None. + :type availability_zone: str :return: CheckAvailabilityResponse or the result of cls(response) :rtype: ~azure.mgmt.netapp.models.CheckAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +179,7 @@ async def check_file_path_availability( content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.CheckAvailabilityResponse] = kwargs.pop("cls", None) - _body = _models.FilePathAvailabilityRequest(name=name, subnet_id=subnet_id) + _body = _models.FilePathAvailabilityRequest(availability_zone=availability_zone, name=name, subnet_id=subnet_id) _json = self._serialize.body(_body, "FilePathAvailabilityRequest") _request = build_check_file_path_availability_request( @@ -232,7 +241,7 @@ async def check_quota_availability( :rtype: ~azure.mgmt.netapp.models.CheckAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -293,7 +302,7 @@ async def query_region_info(self, location: str, **kwargs: Any) -> _models.Regio :rtype: ~azure.mgmt.netapp.models.RegionInfo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -358,7 +367,7 @@ async def query_network_sibling_set( :rtype: ~azure.mgmt.netapp.models.NetworkSiblingSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +427,7 @@ async def _update_network_sibling_set_initial( network_features: Union[str, _models.NetworkFeatures] = "Basic", **kwargs: Any ) -> Optional[_models.NetworkSiblingSet]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_quota_limits_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_quota_limits_operations.py index 155462bd632d..22f2a7df50ca 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_quota_limits_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_quota_limits_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._net_app_resource_quota_limits_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,7 +78,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Subscript api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SubscriptionQuotaItemList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -151,7 +156,7 @@ async def get(self, location: str, quota_limit_name: str, **kwargs: Any) -> _mod :rtype: ~azure.mgmt.netapp.models.SubscriptionQuotaItem :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_region_infos_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_region_infos_operations.py index 3711b5056a3a..a9c61eaba1b8 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_region_infos_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_region_infos_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._net_app_resource_region_infos_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RegionInf api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RegionInfosList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -147,7 +152,7 @@ async def get(self, location: str, **kwargs: Any) -> _models.RegionInfoResource: :rtype: ~azure.mgmt.netapp.models.RegionInfoResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py index 45202129b692..6d3781205601 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_pools_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_pools_operations.py index 423d0b821bda..10163300562e 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_pools_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> As api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CapacityPoolList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.netapp.models.CapacityPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( body: Union[_models.CapacityPool, IO[bytes]], **kwargs: Any ) -> _models.CapacityPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -432,7 +437,7 @@ async def _update_initial( body: Union[_models.CapacityPoolPatch, IO[bytes]], **kwargs: Any ) -> Optional[_models.CapacityPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -637,7 +642,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshot_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshot_policies_operations.py index 6a4b1e56fd00..2c9666e46463 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshot_policies_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshot_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SnapshotPoliciesList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -296,7 +301,7 @@ async def create( :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -365,7 +370,7 @@ async def _update_initial( body: Union[_models.SnapshotPolicyPatch, IO[bytes]], **kwargs: Any ) -> _models.SnapshotPolicy: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -566,7 +571,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -685,7 +690,7 @@ async def list_volumes( :rtype: ~azure.mgmt.netapp.models.SnapshotPolicyVolumeList :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshots_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshots_operations.py index 4a0a5dad53bc..3b50269b252a 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshots_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshots_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -96,7 +96,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SnapshotsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -192,7 +192,7 @@ async def get( :rtype: ~azure.mgmt.netapp.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -249,7 +249,7 @@ async def _create_initial( body: Union[_models.Snapshot, IO[bytes]], **kwargs: Any ) -> Optional[_models.Snapshot]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -483,7 +483,7 @@ async def _update_initial( body: JSON, **kwargs: Any ) -> Optional[_models.Snapshot]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -630,7 +630,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements snapshot_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -756,7 +756,7 @@ async def _restore_files_initial( # pylint: disable=inconsistent-return-stateme body: Union[_models.SnapshotRestoreFiles, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_subvolumes_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_subvolumes_operations.py index a76af312125d..2cb9a6fa7a0a 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_subvolumes_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_subvolumes_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list_by_volume( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SubvolumesList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -186,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.netapp.models.SubvolumeInfo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def _create_initial( body: Union[_models.SubvolumeInfo, IO[bytes]], **kwargs: Any ) -> Optional[_models.SubvolumeInfo]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -481,7 +486,7 @@ async def _update_initial( body: Union[_models.SubvolumePatchRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.SubvolumeInfo]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -715,7 +720,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements subvolume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -841,7 +846,7 @@ async def _get_metadata_initial( subvolume_name: str, **kwargs: Any ) -> Optional[_models.SubvolumeModel]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_groups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_groups_operations.py index f3f648d5df60..9f3f95efaacc 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_groups_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_by_net_app_account_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list_by_net_app_account( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VolumeGroupList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.netapp.models.VolumeGroupDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +226,7 @@ async def _create_initial( body: Union[_models.VolumeGroupDetails, IO[bytes]], **kwargs: Any ) -> _models.VolumeGroupDetails: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -428,7 +433,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, volume_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_quota_rules_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_quota_rules_operations.py index 7d0c34f85148..68917e8d5881 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_quota_rules_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_quota_rules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ def list_by_volume( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VolumeQuotaRulesList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +190,7 @@ async def get( :rtype: ~azure.mgmt.netapp.models.VolumeQuotaRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -242,7 +247,7 @@ async def _create_initial( body: Union[_models.VolumeQuotaRule, IO[bytes]], **kwargs: Any ) -> _models.VolumeQuotaRule: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +483,7 @@ async def _update_initial( body: Union[_models.VolumeQuotaRulePatch, IO[bytes]], **kwargs: Any ) -> Optional[_models.VolumeQuotaRule]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -711,7 +716,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements volume_quota_rule_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volumes_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volumes_operations.py index f8554d5ba0a9..fbc44f27f6eb 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volumes_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volumes_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,14 +36,18 @@ build_authorize_replication_request, build_break_file_locks_request, build_break_replication_request, + build_create_on_prem_migration_replication_request, build_create_or_update_request, build_delete_replication_request, build_delete_request, + build_finalize_on_prem_migration_request, build_finalize_relocation_request, build_get_request, build_list_get_group_id_list_for_ldap_user_request, build_list_replications_request, build_list_request, + build_peer_cluster_for_on_prem_migration_request, + build_perform_replication_transfer_request, build_pool_change_request, build_populate_availability_zone_request, build_re_initialize_replication_request, @@ -53,9 +58,14 @@ build_resync_replication_request, build_revert_relocation_request, build_revert_request, + build_split_clone_from_parent_request, build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -104,7 +114,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VolumeList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -191,7 +201,7 @@ async def get( :rtype: ~azure.mgmt.netapp.models.Volume :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -246,7 +256,7 @@ async def _create_or_update_initial( body: Union[_models.Volume, IO[bytes]], **kwargs: Any ) -> Optional[_models.Volume]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +482,7 @@ async def _update_initial( body: Union[_models.VolumePatch, IO[bytes]], **kwargs: Any ) -> Optional[_models.Volume]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -694,7 +704,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements force_delete: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -814,7 +824,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _populate_availability_zone_initial( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> Optional[_models.Volume]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -944,7 +954,7 @@ async def _revert_initial( # pylint: disable=inconsistent-return-statements body: Union[_models.VolumeRevert, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1157,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _reset_cifs_password_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1254,6 +1264,118 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + async def _split_clone_from_parent_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_split_clone_from_parent_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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 [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_split_clone_from_parent( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Split clone from parent volume. + + Split operation to convert clone volume to an independent volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_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._config.api_version)) + 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._split_clone_from_parent_initial( # type: ignore + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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 + async def _break_file_locks_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, @@ -1263,7 +1385,7 @@ async def _break_file_locks_initial( # pylint: disable=inconsistent-return-stat body: Optional[Union[_models.BreakFileLocksRequest, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1481,7 +1603,7 @@ async def _list_get_group_id_list_for_ldap_user_initial( # pylint: disable=name body: Union[_models.GetGroupIdListForLDAPUserRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.GetGroupIdListForLDAPUserResponse]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1710,7 +1832,7 @@ async def _break_replication_initial( # pylint: disable=inconsistent-return-sta body: Optional[Union[_models.BreakReplicationRequest, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1922,7 +2044,7 @@ async def _reestablish_replication_initial( # pylint: disable=inconsistent-retu body: Union[_models.ReestablishReplicationRequest, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2146,7 +2268,7 @@ async def replication_status( :rtype: ~azure.mgmt.netapp.models.ReplicationStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2219,7 +2341,7 @@ def list_replications( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ListReplications] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2289,7 +2411,7 @@ async def get_next(next_link=None): async def _resync_replication_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2399,7 +2521,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_replication_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2515,7 +2637,7 @@ async def _authorize_replication_initial( # pylint: disable=inconsistent-return body: Union[_models.AuthorizeRequest, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2718,7 +2840,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _re_initialize_replication_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2824,6 +2946,585 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + async def _peer_cluster_for_on_prem_migration_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Union[_models.PeerClusterForVolumeMigrationRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ClusterPeerCommandResponse]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ClusterPeerCommandResponse]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "PeerClusterForVolumeMigrationRequest") + + _request = build_peer_cluster_for_on_prem_migration_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ClusterPeerCommandResponse", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_peer_cluster_for_on_prem_migration( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: _models.PeerClusterForVolumeMigrationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ClusterPeerCommandResponse]: + """Start Cluster peering. + + Starts peering the cluster for this migration volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Cluster peer request object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.PeerClusterForVolumeMigrationRequest + :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 ClusterPeerCommandResponse or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_peer_cluster_for_on_prem_migration( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ClusterPeerCommandResponse]: + """Start Cluster peering. + + Starts peering the cluster for this migration volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Cluster peer request object supplied in the body of the operation. Required. + :type body: 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 ClusterPeerCommandResponse or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_peer_cluster_for_on_prem_migration( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Union[_models.PeerClusterForVolumeMigrationRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ClusterPeerCommandResponse]: + """Start Cluster peering. + + Starts peering the cluster for this migration volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Cluster peer request object supplied in the body of the operation. Is either a + PeerClusterForVolumeMigrationRequest type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.PeerClusterForVolumeMigrationRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ClusterPeerCommandResponse or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] + :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._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterPeerCommandResponse] = 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._peer_cluster_for_on_prem_migration_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + body=body, + 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("ClusterPeerCommandResponse", 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.ClusterPeerCommandResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ClusterPeerCommandResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _create_on_prem_migration_replication_initial( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> Optional[_models.SvmPeerCommandResponse]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + cls: ClsType[Optional[_models.SvmPeerCommandResponse]] = kwargs.pop("cls", None) + + _request = build_create_on_prem_migration_replication_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("SvmPeerCommandResponse", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_create_on_prem_migration_replication( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.SvmPeerCommandResponse]: + """Start migration process. + + Starts SVM peering and returns a command to be run on the external ONTAP to accept it. Once + the SVMs have been peered a SnapMirror will be created. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: An instance of AsyncLROPoller that returns either SvmPeerCommandResponse or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.SvmPeerCommandResponse] + :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._config.api_version)) + cls: ClsType[_models.SvmPeerCommandResponse] = 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_on_prem_migration_replication_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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): + deserialized = self._deserialize("SvmPeerCommandResponse", 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.SvmPeerCommandResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SvmPeerCommandResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _finalize_on_prem_migration_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_finalize_on_prem_migration_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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 [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_finalize_on_prem_migration( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Finalize migration process. + + Finalizes the migration of a volume by performing a final sync on the replication, breaking and + releasing the replication, and breaking the cluster peering if no other migration is active. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_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._config.api_version)) + 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._finalize_on_prem_migration_initial( # type: ignore + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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 + + async def _perform_replication_transfer_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_perform_replication_transfer_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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 [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_perform_replication_transfer( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Perform a replication transfer. + + Performs an adhoc replication transfer on a volume with volumeType Migration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_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._config.api_version)) + 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._perform_replication_transfer_initial( # type: ignore + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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 + async def _pool_change_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, @@ -2833,7 +3534,7 @@ async def _pool_change_initial( # pylint: disable=inconsistent-return-statement body: Union[_models.PoolChangeRequest, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3042,7 +3743,7 @@ async def _relocate_initial( # pylint: disable=inconsistent-return-statements body: Optional[Union[_models.RelocateVolumeRequest, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3246,7 +3947,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _finalize_relocation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3353,7 +4054,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _revert_relocation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py index 423cb6d0c3ed..d5fc4ba8e08f 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py @@ -26,11 +26,14 @@ from ._models_py3 import CapacityPool from ._models_py3 import CapacityPoolList from ._models_py3 import CapacityPoolPatch +from ._models_py3 import ChangeKeyVault from ._models_py3 import CheckAvailabilityResponse from ._models_py3 import CloudErrorBody +from ._models_py3 import ClusterPeerCommandResponse from ._models_py3 import DailySchedule from ._models_py3 import Dimension from ._models_py3 import EncryptionIdentity +from ._models_py3 import EncryptionMigrationRequest from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse @@ -39,6 +42,7 @@ from ._models_py3 import GetGroupIdListForLDAPUserRequest from ._models_py3 import GetGroupIdListForLDAPUserResponse from ._models_py3 import HourlySchedule +from ._models_py3 import KeyVaultPrivateEndpoint from ._models_py3 import KeyVaultProperties from ._models_py3 import LdapSearchScopeOpt from ._models_py3 import ListReplications @@ -56,6 +60,7 @@ from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult +from ._models_py3 import PeerClusterForVolumeMigrationRequest from ._models_py3 import PlacementKeyValuePairs from ._models_py3 import PoolChangeRequest from ._models_py3 import ProxyResource @@ -67,6 +72,7 @@ from ._models_py3 import RegionInfoResource from ._models_py3 import RegionInfosList from ._models_py3 import RelocateVolumeRequest +from ._models_py3 import RemotePath from ._models_py3 import Replication from ._models_py3 import ReplicationObject from ._models_py3 import ReplicationStatus @@ -89,6 +95,7 @@ from ._models_py3 import SubvolumeModel from ._models_py3 import SubvolumePatchRequest from ._models_py3 import SubvolumesList +from ._models_py3 import SvmPeerCommandResponse from ._models_py3 import SystemData from ._models_py3 import TrackedResource from ._models_py3 import UpdateNetworkSiblingSetRequest @@ -115,6 +122,7 @@ from ._models_py3 import VolumeSnapshotProperties from ._models_py3 import WeeklySchedule +from ._net_app_management_client_enums import AcceptGrowCapacityPoolForShortTermCloneSplit from ._net_app_management_client_enums import ActiveDirectoryStatus from ._net_app_management_client_enums import ApplicationType from ._net_app_management_client_enums import AvsDataStore @@ -147,6 +155,7 @@ from ._net_app_management_client_enums import SmbAccessBasedEnumeration from ._net_app_management_client_enums import SmbNonBrowsable from ._net_app_management_client_enums import Type +from ._net_app_management_client_enums import VolumeLanguage from ._net_app_management_client_enums import VolumeStorageToNetworkProximity from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -173,11 +182,14 @@ "CapacityPool", "CapacityPoolList", "CapacityPoolPatch", + "ChangeKeyVault", "CheckAvailabilityResponse", "CloudErrorBody", + "ClusterPeerCommandResponse", "DailySchedule", "Dimension", "EncryptionIdentity", + "EncryptionMigrationRequest", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", @@ -186,6 +198,7 @@ "GetGroupIdListForLDAPUserRequest", "GetGroupIdListForLDAPUserResponse", "HourlySchedule", + "KeyVaultPrivateEndpoint", "KeyVaultProperties", "LdapSearchScopeOpt", "ListReplications", @@ -203,6 +216,7 @@ "Operation", "OperationDisplay", "OperationListResult", + "PeerClusterForVolumeMigrationRequest", "PlacementKeyValuePairs", "PoolChangeRequest", "ProxyResource", @@ -214,6 +228,7 @@ "RegionInfoResource", "RegionInfosList", "RelocateVolumeRequest", + "RemotePath", "Replication", "ReplicationObject", "ReplicationStatus", @@ -236,6 +251,7 @@ "SubvolumeModel", "SubvolumePatchRequest", "SubvolumesList", + "SvmPeerCommandResponse", "SystemData", "TrackedResource", "UpdateNetworkSiblingSetRequest", @@ -261,6 +277,7 @@ "VolumeRevert", "VolumeSnapshotProperties", "WeeklySchedule", + "AcceptGrowCapacityPoolForShortTermCloneSplit", "ActiveDirectoryStatus", "ApplicationType", "AvsDataStore", @@ -293,6 +310,7 @@ "SmbAccessBasedEnumeration", "SmbNonBrowsable", "Type", + "VolumeLanguage", "VolumeStorageToNetworkProximity", ] __all__.extend([p for p in _patch_all if p not in __all__]) diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py index 0a0fe018badd..7f4b463bf7c2 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py @@ -1300,7 +1300,7 @@ class CapacityPoolPatch(_serialization.Model): :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar size: Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value - must be multiply of 1099511627776). + must be multiply of 4398046511104). :vartype size: int :ivar qos_type: The qos type of the pool. Known values are: "Auto" and "Manual". :vartype qos_type: str or ~azure.mgmt.netapp.models.QosType @@ -1341,7 +1341,7 @@ def __init__( :keyword tags: Resource tags. :paramtype tags: dict[str, str] :keyword size: Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks - (value must be multiply of 1099511627776). + (value must be multiply of 4398046511104). :paramtype size: int :keyword qos_type: The qos type of the pool. Known values are: "Auto" and "Manual". :paramtype qos_type: str or ~azure.mgmt.netapp.models.QosType @@ -1359,6 +1359,69 @@ def __init__( self.cool_access = cool_access +class ChangeKeyVault(_serialization.Model): + """Change key vault request. + + All required parameters must be populated in order to send to server. + + :ivar key_vault_uri: The URI of the key vault/managed HSM that should be used for encryption. + Required. + :vartype key_vault_uri: str + :ivar key_name: The name of the key that should be used for encryption. Required. + :vartype key_name: str + :ivar key_vault_resource_id: Azure resource ID of the key vault/managed HSM that should be used + for encryption. Required. + :vartype key_vault_resource_id: str + :ivar key_vault_private_endpoints: Pairs of virtual network ID and private endpoint ID. Every + virtual network that has volumes encrypted with customer-managed keys needs its own key vault + private endpoint. Required. + :vartype key_vault_private_endpoints: list[~azure.mgmt.netapp.models.KeyVaultPrivateEndpoint] + """ + + _validation = { + "key_vault_uri": {"required": True}, + "key_name": {"required": True}, + "key_vault_resource_id": {"required": True}, + "key_vault_private_endpoints": {"required": True}, + } + + _attribute_map = { + "key_vault_uri": {"key": "keyVaultUri", "type": "str"}, + "key_name": {"key": "keyName", "type": "str"}, + "key_vault_resource_id": {"key": "keyVaultResourceId", "type": "str"}, + "key_vault_private_endpoints": {"key": "keyVaultPrivateEndpoints", "type": "[KeyVaultPrivateEndpoint]"}, + } + + def __init__( + self, + *, + key_vault_uri: str, + key_name: str, + key_vault_resource_id: str, + key_vault_private_endpoints: List["_models.KeyVaultPrivateEndpoint"], + **kwargs: Any + ) -> None: + """ + :keyword key_vault_uri: The URI of the key vault/managed HSM that should be used for + encryption. Required. + :paramtype key_vault_uri: str + :keyword key_name: The name of the key that should be used for encryption. Required. + :paramtype key_name: str + :keyword key_vault_resource_id: Azure resource ID of the key vault/managed HSM that should be + used for encryption. Required. + :paramtype key_vault_resource_id: str + :keyword key_vault_private_endpoints: Pairs of virtual network ID and private endpoint ID. + Every virtual network that has volumes encrypted with customer-managed keys needs its own key + vault private endpoint. Required. + :paramtype key_vault_private_endpoints: list[~azure.mgmt.netapp.models.KeyVaultPrivateEndpoint] + """ + super().__init__(**kwargs) + self.key_vault_uri = key_vault_uri + self.key_name = key_name + self.key_vault_resource_id = key_vault_resource_id + self.key_vault_private_endpoints = key_vault_private_endpoints + + class CheckAvailabilityResponse(_serialization.Model): """Information regarding availability of a resource. @@ -1440,6 +1503,30 @@ def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, self.message = message +class ClusterPeerCommandResponse(_serialization.Model): + """Information about cluster peering process. + + :ivar peer_accept_command: A command that needs to be run on the external ONTAP to accept + cluster peering. Will only be present if :code:`clusterPeeringStatus` is + :code:`pending`. + :vartype peer_accept_command: str + """ + + _attribute_map = { + "peer_accept_command": {"key": "peerAcceptCommand", "type": "str"}, + } + + def __init__(self, *, peer_accept_command: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword peer_accept_command: A command that needs to be run on the external ONTAP to accept + cluster peering. Will only be present if :code:`clusterPeeringStatus` is + :code:`pending`. + :paramtype peer_accept_command: str + """ + super().__init__(**kwargs) + self.peer_accept_command = peer_accept_command + + class DailySchedule(_serialization.Model): """Daily Schedule properties. @@ -1547,6 +1634,41 @@ def __init__(self, *, user_assigned_identity: Optional[str] = None, **kwargs: An self.user_assigned_identity = user_assigned_identity +class EncryptionMigrationRequest(_serialization.Model): + """Encryption migration request. + + All required parameters must be populated in order to send to server. + + :ivar virtual_network_id: Identifier for the virtual network. Required. + :vartype virtual_network_id: str + :ivar private_endpoint_id: Identifier of the private endpoint to reach the Azure Key Vault. + Required. + :vartype private_endpoint_id: str + """ + + _validation = { + "virtual_network_id": {"required": True}, + "private_endpoint_id": {"required": True}, + } + + _attribute_map = { + "virtual_network_id": {"key": "virtualNetworkId", "type": "str"}, + "private_endpoint_id": {"key": "privateEndpointId", "type": "str"}, + } + + def __init__(self, *, virtual_network_id: str, private_endpoint_id: str, **kwargs: Any) -> None: + """ + :keyword virtual_network_id: Identifier for the virtual network. Required. + :paramtype virtual_network_id: str + :keyword private_endpoint_id: Identifier of the private endpoint to reach the Azure Key Vault. + Required. + :paramtype private_endpoint_id: str + """ + super().__init__(**kwargs) + self.virtual_network_id = virtual_network_id + self.private_endpoint_id = private_endpoint_id + + class ErrorAdditionalInfo(_serialization.Model): """The resource management error additional info. @@ -1791,6 +1913,10 @@ class FilePathAvailabilityRequest(_serialization.Model): :ivar subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Required. :vartype subnet_id: str + :ivar availability_zone: The Azure Resource logical availability zone which is used within zone + mapping lookup for the subscription and region. The lookup will retrieve the physical zone + where volume is placed. + :vartype availability_zone: str """ _validation = { @@ -1801,19 +1927,25 @@ class FilePathAvailabilityRequest(_serialization.Model): _attribute_map = { "name": {"key": "name", "type": "str"}, "subnet_id": {"key": "subnetId", "type": "str"}, + "availability_zone": {"key": "availabilityZone", "type": "str"}, } - def __init__(self, *, name: str, subnet_id: str, **kwargs: Any) -> None: + def __init__(self, *, name: str, subnet_id: str, availability_zone: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: File path to verify. Required. :paramtype name: str :keyword subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Required. :paramtype subnet_id: str + :keyword availability_zone: The Azure Resource logical availability zone which is used within + zone mapping lookup for the subscription and region. The lookup will retrieve the physical zone + where volume is placed. + :paramtype availability_zone: str """ super().__init__(**kwargs) self.name = name self.subnet_id = subnet_id + self.availability_zone = availability_zone class GetGroupIdListForLDAPUserRequest(_serialization.Model): @@ -1901,6 +2033,35 @@ def __init__( self.used_bytes = used_bytes +class KeyVaultPrivateEndpoint(_serialization.Model): + """Pairs of virtual network ID and private endpoint ID. Every virtual network that has volumes + encrypted with customer-managed keys needs its own key vault private endpoint. + + :ivar virtual_network_id: Identifier for the virtual network id. + :vartype virtual_network_id: str + :ivar private_endpoint_id: Identifier of the private endpoint to reach the Azure Key Vault. + :vartype private_endpoint_id: str + """ + + _attribute_map = { + "virtual_network_id": {"key": "virtualNetworkId", "type": "str"}, + "private_endpoint_id": {"key": "privateEndpointId", "type": "str"}, + } + + def __init__( + self, *, virtual_network_id: Optional[str] = None, private_endpoint_id: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword virtual_network_id: Identifier for the virtual network id. + :paramtype virtual_network_id: str + :keyword private_endpoint_id: Identifier of the private endpoint to reach the Azure Key Vault. + :paramtype private_endpoint_id: str + """ + super().__init__(**kwargs) + self.virtual_network_id = virtual_network_id + self.private_endpoint_id = private_endpoint_id + + class KeyVaultProperties(_serialization.Model): """Properties of key vault. @@ -2481,6 +2642,11 @@ class NetAppAccount(TrackedResource): # pylint: disable=too-many-instance-attri :ivar disable_showmount: Shows the status of disableShowmount for all volumes under the subscription, null equals false. :vartype disable_showmount: bool + :ivar nfs_v4_id_domain: Domain for NFSv4 user ID mapping. This property will be set for all + NetApp accounts in the subscription and region and only affect non ldap NFSv4 volumes. + :vartype nfs_v4_id_domain: str + :ivar is_multi_ad_enabled: This will have true value only if account is Multiple AD enabled. + :vartype is_multi_ad_enabled: bool """ _validation = { @@ -2492,6 +2658,8 @@ class NetAppAccount(TrackedResource): # pylint: disable=too-many-instance-attri "etag": {"readonly": True}, "provisioning_state": {"readonly": True}, "disable_showmount": {"readonly": True}, + "nfs_v4_id_domain": {"max_length": 255, "pattern": r"^[a-zA-Z0-9][a-zA-Z0-9.-]{0,253}[a-zA-Z0-9]$"}, + "is_multi_ad_enabled": {"readonly": True}, } _attribute_map = { @@ -2507,6 +2675,8 @@ class NetAppAccount(TrackedResource): # pylint: disable=too-many-instance-attri "active_directories": {"key": "properties.activeDirectories", "type": "[ActiveDirectory]"}, "encryption": {"key": "properties.encryption", "type": "AccountEncryption"}, "disable_showmount": {"key": "properties.disableShowmount", "type": "bool"}, + "nfs_v4_id_domain": {"key": "properties.nfsV4IDDomain", "type": "str"}, + "is_multi_ad_enabled": {"key": "properties.isMultiAdEnabled", "type": "bool"}, } def __init__( @@ -2517,6 +2687,7 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, active_directories: Optional[List["_models.ActiveDirectory"]] = None, encryption: Optional["_models.AccountEncryption"] = None, + nfs_v4_id_domain: Optional[str] = None, **kwargs: Any ) -> None: """ @@ -2530,6 +2701,9 @@ def __init__( :paramtype active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory] :keyword encryption: Encryption settings. :paramtype encryption: ~azure.mgmt.netapp.models.AccountEncryption + :keyword nfs_v4_id_domain: Domain for NFSv4 user ID mapping. This property will be set for all + NetApp accounts in the subscription and region and only affect non ldap NFSv4 volumes. + :paramtype nfs_v4_id_domain: str """ super().__init__(tags=tags, location=location, **kwargs) self.etag = None @@ -2538,6 +2712,8 @@ def __init__( self.active_directories = active_directories self.encryption = encryption self.disable_showmount = None + self.nfs_v4_id_domain = nfs_v4_id_domain + self.is_multi_ad_enabled = None class NetAppAccountList(_serialization.Model): @@ -2568,7 +2744,7 @@ def __init__( self.next_link = next_link -class NetAppAccountPatch(_serialization.Model): +class NetAppAccountPatch(_serialization.Model): # pylint: disable=too-many-instance-attributes """NetApp account patch resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -2594,6 +2770,11 @@ class NetAppAccountPatch(_serialization.Model): :ivar disable_showmount: Shows the status of disableShowmount for all volumes under the subscription, null equals false. :vartype disable_showmount: bool + :ivar nfs_v4_id_domain: Domain for NFSv4 user ID mapping. This property will be set for all + NetApp accounts in the subscription and region and only affect non ldap NFSv4 volumes. + :vartype nfs_v4_id_domain: str + :ivar is_multi_ad_enabled: This will have true value only if account is Multiple AD enabled. + :vartype is_multi_ad_enabled: bool """ _validation = { @@ -2602,6 +2783,8 @@ class NetAppAccountPatch(_serialization.Model): "type": {"readonly": True}, "provisioning_state": {"readonly": True}, "disable_showmount": {"readonly": True}, + "nfs_v4_id_domain": {"max_length": 255, "pattern": r"^[a-zA-Z0-9][a-zA-Z0-9.-]{0,253}[a-zA-Z0-9]$"}, + "is_multi_ad_enabled": {"readonly": True}, } _attribute_map = { @@ -2615,6 +2798,8 @@ class NetAppAccountPatch(_serialization.Model): "active_directories": {"key": "properties.activeDirectories", "type": "[ActiveDirectory]"}, "encryption": {"key": "properties.encryption", "type": "AccountEncryption"}, "disable_showmount": {"key": "properties.disableShowmount", "type": "bool"}, + "nfs_v4_id_domain": {"key": "properties.nfsV4IDDomain", "type": "str"}, + "is_multi_ad_enabled": {"key": "properties.isMultiAdEnabled", "type": "bool"}, } def __init__( @@ -2625,6 +2810,7 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, active_directories: Optional[List["_models.ActiveDirectory"]] = None, encryption: Optional["_models.AccountEncryption"] = None, + nfs_v4_id_domain: Optional[str] = None, **kwargs: Any ) -> None: """ @@ -2638,6 +2824,9 @@ def __init__( :paramtype active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory] :keyword encryption: Encryption settings. :paramtype encryption: ~azure.mgmt.netapp.models.AccountEncryption + :keyword nfs_v4_id_domain: Domain for NFSv4 user ID mapping. This property will be set for all + NetApp accounts in the subscription and region and only affect non ldap NFSv4 volumes. + :paramtype nfs_v4_id_domain: str """ super().__init__(**kwargs) self.location = location @@ -2650,6 +2839,8 @@ def __init__( self.active_directories = active_directories self.encryption = encryption self.disable_showmount = None + self.nfs_v4_id_domain = nfs_v4_id_domain + self.is_multi_ad_enabled = None class NetworkSiblingSet(_serialization.Model): @@ -2875,6 +3066,44 @@ def __init__(self, *, value: Optional[List["_models.Operation"]] = None, **kwarg self.value = value +class PeerClusterForVolumeMigrationRequest(_serialization.Model): + """Source cluster properties for a cluster peer request. + + All required parameters must be populated in order to send to server. + + :ivar peer_addresses: A list of IC-LIF IPs that can be used to connect to the on-prem cluster. + Required. + :vartype peer_addresses: list[str] + :ivar remote_path: The full path to a volume that is to be migrated into ANF. Required for + Migration volumes. + :vartype remote_path: ~azure.mgmt.netapp.models.RemotePath + """ + + _validation = { + "peer_addresses": {"required": True, "min_items": 1}, + } + + _attribute_map = { + "peer_addresses": {"key": "peerAddresses", "type": "[str]"}, + "remote_path": {"key": "remotePath", "type": "RemotePath"}, + } + + def __init__( + self, *, peer_addresses: List[str], remote_path: Optional["_models.RemotePath"] = None, **kwargs: Any + ) -> None: + """ + :keyword peer_addresses: A list of IC-LIF IPs that can be used to connect to the on-prem + cluster. Required. + :paramtype peer_addresses: list[str] + :keyword remote_path: The full path to a volume that is to be migrated into ANF. Required for + Migration volumes. + :paramtype remote_path: ~azure.mgmt.netapp.models.RemotePath + """ + super().__init__(**kwargs) + self.peer_addresses = peer_addresses + self.remote_path = remote_path + + class PlacementKeyValuePairs(_serialization.Model): """Application specific parameters for the placement of volumes in the volume group. @@ -3246,11 +3475,55 @@ def __init__(self, *, creation_token: Optional[str] = None, **kwargs: Any) -> No self.creation_token = creation_token +class RemotePath(_serialization.Model): + """The full path to a volume that is to be migrated into ANF. Required for Migration volumes. + + All required parameters must be populated in order to send to server. + + :ivar external_host_name: The Path to a ONTAP Host. Required. + :vartype external_host_name: str + :ivar server_name: The name of a server on the ONTAP Host. Required. + :vartype server_name: str + :ivar volume_name: The name of a volume on the server. Required. + :vartype volume_name: str + """ + + _validation = { + "external_host_name": {"required": True}, + "server_name": {"required": True}, + "volume_name": {"required": True}, + } + + _attribute_map = { + "external_host_name": {"key": "externalHostName", "type": "str"}, + "server_name": {"key": "serverName", "type": "str"}, + "volume_name": {"key": "volumeName", "type": "str"}, + } + + def __init__(self, *, external_host_name: str, server_name: str, volume_name: str, **kwargs: Any) -> None: + """ + :keyword external_host_name: The Path to a ONTAP Host. Required. + :paramtype external_host_name: str + :keyword server_name: The name of a server on the ONTAP Host. Required. + :paramtype server_name: str + :keyword volume_name: The name of a volume on the server. Required. + :paramtype volume_name: str + """ + super().__init__(**kwargs) + self.external_host_name = external_host_name + self.server_name = server_name + self.volume_name = volume_name + + class Replication(_serialization.Model): """Replication properties. + 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 replication_id: UUID v4 used to identify the replication. + :vartype replication_id: str :ivar endpoint_type: Indicates whether the local volume is the source or destination for the Volume Replication. Known values are: "src" and "dst". :vartype endpoint_type: str or ~azure.mgmt.netapp.models.EndpointType @@ -3263,10 +3536,17 @@ class Replication(_serialization.Model): """ _validation = { + "replication_id": { + "readonly": True, + "max_length": 36, + "min_length": 36, + "pattern": r"^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$", + }, "remote_volume_resource_id": {"required": True}, } _attribute_map = { + "replication_id": {"key": "replicationId", "type": "str"}, "endpoint_type": {"key": "endpointType", "type": "str"}, "replication_schedule": {"key": "replicationSchedule", "type": "str"}, "remote_volume_resource_id": {"key": "remoteVolumeResourceId", "type": "str"}, @@ -3295,6 +3575,7 @@ def __init__( :paramtype remote_volume_region: str """ super().__init__(**kwargs) + self.replication_id = None self.endpoint_type = endpoint_type self.replication_schedule = replication_schedule self.remote_volume_resource_id = remote_volume_resource_id @@ -3315,8 +3596,12 @@ class ReplicationObject(_serialization.Model): :vartype endpoint_type: str or ~azure.mgmt.netapp.models.EndpointType :ivar replication_schedule: Schedule. Known values are: "_10minutely", "hourly", and "daily". :vartype replication_schedule: str or ~azure.mgmt.netapp.models.ReplicationSchedule - :ivar remote_volume_resource_id: The resource ID of the remote volume. Required. + :ivar remote_volume_resource_id: The resource ID of the remote volume. Required for cross + region and cross zone replication. Required. :vartype remote_volume_resource_id: str + :ivar remote_path: The full path to a volume that is to be migrated into ANF. Required for + Migration volumes. + :vartype remote_path: ~azure.mgmt.netapp.models.RemotePath :ivar remote_volume_region: The remote region for the other end of the Volume Replication. :vartype remote_volume_region: str """ @@ -3331,6 +3616,7 @@ class ReplicationObject(_serialization.Model): "endpoint_type": {"key": "endpointType", "type": "str"}, "replication_schedule": {"key": "replicationSchedule", "type": "str"}, "remote_volume_resource_id": {"key": "remoteVolumeResourceId", "type": "str"}, + "remote_path": {"key": "remotePath", "type": "RemotePath"}, "remote_volume_region": {"key": "remoteVolumeRegion", "type": "str"}, } @@ -3340,6 +3626,7 @@ def __init__( remote_volume_resource_id: str, endpoint_type: Optional[Union[str, "_models.EndpointType"]] = None, replication_schedule: Optional[Union[str, "_models.ReplicationSchedule"]] = None, + remote_path: Optional["_models.RemotePath"] = None, remote_volume_region: Optional[str] = None, **kwargs: Any ) -> None: @@ -3350,8 +3637,12 @@ def __init__( :keyword replication_schedule: Schedule. Known values are: "_10minutely", "hourly", and "daily". :paramtype replication_schedule: str or ~azure.mgmt.netapp.models.ReplicationSchedule - :keyword remote_volume_resource_id: The resource ID of the remote volume. Required. + :keyword remote_volume_resource_id: The resource ID of the remote volume. Required for cross + region and cross zone replication. Required. :paramtype remote_volume_resource_id: str + :keyword remote_path: The full path to a volume that is to be migrated into ANF. Required for + Migration volumes. + :paramtype remote_path: ~azure.mgmt.netapp.models.RemotePath :keyword remote_volume_region: The remote region for the other end of the Volume Replication. :paramtype remote_volume_region: str """ @@ -3360,6 +3651,7 @@ def __init__( self.endpoint_type = endpoint_type self.replication_schedule = replication_schedule self.remote_volume_resource_id = remote_volume_resource_id + self.remote_path = remote_path self.remote_volume_region = remote_volume_region @@ -4327,6 +4619,30 @@ def __init__( self.next_link = next_link +class SvmPeerCommandResponse(_serialization.Model): + """Information about SVM peering process. + + :ivar svm_peering_command: A command that needs to be run on the external ONTAP to accept SVM + peering. Will only be present if :code:`svmPeeringStatus` is + :code:`pending`. + :vartype svm_peering_command: str + """ + + _attribute_map = { + "svm_peering_command": {"key": "svmPeeringCommand", "type": "str"}, + } + + def __init__(self, *, svm_peering_command: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword svm_peering_command: A command that needs to be run on the external ONTAP to accept + SVM peering. Will only be present if :code:`svmPeeringStatus` is + :code:`pending`. + :paramtype svm_peering_command: str + """ + super().__init__(**kwargs) + self.svm_peering_command = svm_peering_command + + class SystemData(_serialization.Model): """Metadata pertaining to creation and last modification of the resource. @@ -4560,11 +4876,18 @@ class Volume(TrackedResource): # pylint: disable=too-many-instance-attributes :ivar mount_targets: List of mount targets. :vartype mount_targets: list[~azure.mgmt.netapp.models.MountTargetProperties] :ivar volume_type: What type of volume is this. For destination volumes in Cross Region - Replication, set type to DataProtection. + Replication, set type to DataProtection. For creating clone volume, set type to ShortTermClone. :vartype volume_type: str :ivar data_protection: DataProtection type volumes include an object containing details of the replication. :vartype data_protection: ~azure.mgmt.netapp.models.VolumePropertiesDataProtection + :ivar accept_grow_capacity_pool_for_short_term_clone_split: While auto splitting the short term + clone volume, if the parent pool does not have enough space to accommodate the volume after + split, it will be automatically resized, which will lead to increased billing. To accept + capacity pool size auto grow and create a short term clone volume, set the property as + accepted. Known values are: "Accepted" and "Declined". + :vartype accept_grow_capacity_pool_for_short_term_clone_split: str or + ~azure.mgmt.netapp.models.AcceptGrowCapacityPoolForShortTermCloneSplit :ivar is_restoring: Restoring. :vartype is_restoring: bool :ivar snapshot_directory_visible: If enabled (true) the volume will contain a read-only @@ -4682,6 +5005,19 @@ class Volume(TrackedResource): # pylint: disable=too-many-instance-attributes :vartype is_large_volume: bool :ivar originating_resource_id: Id of the snapshot or backup that the volume is restored from. :vartype originating_resource_id: str + :ivar inherited_size_in_bytes: Space shared by short term clone volume with parent volume in + bytes. + :vartype inherited_size_in_bytes: int + :ivar language: Language supported for volume. Known values are: "c.utf-8", "utf8mb4", "ar", + "ar.utf-8", "hr", "hr.utf-8", "cs", "cs.utf-8", "da", "da.utf-8", "nl", "nl.utf-8", "en", + "en.utf-8", "fi", "fi.utf-8", "fr", "fr.utf-8", "de", "de.utf-8", "he", "he.utf-8", "hu", + "hu.utf-8", "it", "it.utf-8", "ja", "ja.utf-8", "ja-v1", "ja-v1.utf-8", "ja-jp.pck", + "ja-jp.pck.utf-8", "ja-jp.932", "ja-jp.932.utf-8", "ja-jp.pck-v2", "ja-jp.pck-v2.utf-8", "ko", + "ko.utf-8", "no", "no.utf-8", "pl", "pl.utf-8", "pt", "pt.utf-8", "c", "ro", "ro.utf-8", "ru", + "ru.utf-8", "zh", "zh.utf-8", "zh.gbk", "zh.gbk.utf-8", "zh-tw.big5", "zh-tw.big5.utf-8", + "zh-tw", "zh-tw.utf-8", "sk", "sk.utf-8", "sl", "sl.utf-8", "es", "es.utf-8", "sv", "sv.utf-8", + "tr", "tr.utf-8", "en-us", and "en-us.utf-8". + :vartype language: str or ~azure.mgmt.netapp.models.VolumeLanguage """ _validation = { @@ -4716,7 +5052,7 @@ class Volume(TrackedResource): # pylint: disable=too-many-instance-attributes "storage_to_network_proximity": {"readonly": True}, "mount_targets": {"readonly": True}, "actual_throughput_mibps": {"readonly": True}, - "coolness_period": {"maximum": 183, "minimum": 7}, + "coolness_period": {"maximum": 183, "minimum": 2}, "unix_permissions": {"max_length": 4, "min_length": 4}, "clone_progress": {"readonly": True}, "file_access_logs": {"readonly": True}, @@ -4727,6 +5063,7 @@ class Volume(TrackedResource): # pylint: disable=too-many-instance-attributes "encrypted": {"readonly": True}, "provisioned_availability_zone": {"readonly": True}, "originating_resource_id": {"readonly": True}, + "inherited_size_in_bytes": {"readonly": True}, } _attribute_map = { @@ -4756,6 +5093,10 @@ class Volume(TrackedResource): # pylint: disable=too-many-instance-attributes "mount_targets": {"key": "properties.mountTargets", "type": "[MountTargetProperties]"}, "volume_type": {"key": "properties.volumeType", "type": "str"}, "data_protection": {"key": "properties.dataProtection", "type": "VolumePropertiesDataProtection"}, + "accept_grow_capacity_pool_for_short_term_clone_split": { + "key": "properties.acceptGrowCapacityPoolForShortTermCloneSplit", + "type": "str", + }, "is_restoring": {"key": "properties.isRestoring", "type": "bool"}, "snapshot_directory_visible": {"key": "properties.snapshotDirectoryVisible", "type": "bool"}, "kerberos_enabled": {"key": "properties.kerberosEnabled", "type": "bool"}, @@ -4795,6 +5136,8 @@ class Volume(TrackedResource): # pylint: disable=too-many-instance-attributes "provisioned_availability_zone": {"key": "properties.provisionedAvailabilityZone", "type": "str"}, "is_large_volume": {"key": "properties.isLargeVolume", "type": "bool"}, "originating_resource_id": {"key": "properties.originatingResourceId", "type": "str"}, + "inherited_size_in_bytes": {"key": "properties.inheritedSizeInBytes", "type": "int"}, + "language": {"key": "properties.language", "type": "str"}, } def __init__( # pylint: disable=too-many-locals @@ -4815,6 +5158,9 @@ def __init__( # pylint: disable=too-many-locals network_features: Union[str, "_models.NetworkFeatures"] = "Basic", volume_type: Optional[str] = None, data_protection: Optional["_models.VolumePropertiesDataProtection"] = None, + accept_grow_capacity_pool_for_short_term_clone_split: Optional[ + Union[str, "_models.AcceptGrowCapacityPoolForShortTermCloneSplit"] + ] = None, is_restoring: Optional[bool] = None, snapshot_directory_visible: bool = True, kerberos_enabled: bool = False, @@ -4841,6 +5187,7 @@ def __init__( # pylint: disable=too-many-locals placement_rules: Optional[List["_models.PlacementKeyValuePairs"]] = None, enable_subvolumes: Union[str, "_models.EnableSubvolumes"] = "Disabled", is_large_volume: bool = False, + language: Optional[Union[str, "_models.VolumeLanguage"]] = None, **kwargs: Any ) -> None: """ @@ -4878,11 +5225,18 @@ def __init__( # pylint: disable=too-many-locals update. Known values are: "Basic", "Standard", "Basic_Standard", and "Standard_Basic". :paramtype network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures :keyword volume_type: What type of volume is this. For destination volumes in Cross Region - Replication, set type to DataProtection. + Replication, set type to DataProtection. For creating clone volume, set type to ShortTermClone. :paramtype volume_type: str :keyword data_protection: DataProtection type volumes include an object containing details of the replication. :paramtype data_protection: ~azure.mgmt.netapp.models.VolumePropertiesDataProtection + :keyword accept_grow_capacity_pool_for_short_term_clone_split: While auto splitting the short + term clone volume, if the parent pool does not have enough space to accommodate the volume + after split, it will be automatically resized, which will lead to increased billing. To accept + capacity pool size auto grow and create a short term clone volume, set the property as + accepted. Known values are: "Accepted" and "Declined". + :paramtype accept_grow_capacity_pool_for_short_term_clone_split: str or + ~azure.mgmt.netapp.models.AcceptGrowCapacityPoolForShortTermCloneSplit :keyword is_restoring: Restoring. :paramtype is_restoring: bool :keyword snapshot_directory_visible: If enabled (true) the volume will contain a read-only @@ -4971,6 +5325,16 @@ def __init__( # pylint: disable=too-many-locals :paramtype enable_subvolumes: str or ~azure.mgmt.netapp.models.EnableSubvolumes :keyword is_large_volume: Specifies whether volume is a Large Volume or Regular Volume. :paramtype is_large_volume: bool + :keyword language: Language supported for volume. Known values are: "c.utf-8", "utf8mb4", "ar", + "ar.utf-8", "hr", "hr.utf-8", "cs", "cs.utf-8", "da", "da.utf-8", "nl", "nl.utf-8", "en", + "en.utf-8", "fi", "fi.utf-8", "fr", "fr.utf-8", "de", "de.utf-8", "he", "he.utf-8", "hu", + "hu.utf-8", "it", "it.utf-8", "ja", "ja.utf-8", "ja-v1", "ja-v1.utf-8", "ja-jp.pck", + "ja-jp.pck.utf-8", "ja-jp.932", "ja-jp.932.utf-8", "ja-jp.pck-v2", "ja-jp.pck-v2.utf-8", "ko", + "ko.utf-8", "no", "no.utf-8", "pl", "pl.utf-8", "pt", "pt.utf-8", "c", "ro", "ro.utf-8", "ru", + "ru.utf-8", "zh", "zh.utf-8", "zh.gbk", "zh.gbk.utf-8", "zh-tw.big5", "zh-tw.big5.utf-8", + "zh-tw", "zh-tw.utf-8", "sk", "sk.utf-8", "sl", "sl.utf-8", "es", "es.utf-8", "sv", "sv.utf-8", + "tr", "tr.utf-8", "en-us", and "en-us.utf-8". + :paramtype language: str or ~azure.mgmt.netapp.models.VolumeLanguage """ super().__init__(tags=tags, location=location, **kwargs) self.etag = None @@ -4993,6 +5357,7 @@ def __init__( # pylint: disable=too-many-locals self.mount_targets = None self.volume_type = volume_type self.data_protection = data_protection + self.accept_grow_capacity_pool_for_short_term_clone_split = accept_grow_capacity_pool_for_short_term_clone_split self.is_restoring = is_restoring self.snapshot_directory_visible = snapshot_directory_visible self.kerberos_enabled = kerberos_enabled @@ -5029,6 +5394,8 @@ def __init__( # pylint: disable=too-many-locals self.provisioned_availability_zone = None self.is_large_volume = is_large_volume self.originating_resource_id = None + self.inherited_size_in_bytes = None + self.language = language class VolumeBackupProperties(_serialization.Model): @@ -5373,11 +5740,18 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- :ivar mount_targets: List of mount targets. :vartype mount_targets: list[~azure.mgmt.netapp.models.MountTargetProperties] :ivar volume_type: What type of volume is this. For destination volumes in Cross Region - Replication, set type to DataProtection. + Replication, set type to DataProtection. For creating clone volume, set type to ShortTermClone. :vartype volume_type: str :ivar data_protection: DataProtection type volumes include an object containing details of the replication. :vartype data_protection: ~azure.mgmt.netapp.models.VolumePropertiesDataProtection + :ivar accept_grow_capacity_pool_for_short_term_clone_split: While auto splitting the short term + clone volume, if the parent pool does not have enough space to accommodate the volume after + split, it will be automatically resized, which will lead to increased billing. To accept + capacity pool size auto grow and create a short term clone volume, set the property as + accepted. Known values are: "Accepted" and "Declined". + :vartype accept_grow_capacity_pool_for_short_term_clone_split: str or + ~azure.mgmt.netapp.models.AcceptGrowCapacityPoolForShortTermCloneSplit :ivar is_restoring: Restoring. :vartype is_restoring: bool :ivar snapshot_directory_visible: If enabled (true) the volume will contain a read-only @@ -5495,6 +5869,19 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- :vartype is_large_volume: bool :ivar originating_resource_id: Id of the snapshot or backup that the volume is restored from. :vartype originating_resource_id: str + :ivar inherited_size_in_bytes: Space shared by short term clone volume with parent volume in + bytes. + :vartype inherited_size_in_bytes: int + :ivar language: Language supported for volume. Known values are: "c.utf-8", "utf8mb4", "ar", + "ar.utf-8", "hr", "hr.utf-8", "cs", "cs.utf-8", "da", "da.utf-8", "nl", "nl.utf-8", "en", + "en.utf-8", "fi", "fi.utf-8", "fr", "fr.utf-8", "de", "de.utf-8", "he", "he.utf-8", "hu", + "hu.utf-8", "it", "it.utf-8", "ja", "ja.utf-8", "ja-v1", "ja-v1.utf-8", "ja-jp.pck", + "ja-jp.pck.utf-8", "ja-jp.932", "ja-jp.932.utf-8", "ja-jp.pck-v2", "ja-jp.pck-v2.utf-8", "ko", + "ko.utf-8", "no", "no.utf-8", "pl", "pl.utf-8", "pt", "pt.utf-8", "c", "ro", "ro.utf-8", "ru", + "ru.utf-8", "zh", "zh.utf-8", "zh.gbk", "zh.gbk.utf-8", "zh-tw.big5", "zh-tw.big5.utf-8", + "zh-tw", "zh-tw.utf-8", "sk", "sk.utf-8", "sl", "sl.utf-8", "es", "es.utf-8", "sv", "sv.utf-8", + "tr", "tr.utf-8", "en-us", and "en-us.utf-8". + :vartype language: str or ~azure.mgmt.netapp.models.VolumeLanguage """ _validation = { @@ -5525,7 +5912,7 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- "storage_to_network_proximity": {"readonly": True}, "mount_targets": {"readonly": True}, "actual_throughput_mibps": {"readonly": True}, - "coolness_period": {"maximum": 183, "minimum": 7}, + "coolness_period": {"maximum": 183, "minimum": 2}, "unix_permissions": {"max_length": 4, "min_length": 4}, "clone_progress": {"readonly": True}, "file_access_logs": {"readonly": True}, @@ -5536,6 +5923,7 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- "encrypted": {"readonly": True}, "provisioned_availability_zone": {"readonly": True}, "originating_resource_id": {"readonly": True}, + "inherited_size_in_bytes": {"readonly": True}, } _attribute_map = { @@ -5562,6 +5950,10 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- "mount_targets": {"key": "properties.mountTargets", "type": "[MountTargetProperties]"}, "volume_type": {"key": "properties.volumeType", "type": "str"}, "data_protection": {"key": "properties.dataProtection", "type": "VolumePropertiesDataProtection"}, + "accept_grow_capacity_pool_for_short_term_clone_split": { + "key": "properties.acceptGrowCapacityPoolForShortTermCloneSplit", + "type": "str", + }, "is_restoring": {"key": "properties.isRestoring", "type": "bool"}, "snapshot_directory_visible": {"key": "properties.snapshotDirectoryVisible", "type": "bool"}, "kerberos_enabled": {"key": "properties.kerberosEnabled", "type": "bool"}, @@ -5601,6 +5993,8 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- "provisioned_availability_zone": {"key": "properties.provisionedAvailabilityZone", "type": "str"}, "is_large_volume": {"key": "properties.isLargeVolume", "type": "bool"}, "originating_resource_id": {"key": "properties.originatingResourceId", "type": "str"}, + "inherited_size_in_bytes": {"key": "properties.inheritedSizeInBytes", "type": "int"}, + "language": {"key": "properties.language", "type": "str"}, } def __init__( # pylint: disable=too-many-locals @@ -5621,6 +6015,9 @@ def __init__( # pylint: disable=too-many-locals network_features: Union[str, "_models.NetworkFeatures"] = "Basic", volume_type: Optional[str] = None, data_protection: Optional["_models.VolumePropertiesDataProtection"] = None, + accept_grow_capacity_pool_for_short_term_clone_split: Optional[ + Union[str, "_models.AcceptGrowCapacityPoolForShortTermCloneSplit"] + ] = None, is_restoring: Optional[bool] = None, snapshot_directory_visible: bool = True, kerberos_enabled: bool = False, @@ -5647,6 +6044,7 @@ def __init__( # pylint: disable=too-many-locals placement_rules: Optional[List["_models.PlacementKeyValuePairs"]] = None, enable_subvolumes: Union[str, "_models.EnableSubvolumes"] = "Disabled", is_large_volume: bool = False, + language: Optional[Union[str, "_models.VolumeLanguage"]] = None, **kwargs: Any ) -> None: """ @@ -5684,11 +6082,18 @@ def __init__( # pylint: disable=too-many-locals update. Known values are: "Basic", "Standard", "Basic_Standard", and "Standard_Basic". :paramtype network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures :keyword volume_type: What type of volume is this. For destination volumes in Cross Region - Replication, set type to DataProtection. + Replication, set type to DataProtection. For creating clone volume, set type to ShortTermClone. :paramtype volume_type: str :keyword data_protection: DataProtection type volumes include an object containing details of the replication. :paramtype data_protection: ~azure.mgmt.netapp.models.VolumePropertiesDataProtection + :keyword accept_grow_capacity_pool_for_short_term_clone_split: While auto splitting the short + term clone volume, if the parent pool does not have enough space to accommodate the volume + after split, it will be automatically resized, which will lead to increased billing. To accept + capacity pool size auto grow and create a short term clone volume, set the property as + accepted. Known values are: "Accepted" and "Declined". + :paramtype accept_grow_capacity_pool_for_short_term_clone_split: str or + ~azure.mgmt.netapp.models.AcceptGrowCapacityPoolForShortTermCloneSplit :keyword is_restoring: Restoring. :paramtype is_restoring: bool :keyword snapshot_directory_visible: If enabled (true) the volume will contain a read-only @@ -5777,6 +6182,16 @@ def __init__( # pylint: disable=too-many-locals :paramtype enable_subvolumes: str or ~azure.mgmt.netapp.models.EnableSubvolumes :keyword is_large_volume: Specifies whether volume is a Large Volume or Regular Volume. :paramtype is_large_volume: bool + :keyword language: Language supported for volume. Known values are: "c.utf-8", "utf8mb4", "ar", + "ar.utf-8", "hr", "hr.utf-8", "cs", "cs.utf-8", "da", "da.utf-8", "nl", "nl.utf-8", "en", + "en.utf-8", "fi", "fi.utf-8", "fr", "fr.utf-8", "de", "de.utf-8", "he", "he.utf-8", "hu", + "hu.utf-8", "it", "it.utf-8", "ja", "ja.utf-8", "ja-v1", "ja-v1.utf-8", "ja-jp.pck", + "ja-jp.pck.utf-8", "ja-jp.932", "ja-jp.932.utf-8", "ja-jp.pck-v2", "ja-jp.pck-v2.utf-8", "ko", + "ko.utf-8", "no", "no.utf-8", "pl", "pl.utf-8", "pt", "pt.utf-8", "c", "ro", "ro.utf-8", "ru", + "ru.utf-8", "zh", "zh.utf-8", "zh.gbk", "zh.gbk.utf-8", "zh-tw.big5", "zh-tw.big5.utf-8", + "zh-tw", "zh-tw.utf-8", "sk", "sk.utf-8", "sl", "sl.utf-8", "es", "es.utf-8", "sv", "sv.utf-8", + "tr", "tr.utf-8", "en-us", and "en-us.utf-8". + :paramtype language: str or ~azure.mgmt.netapp.models.VolumeLanguage """ super().__init__(**kwargs) self.id = None @@ -5802,6 +6217,7 @@ def __init__( # pylint: disable=too-many-locals self.mount_targets = None self.volume_type = volume_type self.data_protection = data_protection + self.accept_grow_capacity_pool_for_short_term_clone_split = accept_grow_capacity_pool_for_short_term_clone_split self.is_restoring = is_restoring self.snapshot_directory_visible = snapshot_directory_visible self.kerberos_enabled = kerberos_enabled @@ -5838,6 +6254,8 @@ def __init__( # pylint: disable=too-many-locals self.provisioned_availability_zone = None self.is_large_volume = is_large_volume self.originating_resource_id = None + self.inherited_size_in_bytes = None + self.language = language class VolumeList(_serialization.Model): @@ -5892,6 +6310,8 @@ class VolumePatch(_serialization.Model): # pylint: disable=too-many-instance-at :vartype usage_threshold: int :ivar export_policy: Set of export policy rules. :vartype export_policy: ~azure.mgmt.netapp.models.VolumePatchPropertiesExportPolicy + :ivar protocol_types: Set of protocol types, default NFSv3, CIFS for SMB protocol. + :vartype protocol_types: list[str] :ivar throughput_mibps: Maximum throughput in MiB/s that can be achieved by this volume and this will be accepted as input only for manual qosType volume. :vartype throughput_mibps: float @@ -5960,6 +6380,7 @@ class VolumePatch(_serialization.Model): # pylint: disable=too-many-instance-at "service_level": {"key": "properties.serviceLevel", "type": "str"}, "usage_threshold": {"key": "properties.usageThreshold", "type": "int"}, "export_policy": {"key": "properties.exportPolicy", "type": "VolumePatchPropertiesExportPolicy"}, + "protocol_types": {"key": "properties.protocolTypes", "type": "[str]"}, "throughput_mibps": {"key": "properties.throughputMibps", "type": "float"}, "data_protection": {"key": "properties.dataProtection", "type": "VolumePatchPropertiesDataProtection"}, "is_default_quota_enabled": {"key": "properties.isDefaultQuotaEnabled", "type": "bool"}, @@ -5982,6 +6403,7 @@ def __init__( service_level: Union[str, "_models.ServiceLevel"] = "Premium", usage_threshold: int = 107374182400, export_policy: Optional["_models.VolumePatchPropertiesExportPolicy"] = None, + protocol_types: Optional[List[str]] = None, throughput_mibps: Optional[float] = None, data_protection: Optional["_models.VolumePatchPropertiesDataProtection"] = None, is_default_quota_enabled: bool = False, @@ -6010,6 +6432,8 @@ def __init__( :paramtype usage_threshold: int :keyword export_policy: Set of export policy rules. :paramtype export_policy: ~azure.mgmt.netapp.models.VolumePatchPropertiesExportPolicy + :keyword protocol_types: Set of protocol types, default NFSv3, CIFS for SMB protocol. + :paramtype protocol_types: list[str] :keyword throughput_mibps: Maximum throughput in MiB/s that can be achieved by this volume and this will be accepted as input only for manual qosType volume. :paramtype throughput_mibps: float @@ -6068,6 +6492,7 @@ def __init__( self.service_level = service_level self.usage_threshold = usage_threshold self.export_policy = export_policy + self.protocol_types = protocol_types self.throughput_mibps = throughput_mibps self.data_protection = data_protection self.is_default_quota_enabled = is_default_quota_enabled diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_net_app_management_client_enums.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_net_app_management_client_enums.py index f359a05553ef..2233e571af94 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_net_app_management_client_enums.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_net_app_management_client_enums.py @@ -10,6 +10,20 @@ from azure.core import CaseInsensitiveEnumMeta +class AcceptGrowCapacityPoolForShortTermCloneSplit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """While auto splitting the short term clone volume, if the parent pool does not have enough space + to accommodate the volume after split, it will be automatically resized, which will lead to + increased billing. To accept capacity pool size auto grow and create a short term clone volume, + set the property as accepted. + """ + + ACCEPTED = "Accepted" + """Auto grow capacity pool for short term clone split is accepted.""" + DECLINED = "Declined" + """Auto grow capacity pool for short term clone split is declined. Short term clone volume + creation will not be allowed, to create short term clone volume accept auto grow capacity pool.""" + + class ActiveDirectoryStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Status of the Active Directory.""" @@ -354,6 +368,149 @@ class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Individual group quota""" +class VolumeLanguage(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Language supported for volume.""" + + C_UTF8 = "c.utf-8" + """Posix with UTF-8""" + UTF8_MB4 = "utf8mb4" + """UTF-8 with 4 byte character support""" + AR = "ar" + """Arabic - Deprecated""" + AR_UTF8 = "ar.utf-8" + """Arabic with UTF-8""" + HR = "hr" + """Croatian - Deprecated""" + HR_UTF8 = "hr.utf-8" + """Croatian with UTF-8""" + CS = "cs" + """Czech - Deprecated""" + CS_UTF8 = "cs.utf-8" + """Czech with UTF-8""" + DA = "da" + """Danish - Deprecated""" + DA_UTF8 = "da.utf-8" + """Danish with UTF-8""" + NL = "nl" + """Dutch - Deprecated""" + NL_UTF8 = "nl.utf-8" + """Dutch with UTF-8""" + EN = "en" + """English - Deprecated""" + EN_UTF8 = "en.utf-8" + """English with UTF-8""" + FI = "fi" + """Finnish - Deprecated""" + FI_UTF8 = "fi.utf-8" + """Finnish with UTF-8""" + FR = "fr" + """French - Deprecated""" + FR_UTF8 = "fr.utf-8" + """French with UTF-8""" + DE = "de" + """German - Deprecated""" + DE_UTF8 = "de.utf-8" + """German with UTF-8""" + HE = "he" + """Hebrew - Deprecated""" + HE_UTF8 = "he.utf-8" + """Hebrew with UTF-8""" + HU = "hu" + """Hungarian - Deprecated""" + HU_UTF8 = "hu.utf-8" + """Hungarian with UTF-8""" + IT = "it" + """Italian - Deprecated""" + IT_UTF8 = "it.utf-8" + """Italian with UTF-8""" + JA = "ja" + """Japanese euc-j - Deprecated""" + JA_UTF8 = "ja.utf-8" + """Japanese euc-j with UTF-8""" + JA_V1 = "ja-v1" + """Japanese euc-j - Deprecated""" + JA_V1_UTF8 = "ja-v1.utf-8" + """Japanese euc-j with UTF-8""" + JA_JP_PCK = "ja-jp.pck" + """Japanese pck""" + JA_JP_PCK_UTF8 = "ja-jp.pck.utf-8" + """Japanese pck with UTF-8 - Deprecated""" + JA_JP932 = "ja-jp.932" + """Japanese cp932""" + JA_JP932_UTF8 = "ja-jp.932.utf-8" + """Japanese cp932 with UTF-8 - Deprecated""" + JA_JP_PCK_V2 = "ja-jp.pck-v2" + """Japanese pck - sjis""" + JA_JP_PCK_V2_UTF8 = "ja-jp.pck-v2.utf-8" + """Japanese pck - sjis with UTF-8 - Deprecated""" + KO = "ko" + """Korean - Deprecated""" + KO_UTF8 = "ko.utf-8" + """Korean with UTF-8""" + NO = "no" + """Norwegian - Deprecated""" + NO_UTF8 = "no.utf-8" + """Norwegian with UTF-8""" + PL = "pl" + """Polish - Deprecated""" + PL_UTF8 = "pl.utf-8" + """Polish with UTF-8""" + PT = "pt" + """Portuguese - Deprecated""" + PT_UTF8 = "pt.utf-8" + """Portuguese with UTF-8""" + C = "c" + """Posix - Deprecated""" + RO = "ro" + """Romanian - Deprecated""" + RO_UTF8 = "ro.utf-8" + """Romanian with UTF-8""" + RU = "ru" + """Russian - Deprecated""" + RU_UTF8 = "ru.utf-8" + """Russian with UTF-8""" + ZH = "zh" + """Simplified Chinese - Deprecated""" + ZH_UTF8 = "zh.utf-8" + """Simplified Chinese with UTF-8""" + ZH_GBK = "zh.gbk" + """Simplified gbk Chinese""" + ZH_GBK_UTF8 = "zh.gbk.utf-8" + """Simplified gbk Chinese with UTF-8 - Deprecated""" + ZH_TW_BIG5 = "zh-tw.big5" + """Traditional Chinese BIG 5""" + ZH_TW_BIG5_UTF8 = "zh-tw.big5.utf-8" + """Traditional Chinese BIG 5 with UTF-8 - Deprecated""" + ZH_TW = "zh-tw" + """Traditional Chinese EUC-TW""" + ZH_TW_UTF8 = "zh-tw.utf-8" + """Traditional Chinese EUC-TW with UTF-8 - Deprecated""" + SK = "sk" + """Slovak - Deprecated""" + SK_UTF8 = "sk.utf-8" + """Slovak with UTF-8""" + SL = "sl" + """Slovenian - Deprecated""" + SL_UTF8 = "sl.utf-8" + """Slovenian with UTF-8""" + ES = "es" + """Spanish - Deprecated""" + ES_UTF8 = "es.utf-8" + """Spanish with UTF-8""" + SV = "sv" + """Swedish - Deprecated""" + SV_UTF8 = "sv.utf-8" + """Swedish with UTF-8""" + TR = "tr" + """Turkish - Deprecated""" + TR_UTF8 = "tr.utf-8" + """Turkish with UTF-8""" + EN_US = "en-us" + """US English - Deprecated""" + EN_US_UTF8 = "en-us.utf-8" + """US English with UTF-8""" + + class VolumeStorageToNetworkProximity(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provides storage to network proximity information for the volume.""" diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_accounts_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_accounts_operations.py index e7654af8b2f7..fe4b273fdcfe 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_accounts_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_accounts_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +48,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +72,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def build_get_request(resource_group_name: str, account_name: str, subscription_ _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_create_or_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -170,7 +175,7 @@ def build_delete_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +210,7 @@ def build_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -243,7 +248,7 @@ def build_renew_credentials_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -272,6 +277,117 @@ def build_renew_credentials_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_migrate_encryption_key_request( + resource_group_name: str, account_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-11-01-preview")) + 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.NetApp/netAppAccounts/{accountName}/migrateEncryption", + ) # 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", max_length=90, min_length=1 + ), + "accountName": _SERIALIZER.url( + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" + ), + } + + _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_get_change_key_vault_information_request( # pylint: disable=name-too-long + resource_group_name: str, account_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-11-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/getKeyVaultStatus", + ) # 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", max_length=90, min_length=1 + ), + "accountName": _SERIALIZER.url( + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" + ), + } + + _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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_change_key_vault_request( + resource_group_name: str, account_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-11-01-preview")) + 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.NetApp/netAppAccounts/{accountName}/changeKeyVault", + ) # 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", max_length=90, min_length=1 + ), + "accountName": _SERIALIZER.url( + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" + ), + } + + _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) + + class AccountsOperations: """ .. warning:: @@ -307,7 +423,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.NetAppAccount api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NetAppAccountList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -389,7 +505,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Net api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NetAppAccountList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -468,7 +584,7 @@ def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.netapp.models.NetAppAccount :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -515,7 +631,7 @@ def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _mo def _create_or_update_initial( self, resource_group_name: str, account_name: str, body: Union[_models.NetAppAccount, IO[bytes]], **kwargs: Any ) -> _models.NetAppAccount: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -707,7 +823,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +926,7 @@ def _update_initial( body: Union[_models.NetAppAccountPatch, IO[bytes]], **kwargs: Any ) -> _models.NetAppAccount: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1006,7 +1122,7 @@ def get_long_running_output(pipeline_response): def _renew_credentials_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1103,3 +1219,500 @@ 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 + + def _migrate_encryption_key_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + account_name: str, + body: Optional[Union[_models.EncryptionMigrationRequest, IO[bytes]]] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "EncryptionMigrationRequest") + else: + _json = None + + _request = build_migrate_encryption_key_request( + resource_group_name=resource_group_name, + account_name=account_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 [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_migrate_encryption_key( + self, + resource_group_name: str, + account_name: str, + body: Optional[_models.EncryptionMigrationRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Migrate volumes encryption key source. + + Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or + Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes + from another account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param body: The required parameters to perform encryption migration. Default value is None. + :type body: ~azure.mgmt.netapp.models.EncryptionMigrationRequest + :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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_migrate_encryption_key( + self, + resource_group_name: str, + account_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Migrate volumes encryption key source. + + Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or + Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes + from another account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param body: The required parameters to perform encryption migration. Default value is None. + :type body: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_migrate_encryption_key( + self, + resource_group_name: str, + account_name: str, + body: Optional[Union[_models.EncryptionMigrationRequest, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Migrate volumes encryption key source. + + Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or + Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes + from another account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param body: The required parameters to perform encryption migration. Is either a + EncryptionMigrationRequest type or a IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.netapp.models.EncryptionMigrationRequest or IO[bytes] + :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 = 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._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + 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._migrate_encryption_key_initial( # type: ignore + resource_group_name=resource_group_name, + account_name=account_name, + body=body, + 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): # 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 + + def _get_change_key_vault_information_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, resource_group_name: str, account_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_get_change_key_vault_information_request( + resource_group_name=resource_group_name, + account_name=account_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 [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_get_change_key_vault_information( + self, resource_group_name: str, account_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Get information about how volumes under NetApp account are encrypted. + + Contains data from encryption.keyVaultProperties as well as information about which private + endpoint is used by each encryption sibling set. Response from this endpoint can be modified + and used as request body for POST request. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_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._config.api_version)) + 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._get_change_key_vault_information_initial( # type: ignore + resource_group_name=resource_group_name, + account_name=account_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 + + def _change_key_vault_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + account_name: str, + body: Optional[Union[_models.ChangeKeyVault, IO[bytes]]] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "ChangeKeyVault") + else: + _json = None + + _request = build_change_key_vault_request( + resource_group_name=resource_group_name, + account_name=account_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 [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_change_key_vault( + self, + resource_group_name: str, + account_name: str, + body: Optional[_models.ChangeKeyVault] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Change Key Vault/Managed HSM that is used for encryption of volumes under NetApp account. + + Affects existing volumes that are encrypted with Key Vault/Managed HSM, and new volumes. + Supports MHSM to Key Vault, Key Vault to MHSM, MHSM to MHSM and Key Vault to Key Vault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param body: The required parameters to perform encryption migration. Default value is None. + :type body: ~azure.mgmt.netapp.models.ChangeKeyVault + :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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_change_key_vault( + self, + resource_group_name: str, + account_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Change Key Vault/Managed HSM that is used for encryption of volumes under NetApp account. + + Affects existing volumes that are encrypted with Key Vault/Managed HSM, and new volumes. + Supports MHSM to Key Vault, Key Vault to MHSM, MHSM to MHSM and Key Vault to Key Vault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param body: The required parameters to perform encryption migration. Default value is None. + :type body: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_change_key_vault( + self, + resource_group_name: str, + account_name: str, + body: Optional[Union[_models.ChangeKeyVault, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Change Key Vault/Managed HSM that is used for encryption of volumes under NetApp account. + + Affects existing volumes that are encrypted with Key Vault/Managed HSM, and new volumes. + Supports MHSM to Key Vault, Key Vault to MHSM, MHSM to MHSM and Key Vault to Key Vault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param body: The required parameters to perform encryption migration. Is either a + ChangeKeyVault type or a IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.netapp.models.ChangeKeyVault or IO[bytes] + :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 = 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._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + 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._change_key_vault_initial( # type: ignore + resource_group_name=resource_group_name, + account_name=account_name, + body=body, + 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): # 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/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_policies_operations.py index 3158e7258071..46c7dd2a4a5e 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_policies_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +48,7 @@ def build_list_request(resource_group_name: str, account_name: str, subscription _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +83,7 @@ def build_get_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +119,7 @@ def build_create_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -153,7 +158,7 @@ def build_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -192,7 +197,7 @@ def build_delete_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -262,7 +267,7 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> It api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BackupPoliciesList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -346,7 +351,7 @@ def get( :rtype: ~azure.mgmt.netapp.models.BackupPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -399,7 +404,7 @@ def _create_initial( body: Union[_models.BackupPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.BackupPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -612,7 +617,7 @@ def _update_initial( body: Union[_models.BackupPolicyPatch, IO[bytes]], **kwargs: Any ) -> _models.BackupPolicy: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -819,7 +824,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_vaults_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_vaults_operations.py index a86dd10279ad..3fb562bc97a5 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_vaults_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_vaults_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +50,7 @@ def build_list_by_net_app_account_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +85,7 @@ def build_get_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +123,7 @@ def build_create_or_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -159,7 +164,7 @@ def build_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -200,7 +205,7 @@ def build_delete_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -274,7 +279,7 @@ def list_by_net_app_account( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BackupVaultsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -358,7 +363,7 @@ def get( :rtype: ~azure.mgmt.netapp.models.BackupVault :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -411,7 +416,7 @@ def _create_or_update_initial( body: Union[_models.BackupVault, IO[bytes]], **kwargs: Any ) -> _models.BackupVault: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -623,7 +628,7 @@ def _update_initial( body: Union[_models.BackupVaultPatch, IO[bytes]], **kwargs: Any ) -> _models.BackupVault: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -833,7 +838,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_operations.py index 84960831022a..73d5c5924260 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +50,7 @@ def build_get_latest_status_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +91,7 @@ def build_get_volume_latest_restore_status_request( # pylint: disable=name-too- _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +138,7 @@ def build_list_by_vault_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_get_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,7 @@ def build_create_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -273,7 +278,7 @@ def build_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -322,7 +327,7 @@ def build_delete_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -397,7 +402,7 @@ def get_latest_status( :rtype: ~azure.mgmt.netapp.models.BackupStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def get_volume_latest_restore_status( :rtype: ~azure.mgmt.netapp.models.RestoreStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def list_by_vault( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BackupsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -631,7 +636,7 @@ def get( :rtype: ~azure.mgmt.netapp.models.Backup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -686,7 +691,7 @@ def _create_initial( body: Union[_models.Backup, IO[bytes]], **kwargs: Any ) -> _models.Backup: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -907,7 +912,7 @@ def _update_initial( body: Optional[Union[_models.BackupPatch, IO[bytes]]] = None, **kwargs: Any ) -> _models.Backup: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1128,7 +1133,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_under_account_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_under_account_operations.py index a5d59daf5be7..908a308259c6 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_under_account_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_under_account_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +48,7 @@ def build_migrate_backups_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -101,7 +106,7 @@ def _migrate_backups_initial( # pylint: disable=inconsistent-return-statements body: Union[_models.BackupsMigrationRequest, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_under_backup_vault_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_under_backup_vault_operations.py index bb1a08e89676..352207f2c319 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_under_backup_vault_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_under_backup_vault_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ def build_restore_files_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def _restore_files_initial( # pylint: disable=inconsistent-return-statements body: Union[_models.BackupRestoreFiles, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_under_volume_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_under_volume_operations.py index 155b2e887627..e691cff094f0 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_under_volume_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_under_volume_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +48,7 @@ def build_migrate_backups_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def _migrate_backups_initial( # pylint: disable=inconsistent-return-statements body: Union[_models.BackupsMigrationRequest, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_operations.py index ae2e33bf0ad6..d55fd8a6d71e 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_check_name_availability_request(location: str, subscription_id: str, * _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -73,7 +78,7 @@ def build_check_file_path_availability_request( # pylint: disable=name-too-long _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_check_quota_availability_request(location: str, subscription_id: str, _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -135,7 +140,7 @@ def build_query_region_info_request(location: str, subscription_id: str, **kwarg _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_query_network_sibling_set_request(location: str, subscription_id: str, _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -193,7 +198,7 @@ def build_update_network_sibling_set_request(location: str, subscription_id: str _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -267,7 +272,7 @@ def check_name_availability( :rtype: ~azure.mgmt.netapp.models.CheckAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -318,7 +323,7 @@ def check_name_availability( @distributed_trace def check_file_path_availability( - self, location: str, name: str, subnet_id: str, **kwargs: Any + self, location: str, name: str, subnet_id: str, availability_zone: Optional[str] = None, **kwargs: Any ) -> _models.CheckAvailabilityResponse: """Check file path availability. @@ -331,11 +336,15 @@ def check_file_path_availability( :param subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Required. :type subnet_id: str + :param availability_zone: The Azure Resource logical availability zone which is used within + zone mapping lookup for the subscription and region. The lookup will retrieve the physical zone + where volume is placed. Default value is None. + :type availability_zone: str :return: CheckAvailabilityResponse or the result of cls(response) :rtype: ~azure.mgmt.netapp.models.CheckAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -350,7 +359,7 @@ def check_file_path_availability( content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.CheckAvailabilityResponse] = kwargs.pop("cls", None) - _body = _models.FilePathAvailabilityRequest(name=name, subnet_id=subnet_id) + _body = _models.FilePathAvailabilityRequest(availability_zone=availability_zone, name=name, subnet_id=subnet_id) _json = self._serialize.body(_body, "FilePathAvailabilityRequest") _request = build_check_file_path_availability_request( @@ -412,7 +421,7 @@ def check_quota_availability( :rtype: ~azure.mgmt.netapp.models.CheckAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -473,7 +482,7 @@ def query_region_info(self, location: str, **kwargs: Any) -> _models.RegionInfo: :rtype: ~azure.mgmt.netapp.models.RegionInfo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -538,7 +547,7 @@ def query_network_sibling_set( :rtype: ~azure.mgmt.netapp.models.NetworkSiblingSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -598,7 +607,7 @@ def _update_network_sibling_set_initial( network_features: Union[str, _models.NetworkFeatures] = "Basic", **kwargs: Any ) -> Optional[_models.NetworkSiblingSet]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_quota_limits_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_quota_limits_operations.py index c544e8d11668..45863df50c4a 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_quota_limits_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_quota_limits_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, quota_limit_name: str, subscription_id: str _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,7 +135,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.SubscriptionQu api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SubscriptionQuotaItemList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -208,7 +213,7 @@ def get(self, location: str, quota_limit_name: str, **kwargs: Any) -> _models.Su :rtype: ~azure.mgmt.netapp.models.SubscriptionQuotaItem :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_region_infos_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_region_infos_operations.py index cbb8dc7178a3..4c5c7a4dc9a1 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_region_infos_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_region_infos_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -128,7 +133,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RegionInfoReso api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RegionInfosList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -204,7 +209,7 @@ def get(self, location: str, **kwargs: Any) -> _models.RegionInfoResource: :rtype: ~azure.mgmt.netapp.models.RegionInfoResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py index 2247767d2d27..9b811a4dca90 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(**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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_pools_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_pools_operations.py index df9e9cdb2aad..d1296acd7d8c 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_pools_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +48,7 @@ def build_list_request(resource_group_name: str, account_name: str, subscription _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +83,7 @@ def build_get_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +121,7 @@ def build_create_or_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -157,7 +162,7 @@ def build_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -198,7 +203,7 @@ def build_delete_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -270,7 +275,7 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> It api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CapacityPoolList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -352,7 +357,7 @@ def get(self, resource_group_name: str, account_name: str, pool_name: str, **kwa :rtype: ~azure.mgmt.netapp.models.CapacityPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -405,7 +410,7 @@ def _create_or_update_initial( body: Union[_models.CapacityPool, IO[bytes]], **kwargs: Any ) -> _models.CapacityPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -617,7 +622,7 @@ def _update_initial( body: Union[_models.CapacityPoolPatch, IO[bytes]], **kwargs: Any ) -> Optional[_models.CapacityPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -822,7 +827,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshot_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshot_policies_operations.py index 94bd591aa0c8..45896718e813 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshot_policies_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshot_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +48,7 @@ def build_list_request(resource_group_name: str, account_name: str, subscription _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +83,7 @@ def build_get_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +119,7 @@ def build_create_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -153,7 +158,7 @@ def build_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -192,7 +197,7 @@ def build_delete_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -228,7 +233,7 @@ def build_list_volumes_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -296,7 +301,7 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> It api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SnapshotPoliciesList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def get( :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -508,7 +513,7 @@ def create( :rtype: ~azure.mgmt.netapp.models.SnapshotPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ def _update_initial( body: Union[_models.SnapshotPolicyPatch, IO[bytes]], **kwargs: Any ) -> _models.SnapshotPolicy: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -778,7 +783,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, snapshot_policy_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -897,7 +902,7 @@ def list_volumes( :rtype: ~azure.mgmt.netapp.models.SnapshotPolicyVolumeList :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py index 168f7c8f8d5f..fd59485ca690 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -51,7 +51,7 @@ def build_list_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_create_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -199,7 +199,7 @@ def build_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -250,7 +250,7 @@ def build_delete_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -298,7 +298,7 @@ def build_restore_files_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -383,7 +383,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SnapshotsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -479,7 +479,7 @@ def get( :rtype: ~azure.mgmt.netapp.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -536,7 +536,7 @@ def _create_initial( body: Union[_models.Snapshot, IO[bytes]], **kwargs: Any ) -> Optional[_models.Snapshot]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -767,7 +767,7 @@ def _update_initial( body: JSON, **kwargs: Any ) -> Optional[_models.Snapshot]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -913,7 +913,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements snapshot_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1039,7 +1039,7 @@ def _restore_files_initial( # pylint: disable=inconsistent-return-statements body: Union[_models.SnapshotRestoreFiles, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_subvolumes_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_subvolumes_operations.py index d184b58011f2..00ed570db2d6 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_subvolumes_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_subvolumes_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +50,7 @@ def build_list_by_volume_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,7 @@ def build_get_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -147,7 +152,7 @@ def build_create_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -205,7 +210,7 @@ def build_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -263,7 +268,7 @@ def build_delete_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -318,7 +323,7 @@ def build_get_metadata_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -407,7 +412,7 @@ def list_by_volume( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SubvolumesList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -503,7 +508,7 @@ def get( :rtype: ~azure.mgmt.netapp.models.SubvolumeInfo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +565,7 @@ def _create_initial( body: Union[_models.SubvolumeInfo, IO[bytes]], **kwargs: Any ) -> Optional[_models.SubvolumeInfo]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -797,7 +802,7 @@ def _update_initial( body: Union[_models.SubvolumePatchRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.SubvolumeInfo]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1030,7 +1035,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements subvolume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1155,7 +1160,7 @@ def _get_metadata_initial( subvolume_name: str, **kwargs: Any ) -> Optional[_models.SubvolumeModel]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_groups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_groups_operations.py index b132446d7d94..9fa423dd755f 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_groups_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +50,7 @@ def build_list_by_net_app_account_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +85,7 @@ def build_get_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +128,7 @@ def build_create_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -169,7 +174,7 @@ def build_delete_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -248,7 +253,7 @@ def list_by_net_app_account( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VolumeGroupList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -332,7 +337,7 @@ def get( :rtype: ~azure.mgmt.netapp.models.VolumeGroupDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -385,7 +390,7 @@ def _create_initial( body: Union[_models.VolumeGroupDetails, IO[bytes]], **kwargs: Any ) -> _models.VolumeGroupDetails: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -592,7 +597,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, volume_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_quota_rules_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_quota_rules_operations.py index 76f20a07ea33..e6c694342af3 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_quota_rules_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_quota_rules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +50,7 @@ def build_list_by_volume_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,7 @@ def build_get_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_create_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -191,7 +196,7 @@ def build_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -242,7 +247,7 @@ def build_delete_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +329,7 @@ def list_by_volume( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VolumeQuotaRulesList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -420,7 +425,7 @@ def get( :rtype: ~azure.mgmt.netapp.models.VolumeQuotaRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -477,7 +482,7 @@ def _create_initial( body: Union[_models.VolumeQuotaRule, IO[bytes]], **kwargs: Any ) -> _models.VolumeQuotaRule: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -713,7 +718,7 @@ def _update_initial( body: Union[_models.VolumeQuotaRulePatch, IO[bytes]], **kwargs: Any ) -> Optional[_models.VolumeQuotaRule]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -946,7 +951,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements volume_quota_rule_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py index ac3cb2edcf18..235e17c05932 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +50,7 @@ def build_list_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_get_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -124,7 +129,7 @@ def build_create_or_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -168,7 +173,7 @@ def build_update_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -219,7 +224,7 @@ def build_delete_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -262,7 +267,7 @@ def build_populate_availability_zone_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -303,7 +308,7 @@ def build_revert_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -347,7 +352,7 @@ def build_reset_cifs_password_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -382,13 +387,54 @@ def build_reset_cifs_password_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_split_clone_from_parent_request( + resource_group_name: str, account_name: str, pool_name: str, volume_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-11-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/splitCloneFromParent", + ) # 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", max_length=90, min_length=1 + ), + "accountName": _SERIALIZER.url( + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" + ), + "poolName": _SERIALIZER.url( + "pool_name", pool_name, "str", max_length=64, min_length=1, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$" + ), + "volumeName": _SERIALIZER.url( + "volume_name", volume_name, "str", max_length=64, min_length=1, pattern=r"^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$" + ), + } + + _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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_break_file_locks_request( resource_group_name: str, account_name: str, pool_name: str, volume_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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -432,7 +478,7 @@ def build_list_get_group_id_list_for_ldap_user_request( # pylint: disable=name- _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -476,7 +522,7 @@ def build_break_replication_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -520,7 +566,7 @@ def build_reestablish_replication_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -564,7 +610,7 @@ def build_replication_status_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -605,7 +651,7 @@ def build_list_replications_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -646,7 +692,7 @@ def build_resync_replication_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -687,7 +733,7 @@ def build_delete_replication_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -728,7 +774,7 @@ def build_authorize_replication_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -772,7 +818,7 @@ def build_re_initialize_replication_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -807,13 +853,180 @@ def build_re_initialize_replication_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_peer_cluster_for_on_prem_migration_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, pool_name: str, volume_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-11-01-preview")) + 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/peerClusterForOnPremMigration", + ) # 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", max_length=90, min_length=1 + ), + "accountName": _SERIALIZER.url( + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" + ), + "poolName": _SERIALIZER.url( + "pool_name", pool_name, "str", max_length=64, min_length=1, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$" + ), + "volumeName": _SERIALIZER.url( + "volume_name", volume_name, "str", max_length=64, min_length=1, pattern=r"^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$" + ), + } + + _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_create_on_prem_migration_replication_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, pool_name: str, volume_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-11-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/createOnPremMigrationReplication", + ) # 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", max_length=90, min_length=1 + ), + "accountName": _SERIALIZER.url( + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" + ), + "poolName": _SERIALIZER.url( + "pool_name", pool_name, "str", max_length=64, min_length=1, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$" + ), + "volumeName": _SERIALIZER.url( + "volume_name", volume_name, "str", max_length=64, min_length=1, pattern=r"^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$" + ), + } + + _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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_finalize_on_prem_migration_request( + resource_group_name: str, account_name: str, pool_name: str, volume_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-11-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/finalizeOnPremMigration", + ) # 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", max_length=90, min_length=1 + ), + "accountName": _SERIALIZER.url( + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" + ), + "poolName": _SERIALIZER.url( + "pool_name", pool_name, "str", max_length=64, min_length=1, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$" + ), + "volumeName": _SERIALIZER.url( + "volume_name", volume_name, "str", max_length=64, min_length=1, pattern=r"^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$" + ), + } + + _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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_perform_replication_transfer_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, pool_name: str, volume_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-11-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/performReplicationTransfer", + ) # 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", max_length=90, min_length=1 + ), + "accountName": _SERIALIZER.url( + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" + ), + "poolName": _SERIALIZER.url( + "pool_name", pool_name, "str", max_length=64, min_length=1, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$" + ), + "volumeName": _SERIALIZER.url( + "volume_name", volume_name, "str", max_length=64, min_length=1, pattern=r"^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$" + ), + } + + _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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_pool_change_request( resource_group_name: str, account_name: str, pool_name: str, volume_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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -857,7 +1070,7 @@ def build_relocate_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -901,7 +1114,7 @@ def build_finalize_relocation_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -942,7 +1155,7 @@ def build_revert_relocation_request( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1021,7 +1234,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VolumeList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1108,7 +1321,7 @@ def get( :rtype: ~azure.mgmt.netapp.models.Volume :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1163,7 +1376,7 @@ def _create_or_update_initial( body: Union[_models.Volume, IO[bytes]], **kwargs: Any ) -> Optional[_models.Volume]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1385,7 +1598,7 @@ def _update_initial( body: Union[_models.VolumePatch, IO[bytes]], **kwargs: Any ) -> Optional[_models.Volume]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1604,7 +1817,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements force_delete: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1724,7 +1937,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _populate_availability_zone_initial( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> Optional[_models.Volume]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1853,7 +2066,7 @@ def _revert_initial( # pylint: disable=inconsistent-return-statements body: Union[_models.VolumeRevert, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2056,7 +2269,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _reset_cifs_password_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2163,16 +2376,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - def _break_file_locks_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[Union[_models.BreakFileLocksRequest, IO[bytes]]] = None, - **kwargs: Any + def _split_clone_from_parent_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2180,34 +2387,19 @@ def _break_file_locks_initial( # pylint: disable=inconsistent-return-statements } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _json = self._serialize.body(body, "BreakFileLocksRequest") - else: - _json = None - - _request = build_break_file_locks_request( + _request = build_split_clone_from_parent_request( resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -2221,33 +2413,24 @@ def _break_file_locks_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: return cls(pipeline_response, None, response_headers) # type: ignore - @overload - def begin_break_file_locks( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[_models.BreakFileLocksRequest] = None, - *, - content_type: str = "application/json", - **kwargs: Any + @distributed_trace + def begin_split_clone_from_parent( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> LROPoller[None]: - """Break file locks. + """Split clone from parent volume. - Break all the file locks on a volume. + Split operation to convert clone volume to an independent volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2258,25 +2441,167 @@ def begin_break_file_locks( :type pool_name: str :param volume_name: The name of the volume. Required. :type volume_name: str - :param body: Optional body to provide the ability to clear file locks with selected options. - Default value is None. - :type body: ~azure.mgmt.netapp.models.BreakFileLocksRequest - :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 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 {}) - @overload - def begin_break_file_locks( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - body: Optional[IO[bytes]] = None, + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + 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._split_clone_from_parent_initial( # type: ignore + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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 + + def _break_file_locks_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[Union[_models.BreakFileLocksRequest, IO[bytes]]] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "BreakFileLocksRequest") + else: + _json = None + + _request = build_break_file_locks_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_break_file_locks( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[_models.BreakFileLocksRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Break file locks. + + Break all the file locks on a volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Optional body to provide the ability to clear file locks with selected options. + Default value is None. + :type body: ~azure.mgmt.netapp.models.BreakFileLocksRequest + :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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_break_file_locks( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2390,7 +2715,7 @@ def _list_get_group_id_list_for_ldap_user_initial( # pylint: disable=name-too-l body: Union[_models.GetGroupIdListForLDAPUserRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.GetGroupIdListForLDAPUserResponse]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2619,7 +2944,7 @@ def _break_replication_initial( # pylint: disable=inconsistent-return-statement body: Optional[Union[_models.BreakReplicationRequest, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2831,7 +3156,7 @@ def _reestablish_replication_initial( # pylint: disable=inconsistent-return-sta body: Union[_models.ReestablishReplicationRequest, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3055,7 +3380,7 @@ def replication_status( :rtype: ~azure.mgmt.netapp.models.ReplicationStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3128,7 +3453,7 @@ def list_replications( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ListReplications] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3198,7 +3523,7 @@ def get_next(next_link=None): def _resync_replication_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3308,7 +3633,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_replication_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3424,7 +3749,7 @@ def _authorize_replication_initial( # pylint: disable=inconsistent-return-state body: Union[_models.AuthorizeRequest, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3627,7 +3952,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _re_initialize_replication_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3733,6 +4058,582 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + def _peer_cluster_for_on_prem_migration_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Union[_models.PeerClusterForVolumeMigrationRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ClusterPeerCommandResponse]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ClusterPeerCommandResponse]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "PeerClusterForVolumeMigrationRequest") + + _request = build_peer_cluster_for_on_prem_migration_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ClusterPeerCommandResponse", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_peer_cluster_for_on_prem_migration( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: _models.PeerClusterForVolumeMigrationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ClusterPeerCommandResponse]: + """Start Cluster peering. + + Starts peering the cluster for this migration volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Cluster peer request object supplied in the body of the operation. Required. + :type body: ~azure.mgmt.netapp.models.PeerClusterForVolumeMigrationRequest + :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 ClusterPeerCommandResponse or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_peer_cluster_for_on_prem_migration( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ClusterPeerCommandResponse]: + """Start Cluster peering. + + Starts peering the cluster for this migration volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Cluster peer request object supplied in the body of the operation. Required. + :type body: 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 ClusterPeerCommandResponse or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_peer_cluster_for_on_prem_migration( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + body: Union[_models.PeerClusterForVolumeMigrationRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ClusterPeerCommandResponse]: + """Start Cluster peering. + + Starts peering the cluster for this migration volume. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :param body: Cluster peer request object supplied in the body of the operation. Is either a + PeerClusterForVolumeMigrationRequest type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.netapp.models.PeerClusterForVolumeMigrationRequest or IO[bytes] + :return: An instance of LROPoller that returns either ClusterPeerCommandResponse or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.ClusterPeerCommandResponse] + :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._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterPeerCommandResponse] = 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._peer_cluster_for_on_prem_migration_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + body=body, + 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("ClusterPeerCommandResponse", 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.ClusterPeerCommandResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ClusterPeerCommandResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _create_on_prem_migration_replication_initial( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> Optional[_models.SvmPeerCommandResponse]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + cls: ClsType[Optional[_models.SvmPeerCommandResponse]] = kwargs.pop("cls", None) + + _request = build_create_on_prem_migration_replication_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("SvmPeerCommandResponse", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_create_on_prem_migration_replication( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> LROPoller[_models.SvmPeerCommandResponse]: + """Start migration process. + + Starts SVM peering and returns a command to be run on the external ONTAP to accept it. Once + the SVMs have been peered a SnapMirror will be created. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_name: str + :return: An instance of LROPoller that returns either SvmPeerCommandResponse or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SvmPeerCommandResponse] + :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._config.api_version)) + cls: ClsType[_models.SvmPeerCommandResponse] = 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_on_prem_migration_replication_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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): + deserialized = self._deserialize("SvmPeerCommandResponse", 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.SvmPeerCommandResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SvmPeerCommandResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _finalize_on_prem_migration_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_finalize_on_prem_migration_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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 [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_finalize_on_prem_migration( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Finalize migration process. + + Finalizes the migration of a volume by performing a final sync on the replication, breaking and + releasing the replication, and breaking the cluster peering if no other migration is active. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_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._config.api_version)) + 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._finalize_on_prem_migration_initial( # type: ignore + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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 + + def _perform_replication_transfer_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_perform_replication_transfer_request( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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 [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_perform_replication_transfer( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Perform a replication transfer. + + Performs an adhoc replication transfer on a volume with volumeType Migration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of the NetApp account. Required. + :type account_name: str + :param pool_name: The name of the capacity pool. Required. + :type pool_name: str + :param volume_name: The name of the volume. Required. + :type volume_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._config.api_version)) + 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._perform_replication_transfer_initial( # type: ignore + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_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 + def _pool_change_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, @@ -3742,7 +4643,7 @@ def _pool_change_initial( # pylint: disable=inconsistent-return-statements body: Union[_models.PoolChangeRequest, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3951,7 +4852,7 @@ def _relocate_initial( # pylint: disable=inconsistent-return-statements body: Optional[Union[_models.RelocateVolumeRequest, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4155,7 +5056,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _finalize_relocation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4262,7 +5163,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _revert_relocation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_change_key_vault.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_change_key_vault.py new file mode 100644 index 000000000000..2b4e50f9d3dd --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_change_key_vault.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.netapp import NetAppManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-netapp +# USAGE + python accounts_change_key_vault.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = NetAppManagementClient( + credential=DefaultAzureCredential(), + subscription_id="D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", + ) + + client.accounts.begin_change_key_vault( + resource_group_name="myRG", + account_name="account1", + ).result() + + +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Accounts_ChangeKeyVault.json +if __name__ == "__main__": + main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update.py index 2f42a5f7f731..b7ad0afe34cf 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Accounts_CreateOrUpdate.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Accounts_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update_ad.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update_ad.py index 861c79dc7063..afc1ba7129db 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update_ad.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_create_or_update_ad.py @@ -58,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Accounts_CreateOrUpdateAD.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Accounts_CreateOrUpdateAD.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_delete.py index ce96aac17e7a..2c9035497a7d 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Accounts_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Accounts_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get.py index 86139f32f663..f2ce737969b4 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Accounts_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Accounts_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get_change_key_vault_information.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get_change_key_vault_information.py new file mode 100644 index 000000000000..63b7a83b0044 --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get_change_key_vault_information.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.netapp import NetAppManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-netapp +# USAGE + python accounts_get_change_key_vault_information.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = NetAppManagementClient( + credential=DefaultAzureCredential(), + subscription_id="D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", + ) + + client.accounts.begin_get_change_key_vault_information( + resource_group_name="myRG", + account_name="account1", + ).result() + + +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Accounts_GetChangeKeyVaultInformation.json +if __name__ == "__main__": + main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list.py index 6cb1ee47e0f5..3adb6ac7eb69 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Accounts_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Accounts_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_migrate_encryption_key.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_migrate_encryption_key.py new file mode 100644 index 000000000000..489e650c7bb1 --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_migrate_encryption_key.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.netapp import NetAppManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-netapp +# USAGE + python accounts_migrate_encryption_key.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = NetAppManagementClient( + credential=DefaultAzureCredential(), + subscription_id="D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", + ) + + client.accounts.begin_migrate_encryption_key( + resource_group_name="myRG", + account_name="account1", + ).result() + + +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Accounts_MigrateEncryptionKey.json +if __name__ == "__main__": + main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_renew_credentials.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_renew_credentials.py index 22774e0e8e42..1bef9bf906cf 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_renew_credentials.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_renew_credentials.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Accounts_RenewCredentials.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Accounts_RenewCredentials.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_update.py index fb083aec4f19..fb196fc541f1 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_update.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Accounts_Update.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Accounts_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_create.py index 0617d35c47a9..04b4f4d052ab 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_create.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupPolicies_Create.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupPolicies_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_delete.py index 6d9a5fe5ae0e..370d6c18851b 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupPolicies_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupPolicies_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_get.py index b7e05b5bf48a..f93a557d8fe2 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupPolicies_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupPolicies_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_list.py index c99d6914411a..cb1557746a00 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupPolicies_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupPolicies_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_update.py index 7b3af6e905b8..2f166be4ede6 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_policies_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupPolicies_Update.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupPolicies_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_create.py index 1bc26721822d..fe96106a8df9 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_create.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupVaults_Create.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupVaults_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_delete.py index 573bf719c2f6..be6bae816c28 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupVaults_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupVaults_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_get.py index dadf9782f97b..acb8cd4215b0 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupVaults_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupVaults_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_list.py index a89d4aeaebea..8e0788937666 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupVaults_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupVaults_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_update.py index 887accae4838..7727909fe275 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backup_vaults_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupVaults_Update.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupVaults_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_account_migrate.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_account_migrate.py index f22dcd78b3af..69b828ac1259 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_account_migrate.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_account_migrate.py @@ -41,6 +41,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupsUnderAccount_Migrate.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupsUnderAccount_Migrate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_create.py index 9768736b0a7f..e1a810b03660 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_create.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupsUnderBackupVault_Create.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupsUnderBackupVault_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_delete.py index 1c82cc1e27f1..7678d73b57b7 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupsUnderBackupVault_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupsUnderBackupVault_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_get.py index ccd9fb2645ee..faffeb5ed584 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupsUnderBackupVault_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupsUnderBackupVault_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_list.py index 61721633b672..9e8af34572ff 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupsUnderBackupVault_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupsUnderBackupVault_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_single_file_restore.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_single_file_restore.py index 48628f8e9ada..340e3cd409e8 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_single_file_restore.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_single_file_restore.py @@ -44,6 +44,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupsUnderBackupVault_SingleFileRestore.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupsUnderBackupVault_SingleFileRestore.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_update.py index 82f0d5bd7f59..680072d8187f 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_backup_vault_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupsUnderBackupVault_Update.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupsUnderBackupVault_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_volume_migrate.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_volume_migrate.py index 3f170ce7b957..a00c7107213e 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_volume_migrate.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_under_volume_migrate.py @@ -43,6 +43,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/BackupsUnderVolume_Migrate.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/BackupsUnderVolume_Migrate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/group_id_list_for_ldap_user.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/group_id_list_for_ldap_user.py index 5c49dee9b65c..18da7a29bb70 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/group_id_list_for_ldap_user.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/group_id_list_for_ldap_user.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/GroupIdListForLDAPUser.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/GroupIdListForLDAPUser.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/operation_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/operation_list.py index ba30d6b72c80..6df4b78f1289 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/operation_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/operation_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/OperationList.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/OperationList.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_create_or_update.py index 615d6a654665..1b1b7049fbc6 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_create_or_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_create_or_update.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Pools_CreateOrUpdate.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Pools_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_delete.py index e06330d58eb8..9f084974457b 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Pools_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Pools_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get.py index 3c01d19d4928..48c3aaf0b220 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Pools_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Pools_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_list.py index 8795f484955d..d6f6b4b4cc8b 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Pools_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Pools_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/quota_limits_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/quota_limits_get.py index bf3ce4a9ae96..546fa437a0b4 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/quota_limits_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/quota_limits_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/QuotaLimits_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/QuotaLimits_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/quota_limits_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/quota_limits_list.py index 211f2713867d..6fa8a5a00283 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/quota_limits_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/quota_limits_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/QuotaLimits_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/QuotaLimits_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/region_info.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/region_info.py index 03f595a5c2ba..d42e4618ac8a 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/region_info.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/region_info.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/RegionInfo.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/RegionInfo.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_get.py index b032578d6b42..38e4beecc6e7 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/RegionInfos_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/RegionInfos_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_list.py index 54c4cb4cab36..39867da55cee 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/region_infos_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/RegionInfos_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/RegionInfos_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_create.py index ff82de19580c..d6eb44951dd8 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_create.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/SnapshotPolicies_Create.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/SnapshotPolicies_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_delete.py index bea0266e3602..68da6bfde590 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/SnapshotPolicies_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/SnapshotPolicies_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_get.py index effc8aa158d1..1c2c8b115ccb 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/SnapshotPolicies_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/SnapshotPolicies_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list.py index 2abd8047ebc7..a53b7806f719 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/SnapshotPolicies_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/SnapshotPolicies_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list_volumes.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list_volumes.py index 39ae4b023a5e..063efd1a4036 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list_volumes.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_list_volumes.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/SnapshotPolicies_ListVolumes.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/SnapshotPolicies_ListVolumes.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_update.py index dd224f3074aa..f9109e86b48c 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshot_policies_update.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/SnapshotPolicies_Update.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/SnapshotPolicies_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_create.py index 72f61f38c807..ef073d0fc595 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_create.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Snapshots_Create.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Snapshots_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_delete.py index 172c57c376d5..14e1abde8db8 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Snapshots_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Snapshots_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_get.py index 4913247316f2..0f3ee7ad9a30 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Snapshots_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Snapshots_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_list.py index d32cdefe3482..870fe74b8180 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Snapshots_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Snapshots_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_single_file_restore.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_single_file_restore.py index 37a458105e9a..221294c5c0f2 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_single_file_restore.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_single_file_restore.py @@ -42,6 +42,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Snapshots_SingleFileRestore.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Snapshots_SingleFileRestore.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_create.py index 10042af443fa..1d0fd3221f3a 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_create.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Subvolumes_Create.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Subvolumes_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_delete.py index 4f66255d495c..7f8038915dfb 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Subvolumes_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Subvolumes_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_get.py index c67001d05e35..2ca23526323f 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Subvolumes_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Subvolumes_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_list.py index f13fce4fe29c..5a4d454b308f 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Subvolumes_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Subvolumes_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_metadata.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_metadata.py index ce127721a8d6..b150c5a0fdcf 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_metadata.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_metadata.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Subvolumes_Metadata.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Subvolumes_Metadata.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_update.py index 3f3c91677287..abb2c1484abd 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Subvolumes_Update.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Subvolumes_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_oracle.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_oracle.py index efe3709aea90..a3abe778d2bc 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_oracle.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_oracle.py @@ -460,6 +460,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/VolumeGroups_Create_Oracle.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/VolumeGroups_Create_Oracle.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_sap_hana.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_sap_hana.py index 4d2966eaa9b7..7e4c3178fc33 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_sap_hana.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_sap_hana.py @@ -222,6 +222,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/VolumeGroups_Create_SapHana.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/VolumeGroups_Create_SapHana.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_delete.py index fde0cac71dc6..2300bb5fd76b 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/VolumeGroups_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/VolumeGroups_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_oracle.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_oracle.py index 728904c0063a..30838bcc307f 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_oracle.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_oracle.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/VolumeGroups_Get_Oracle.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/VolumeGroups_Get_Oracle.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_sap_hana.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_sap_hana.py index b7270c98f4e7..0b9548e28ce7 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_sap_hana.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_sap_hana.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/VolumeGroups_Get_SapHana.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/VolumeGroups_Get_SapHana.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_oracle.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_oracle.py index 1538da7ec9a8..3acd150a1a08 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_oracle.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_oracle.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/VolumeGroups_List_Oracle.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/VolumeGroups_List_Oracle.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_sap_hana.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_sap_hana.py index db769c62191c..72762949092d 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_sap_hana.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_sap_hana.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/VolumeGroups_List_SapHana.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/VolumeGroups_List_SapHana.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_create.py index d260f055e9f3..00462efbb5c3 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_create.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/VolumeQuotaRules_Create.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/VolumeQuotaRules_Create.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_delete.py index f8038a61ba7e..0ad73313dc07 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/VolumeQuotaRules_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/VolumeQuotaRules_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_get.py index bb2a11d7e6ea..003a4621d3e3 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/VolumeQuotaRules_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/VolumeQuotaRules_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_list.py index 037f562ded4e..ecacf25d9d49 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/VolumeQuotaRules_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/VolumeQuotaRules_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_update.py index a2d6cd23c683..5c65b3cff21e 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_quota_rules_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/VolumeQuotaRules_Update.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/VolumeQuotaRules_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_authorize_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_authorize_replication.py index 21e9d38d3d1f..ef0bb4f8d275 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_authorize_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_authorize_replication.py @@ -43,6 +43,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_AuthorizeReplication.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_AuthorizeReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_file_locks.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_file_locks.py index 85159711a4ff..cb4eb46168ed 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_file_locks.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_file_locks.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_BreakFileLocks.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_BreakFileLocks.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_replication.py index b31f4b5195d8..6bed27559078 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_break_replication.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_BreakReplication.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_BreakReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_create_on_prem_migration_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_create_on_prem_migration_replication.py new file mode 100644 index 000000000000..7051613bfc17 --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_create_on_prem_migration_replication.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.netapp import NetAppManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-netapp +# USAGE + python volumes_create_on_prem_migration_replication.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = NetAppManagementClient( + credential=DefaultAzureCredential(), + subscription_id="D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", + ) + + response = client.volumes.begin_create_on_prem_migration_replication( + resource_group_name="myRG", + account_name="account1", + pool_name="pool1", + volume_name="volume1", + ).result() + print(response) + + +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_CreateOnPremMigrationReplication.json +if __name__ == "__main__": + main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_create_or_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_create_or_update.py index 3ef2fd47843d..7831544ade47 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_create_or_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_create_or_update.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_CreateOrUpdate.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete.py index bfa9249148d5..7cf2eb201985 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete_replication.py index 685395c0f7e4..57c46e2513b2 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete_replication.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_DeleteReplication.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_DeleteReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_on_prem_migration.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_on_prem_migration.py new file mode 100644 index 000000000000..93b447c29de5 --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_on_prem_migration.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.netapp import NetAppManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-netapp +# USAGE + python volumes_finalize_on_prem_migration.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = NetAppManagementClient( + credential=DefaultAzureCredential(), + subscription_id="D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", + ) + + client.volumes.begin_finalize_on_prem_migration( + resource_group_name="myRG", + account_name="account1", + pool_name="pool1", + volume_name="volume1", + ).result() + + +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_FinalizeOnPremMigration.json +if __name__ == "__main__": + main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_relocation.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_relocation.py index ff960dd1e608..f6eb40fda2af 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_relocation.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_finalize_relocation.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_FinalizeRelocation.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_FinalizeRelocation.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_get.py index 8c7a8354df12..aed1f2485b8a 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_Get.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_backup_status.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_backup_status.py index 4162ca533d2f..688403a596f0 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_backup_status.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_backup_status.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_LatestBackupStatus.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_LatestBackupStatus.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_restore_status.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_restore_status.py index 69241819efc7..a961789898e0 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_restore_status.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_latest_restore_status.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_LatestRestoreStatus.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_LatestRestoreStatus.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list.py index 7fb20b9a1ee6..8ad76e2df068 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_List.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list_replications.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list_replications.py index 21d1942e98da..ad5d7d888180 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list_replications.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list_replications.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_ListReplications.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_ListReplications.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_peer_cluster_for_on_prem_migration.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_peer_cluster_for_on_prem_migration.py new file mode 100644 index 000000000000..6ef1de7ef3ed --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_peer_cluster_for_on_prem_migration.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.netapp import NetAppManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-netapp +# USAGE + python volumes_peer_cluster_for_on_prem_migration.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = NetAppManagementClient( + credential=DefaultAzureCredential(), + subscription_id="D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", + ) + + response = client.volumes.begin_peer_cluster_for_on_prem_migration( + resource_group_name="myRG", + account_name="account1", + pool_name="pool1", + volume_name="volume1", + body={"peerAddresses": ["0.0.0.1", "0.0.0.2", "0.0.0.3", "0.0.0.4", "0.0.0.5", "0.0.0.6"]}, + ).result() + print(response) + + +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_PeerClusterForOnPremMigration.json +if __name__ == "__main__": + main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_perform_replication_transfer.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_perform_replication_transfer.py new file mode 100644 index 000000000000..57ee39cca0da --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_perform_replication_transfer.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.netapp import NetAppManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-netapp +# USAGE + python volumes_perform_replication_transfer.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = NetAppManagementClient( + credential=DefaultAzureCredential(), + subscription_id="D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", + ) + + client.volumes.begin_perform_replication_transfer( + resource_group_name="myRG", + account_name="account1", + pool_name="pool1", + volume_name="volume1", + ).result() + + +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_PerformReplicationTransfer.json +if __name__ == "__main__": + main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_pool_change.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_pool_change.py index 033088e94161..45f680822d4a 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_pool_change.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_pool_change.py @@ -43,6 +43,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_PoolChange.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_PoolChange.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_populate_availability_zones.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_populate_availability_zones.py index aff601242928..a474f9fecb8b 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_populate_availability_zones.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_populate_availability_zones.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_PopulateAvailabilityZones.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_PopulateAvailabilityZones.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_re_initialize_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_re_initialize_replication.py index fa5ea44aaa6a..97992ef4fd03 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_re_initialize_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_re_initialize_replication.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_ReInitializeReplication.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_ReInitializeReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reestablish_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reestablish_replication.py index 90a1e5417849..d98ae0eb1b97 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reestablish_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reestablish_replication.py @@ -43,6 +43,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_ReestablishReplication.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_ReestablishReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_relocate.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_relocate.py index 4ac5de68a2d4..d8ede1d11513 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_relocate.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_relocate.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_Relocate.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_Relocate.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_replication_status.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_replication_status.py index ff0cd7736bd3..5b91af2838bb 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_replication_status.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_replication_status.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_ReplicationStatus.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_ReplicationStatus.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reset_cifs_password.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reset_cifs_password.py index e7462dcd0e08..e7b88e6b1705 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reset_cifs_password.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_reset_cifs_password.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_ResetCifsPassword.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_ResetCifsPassword.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_resync_replication.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_resync_replication.py index 6a5d25977a24..0c5b117216e9 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_resync_replication.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_resync_replication.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_ResyncReplication.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_ResyncReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert.py index 5d0bb531d4eb..6424ac207def 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert.py @@ -43,6 +43,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_Revert.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_Revert.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert_relocation.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert_relocation.py index 10f88c331e28..fd35dfbd55f1 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert_relocation.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert_relocation.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-11-01/examples/Volumes_RevertRelocation.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_RevertRelocation.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_split_clone.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_split_clone.py new file mode 100644 index 000000000000..dd5c518645ef --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_split_clone.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.netapp import NetAppManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-netapp +# USAGE + python volumes_split_clone.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = NetAppManagementClient( + credential=DefaultAzureCredential(), + subscription_id="D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", + ) + + client.volumes.begin_split_clone_from_parent( + resource_group_name="myRG", + account_name="account1", + pool_name="pool1", + volume_name="volume1", + ).result() + + +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-11-01-preview/examples/Volumes_SplitClone.json +if __name__ == "__main__": + main()