diff --git a/sdk/netapp/azure-mgmt-netapp/_meta.json b/sdk/netapp/azure-mgmt-netapp/_meta.json index 17a262297a08..70e447316192 100644 --- a/sdk/netapp/azure-mgmt-netapp/_meta.json +++ b/sdk/netapp/azure-mgmt-netapp/_meta.json @@ -1,11 +1,11 @@ { - "commit": "9aec843715b0bc99bef5bd26f50939ddc3f7b632", + "commit": "9b4ddc89b216b572c92fe7773c5927cfebf292a6", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.2", + "autorest": "3.9.7", "use": [ - "@autorest/python@6.6.0", - "@autorest/modelerfour@4.24.3" + "@autorest/python@6.7.1", + "@autorest/modelerfour@4.26.2" ], - "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.6.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --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.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --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 0692fdaa8818..61f445782e02 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py @@ -29,14 +29,14 @@ class NetAppManagementClientConfiguration(Configuration): # pylint: disable=too :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-05-01". 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: super(NetAppManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-11-01") + api_version: str = kwargs.pop("api_version", "2023-05-01") 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 4589914f5490..cbea9511ac0d 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 @@ -16,7 +16,6 @@ from ._configuration import NetAppManagementClientConfiguration from ._serialization import Deserializer, Serializer from .operations import ( - AccountBackupsOperations, AccountsOperations, BackupPoliciesOperations, BackupsOperations, @@ -59,8 +58,6 @@ class NetAppManagementClient: # pylint: disable=client-accepts-api-version-keyw :vartype snapshot_policies: azure.mgmt.netapp.operations.SnapshotPoliciesOperations :ivar backups: BackupsOperations operations :vartype backups: azure.mgmt.netapp.operations.BackupsOperations - :ivar account_backups: AccountBackupsOperations operations - :vartype account_backups: azure.mgmt.netapp.operations.AccountBackupsOperations :ivar backup_policies: BackupPoliciesOperations operations :vartype backup_policies: azure.mgmt.netapp.operations.BackupPoliciesOperations :ivar volume_quota_rules: VolumeQuotaRulesOperations operations @@ -75,7 +72,7 @@ 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 "2022-11-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-05-01". 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 @@ -111,7 +108,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.backups = BackupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.account_backups = AccountBackupsOperations(self._client, self._config, self._serialize, self._deserialize) self.backup_policies = BackupPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) self.volume_quota_rules = VolumeQuotaRulesOperations( self._client, self._config, self._serialize, self._deserialize diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_serialization.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_serialization.py index 842ae727fbbc..4bae2292227b 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_serialization.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_serialization.py @@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -741,6 +742,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -749,10 +752,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get("skip_quote", False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_vendor.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_vendor.py index bd0df84f5319..0dafe0e287ff 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_vendor.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) 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 c1257f7f4e11..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 = "10.1.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 49de2df62705..c4cf49406778 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 @@ -29,14 +29,14 @@ class NetAppManagementClientConfiguration(Configuration): # pylint: disable=too :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-05-01". 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: super(NetAppManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-11-01") + api_version: str = kwargs.pop("api_version", "2023-05-01") 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 2ec98746d92f..586e2b16fd2d 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 @@ -16,7 +16,6 @@ from .._serialization import Deserializer, Serializer from ._configuration import NetAppManagementClientConfiguration from .operations import ( - AccountBackupsOperations, AccountsOperations, BackupPoliciesOperations, BackupsOperations, @@ -59,8 +58,6 @@ class NetAppManagementClient: # pylint: disable=client-accepts-api-version-keyw :vartype snapshot_policies: azure.mgmt.netapp.aio.operations.SnapshotPoliciesOperations :ivar backups: BackupsOperations operations :vartype backups: azure.mgmt.netapp.aio.operations.BackupsOperations - :ivar account_backups: AccountBackupsOperations operations - :vartype account_backups: azure.mgmt.netapp.aio.operations.AccountBackupsOperations :ivar backup_policies: BackupPoliciesOperations operations :vartype backup_policies: azure.mgmt.netapp.aio.operations.BackupPoliciesOperations :ivar volume_quota_rules: VolumeQuotaRulesOperations operations @@ -75,7 +72,7 @@ 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 "2022-11-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-05-01". 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 @@ -111,7 +108,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.backups = BackupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.account_backups = AccountBackupsOperations(self._client, self._config, self._serialize, self._deserialize) self.backup_policies = BackupPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) self.volume_quota_rules = VolumeQuotaRulesOperations( self._client, self._config, self._serialize, self._deserialize diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py index 3a7f07fd87ec..207ff3039ab7 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py @@ -15,7 +15,6 @@ from ._snapshots_operations import SnapshotsOperations from ._snapshot_policies_operations import SnapshotPoliciesOperations from ._backups_operations import BackupsOperations -from ._account_backups_operations import AccountBackupsOperations from ._backup_policies_operations import BackupPoliciesOperations from ._volume_quota_rules_operations import VolumeQuotaRulesOperations from ._volume_groups_operations import VolumeGroupsOperations @@ -35,7 +34,6 @@ "SnapshotsOperations", "SnapshotPoliciesOperations", "BackupsOperations", - "AccountBackupsOperations", "BackupPoliciesOperations", "VolumeQuotaRulesOperations", "VolumeGroupsOperations", diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_account_backups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_account_backups_operations.py deleted file mode 100644 index bee1962161a5..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_account_backups_operations.py +++ /dev/null @@ -1,335 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._account_backups_operations import build_delete_request, build_get_request, build_list_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AccountBackupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s - :attr:`account_backups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncIterable["_models.Backup"]: - """List Backups for a Netapp Account. - - List all Backups for a Netapp 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Backup or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.Backup] - :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.BackupsList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BackupsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups" - } - - @distributed_trace_async - async def get(self, resource_group_name: str, account_name: str, backup_name: str, **kwargs: Any) -> _models.Backup: - """Get Backup for a Netapp Account. - - Gets the specified backup for a Netapp 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 backup_name: The name of the backup. Required. - :type backup_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Backup or the result of cls(response) - :rtype: ~azure.mgmt.netapp.models.Backup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Backup] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Backup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, account_name: str, backup_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, account_name: str, backup_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Backup for a Netapp Account. - - Delete the specified Backup for a Netapp 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 backup_name: The name of the backup. Required. - :type backup_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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._delete_initial( # type: ignore - resource_group_name=resource_group_name, - account_name=account_name, - backup_name=backup_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}" - } 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 7bdccb873996..602f0f58adb1 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 @@ -6,11 +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 io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse +from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -21,26 +18,14 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models from ..._vendor import _convert_request -from ...operations._backups_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_get_status_request, - build_get_volume_restore_status_request, - build_list_request, - build_restore_files_request, - build_update_request, -) +from ...operations._backups_operations import build_get_volume_restore_status_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -65,78 +50,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async - async def get_status( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> _models.BackupStatus: - """Get volume's backup status. - - Get the status of the backup for 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BackupStatus or the result of cls(response) - :rtype: ~azure.mgmt.netapp.models.BackupStatus - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BackupStatus] = kwargs.pop("cls", None) - - request = build_get_status_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, - template_url=self.get_status.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BackupStatus", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus" - } - @distributed_trace_async async def get_volume_restore_status( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any @@ -208,1126 +121,3 @@ async def get_volume_restore_status( get_volume_restore_status.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/restoreStatus" } - - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Backup"]: - """List Backups. - - List all backups for 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Backup or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.Backup] - :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.BackupsList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BackupsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups" - } - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - **kwargs: Any - ) -> _models.Backup: - """Get a backup. - - Gets the specified backup of the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Backup or the result of cls(response) - :rtype: ~azure.mgmt.netapp.models.Backup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Backup] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Backup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - async def _create_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Union[_models.Backup, IO], - **kwargs: Any - ) -> Optional[_models.Backup]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.Backup]] = 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, "Backup") - - request = build_create_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - 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, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("Backup", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("Backup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: _models.Backup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Backup]: - """Create a backup. - - Create a backup for the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.Backup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Backup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Backup]: - """Create a backup. - - Create a backup for the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Backup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Union[_models.Backup, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.Backup]: - """Create a backup. - - Create a backup for the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Is either a Backup type or a - IO type. Required. - :type body: ~azure.mgmt.netapp.models.Backup or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Backup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Backup] - :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.Backup] = 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_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_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("Backup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - async def _update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Optional[Union[_models.BackupPatch, IO]] = None, - **kwargs: Any - ) -> _models.Backup: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Backup] = 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, "BackupPatch") - else: - _json = None - - request = build_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Backup", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Backup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Optional[_models.BackupPatch] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Backup]: - """Patch a backup. - - Patch a backup for the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Default value is None. - :type body: ~azure.mgmt.netapp.models.BackupPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Backup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Optional[IO] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Backup]: - """Patch a backup. - - Patch a backup for the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Default value is None. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Backup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Optional[Union[_models.BackupPatch, IO]] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.Backup]: - """Patch a backup. - - Patch a backup for the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Is either a BackupPatch type - or a IO type. Default value is None. - :type body: ~azure.mgmt.netapp.models.BackupPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Backup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Backup] - :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.Backup] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_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("Backup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete backup. - - Delete a backup of the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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._delete_initial( # type: ignore - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - async def _restore_files_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Union[_models.BackupRestoreFiles, IO], - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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: - _json = self._serialize.body(body, "BackupRestoreFiles") - - request = build_restore_files_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._restore_files_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - 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) - - _restore_files_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}/restoreFiles" - } - - @overload - async def begin_restore_files( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: _models.BackupRestoreFiles, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Create a new Backup Restore Files request. - - Restore the specified files from the specified backup to the active filesystem. - - :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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Restore payload supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.BackupRestoreFiles - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_restore_files( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Create a new Backup Restore Files request. - - Restore the specified files from the specified backup to the active filesystem. - - :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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Restore payload supplied in the body of the operation. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_restore_files( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Union[_models.BackupRestoreFiles, IO], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Create a new Backup Restore Files request. - - Restore the specified files from the specified backup to the active filesystem. - - :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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Restore payload supplied in the body of the operation. Is either a - BackupRestoreFiles type or a IO type. Required. - :type body: ~azure.mgmt.netapp.models.BackupRestoreFiles or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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._restore_files_initial( # type: ignore - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restore_files.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}/restoreFiles" - } 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 b1e48d47c39e..8defbd528808 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,7 @@ # 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 +from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -18,10 +18,12 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models from ..._vendor import _convert_request @@ -29,7 +31,9 @@ build_check_file_path_availability_request, build_check_name_availability_request, build_check_quota_availability_request, + build_query_network_sibling_set_request, build_query_region_info_request, + build_update_network_sibling_set_request, ) T = TypeVar("T") @@ -351,3 +355,251 @@ async def query_region_info(self, location: str, **kwargs: Any) -> _models.Regio query_region_info.metadata = { "url": "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfo" } + + @distributed_trace_async + async def query_network_sibling_set( + self, location: str, network_sibling_set_id: str, subnet_id: str, **kwargs: Any + ) -> _models.NetworkSiblingSet: + """Describe a network sibling set. + + Get details of the specified network sibling set. + + :param location: The name of Azure region. Required. + :type location: str + :param network_sibling_set_id: Network Sibling Set ID for a group of volumes sharing networking + resources in a subnet. Required. + :type network_sibling_set_id: str + :param subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation + Microsoft.NetApp/volumes. Example + /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet}. + Required. + :type subnet_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSiblingSet or the result of cls(response) + :rtype: ~azure.mgmt.netapp.models.NetworkSiblingSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[_models.NetworkSiblingSet] = kwargs.pop("cls", None) + + _body = _models.QueryNetworkSiblingSetRequest( + network_sibling_set_id=network_sibling_set_id, subnet_id=subnet_id + ) + _json = self._serialize.body(_body, "QueryNetworkSiblingSetRequest") + + request = build_query_network_sibling_set_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.query_network_sibling_set.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkSiblingSet", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + query_network_sibling_set.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/queryNetworkSiblingSet" + } + + async def _update_network_sibling_set_initial( + self, + location: str, + network_sibling_set_id: str, + subnet_id: str, + network_sibling_set_state_id: str, + network_features: Union[str, _models.NetworkFeatures] = "Basic", + **kwargs: Any + ) -> Optional[_models.NetworkSiblingSet]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[Optional[_models.NetworkSiblingSet]] = kwargs.pop("cls", None) + + _body = _models.UpdateNetworkSiblingSetRequest( + network_features=network_features, + network_sibling_set_id=network_sibling_set_id, + network_sibling_set_state_id=network_sibling_set_state_id, + subnet_id=subnet_id, + ) + _json = self._serialize.body(_body, "UpdateNetworkSiblingSetRequest") + + request = build_update_network_sibling_set_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._update_network_sibling_set_initial.metadata["url"], + 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("NetworkSiblingSet", 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) + + return deserialized + + _update_network_sibling_set_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/updateNetworkSiblingSet" + } + + @distributed_trace_async + async def begin_update_network_sibling_set( + self, + location: str, + network_sibling_set_id: str, + subnet_id: str, + network_sibling_set_state_id: str, + network_features: Union[str, _models.NetworkFeatures] = "Basic", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkSiblingSet]: + """Update the network features of a network sibling set. + + Update the network features of the specified network sibling set. + + :param location: The name of Azure region. Required. + :type location: str + :param network_sibling_set_id: Network Sibling Set ID for a group of volumes sharing networking + resources in a subnet. Required. + :type network_sibling_set_id: str + :param subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation + Microsoft.NetApp/volumes. Example + /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet}. + Required. + :type subnet_id: str + :param network_sibling_set_state_id: Network sibling set state Id identifying the current state + of the sibling set. Required. + :type network_sibling_set_state_id: str + :param network_features: Network features available to the volume, some such. Known values are: + "Basic", "Standard", "Basic_Standard", and "Standard_Basic". Default value is "Basic". + :type network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NetworkSiblingSet or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.NetworkSiblingSet] + :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: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[_models.NetworkSiblingSet] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_network_sibling_set_initial( + location=location, + network_sibling_set_id=network_sibling_set_id, + subnet_id=subnet_id, + network_sibling_set_state_id=network_sibling_set_state_id, + network_features=network_features, + 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("NetworkSiblingSet", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + 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.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_update_network_sibling_set.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/updateNetworkSiblingSet" + } 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 7aad530b7073..38743b548213 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 @@ -44,6 +44,7 @@ build_list_replications_request, build_list_request, build_pool_change_request, + build_populate_availability_zone_request, build_re_initialize_replication_request, build_reestablish_replication_request, build_relocate_request, @@ -902,6 +903,145 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}" } + 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 = { + 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.Volume]] = kwargs.pop("cls", None) + + request = build_populate_availability_zone_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, + template_url=self._populate_availability_zone_initial.metadata["url"], + 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("Volume", 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) + + return deserialized + + _populate_availability_zone_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/populateAvailabilityZone" + } + + @distributed_trace_async + async def begin_populate_availability_zone( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.Volume]: + """Populate Availability Zone. + + This operation will populate availability zone information for 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Volume or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Volume] + :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.Volume] = 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._populate_availability_zone_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("Volume", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + 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.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_populate_availability_zone.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/populateAvailabilityZone" + } + async def _revert_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, 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 f64d8f75c38d..3c9468d61272 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 @@ -9,14 +9,9 @@ from ._models_py3 import AccountEncryption from ._models_py3 import ActiveDirectory from ._models_py3 import AuthorizeRequest -from ._models_py3 import Backup -from ._models_py3 import BackupPatch from ._models_py3 import BackupPoliciesList from ._models_py3 import BackupPolicy from ._models_py3 import BackupPolicyPatch -from ._models_py3 import BackupRestoreFiles -from ._models_py3 import BackupStatus -from ._models_py3 import BackupsList from ._models_py3 import BreakFileLocksRequest from ._models_py3 import BreakReplicationRequest from ._models_py3 import CapacityPool @@ -47,12 +42,15 @@ from ._models_py3 import NetAppAccount from ._models_py3 import NetAppAccountList from ._models_py3 import NetAppAccountPatch +from ._models_py3 import NetworkSiblingSet +from ._models_py3 import NicInfo from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult from ._models_py3 import PlacementKeyValuePairs from ._models_py3 import PoolChangeRequest from ._models_py3 import ProxyResource +from ._models_py3 import QueryNetworkSiblingSetRequest from ._models_py3 import QuotaAvailabilityRequest from ._models_py3 import ReestablishReplicationRequest from ._models_py3 import RegionInfo @@ -82,9 +80,9 @@ from ._models_py3 import SubvolumesList from ._models_py3 import SystemData from ._models_py3 import TrackedResource +from ._models_py3 import UpdateNetworkSiblingSetRequest from ._models_py3 import UserAssignedIdentity from ._models_py3 import Volume -from ._models_py3 import VolumeBackupProperties from ._models_py3 import VolumeBackups from ._models_py3 import VolumeGroup from ._models_py3 import VolumeGroupDetails @@ -108,10 +106,10 @@ from ._net_app_management_client_enums import ActiveDirectoryStatus from ._net_app_management_client_enums import ApplicationType from ._net_app_management_client_enums import AvsDataStore -from ._net_app_management_client_enums import BackupType from ._net_app_management_client_enums import CheckNameResourceTypes from ._net_app_management_client_enums import CheckQuotaNameResourceTypes from ._net_app_management_client_enums import ChownMode +from ._net_app_management_client_enums import CoolAccessRetrievalPolicy from ._net_app_management_client_enums import CreatedByType from ._net_app_management_client_enums import EnableSubvolumes from ._net_app_management_client_enums import EncryptionKeySource @@ -125,6 +123,7 @@ from ._net_app_management_client_enums import MetricAggregationType from ._net_app_management_client_enums import MirrorState from ._net_app_management_client_enums import NetworkFeatures +from ._net_app_management_client_enums import NetworkSiblingSetProvisioningState from ._net_app_management_client_enums import ProvisioningState from ._net_app_management_client_enums import QosType from ._net_app_management_client_enums import RegionStorageToNetworkProximity @@ -144,14 +143,9 @@ "AccountEncryption", "ActiveDirectory", "AuthorizeRequest", - "Backup", - "BackupPatch", "BackupPoliciesList", "BackupPolicy", "BackupPolicyPatch", - "BackupRestoreFiles", - "BackupStatus", - "BackupsList", "BreakFileLocksRequest", "BreakReplicationRequest", "CapacityPool", @@ -182,12 +176,15 @@ "NetAppAccount", "NetAppAccountList", "NetAppAccountPatch", + "NetworkSiblingSet", + "NicInfo", "Operation", "OperationDisplay", "OperationListResult", "PlacementKeyValuePairs", "PoolChangeRequest", "ProxyResource", + "QueryNetworkSiblingSetRequest", "QuotaAvailabilityRequest", "ReestablishReplicationRequest", "RegionInfo", @@ -217,9 +214,9 @@ "SubvolumesList", "SystemData", "TrackedResource", + "UpdateNetworkSiblingSetRequest", "UserAssignedIdentity", "Volume", - "VolumeBackupProperties", "VolumeBackups", "VolumeGroup", "VolumeGroupDetails", @@ -242,10 +239,10 @@ "ActiveDirectoryStatus", "ApplicationType", "AvsDataStore", - "BackupType", "CheckNameResourceTypes", "CheckQuotaNameResourceTypes", "ChownMode", + "CoolAccessRetrievalPolicy", "CreatedByType", "EnableSubvolumes", "EncryptionKeySource", @@ -259,6 +256,7 @@ "MetricAggregationType", "MirrorState", "NetworkFeatures", + "NetworkSiblingSetProvisioningState", "ProvisioningState", "QosType", "RegionStorageToNetworkProximity", 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 19a499f1a253..87a3cd66ab0a 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 @@ -134,6 +134,7 @@ class ActiveDirectory(_serialization.Model): # pylint: disable=too-many-instanc """ _validation = { + "password": {"max_length": 64}, "dns": { "pattern": r"^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)((, ?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))*$" }, @@ -307,50 +308,28 @@ def __init__(self, *, remote_volume_resource_id: Optional[str] = None, **kwargs: self.remote_volume_resource_id = remote_volume_resource_id -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. +class BackupPoliciesList(_serialization.Model): + """List of Backup Policies. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.netapp.models.SystemData + :ivar value: A list of backup policies. + :vartype value: list[~azure.mgmt.netapp.models.BackupPolicy] """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, + "value": {"key": "value", "type": "[BackupPolicy]"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, value: Optional[List["_models.BackupPolicy"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of backup policies. + :paramtype value: list[~azure.mgmt.netapp.models.BackupPolicy] + """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None + self.value = value -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. +class Resource(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. @@ -384,217 +363,10 @@ class ProxyResource(Resource): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - - -class Backup(ProxyResource): # pylint: disable=too-many-instance-attributes - """Backup of a Volume. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.netapp.models.SystemData - :ivar location: Resource location. Required. - :vartype location: str - :ivar backup_id: UUID v4 used to identify the Backup. - :vartype backup_id: str - :ivar creation_date: The creation date of the backup. - :vartype creation_date: ~datetime.datetime - :ivar provisioning_state: Azure lifecycle management. - :vartype provisioning_state: str - :ivar size: Size of backup. - :vartype size: int - :ivar label: Label for backup. - :vartype label: str - :ivar backup_type: Type of backup Manual or Scheduled. Known values are: "Manual" and - "Scheduled". - :vartype backup_type: str or ~azure.mgmt.netapp.models.BackupType - :ivar failure_reason: Failure reason. - :vartype failure_reason: str - :ivar volume_name: Volume name. - :vartype volume_name: str - :ivar use_existing_snapshot: Manual backup an already existing snapshot. This will always be - false for scheduled backups and true/false for manual backups. - :vartype use_existing_snapshot: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "backup_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}$", - }, - "creation_date": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "size": {"readonly": True}, - "backup_type": {"readonly": True}, - "failure_reason": {"readonly": True}, - "volume_name": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "location": {"key": "location", "type": "str"}, - "backup_id": {"key": "properties.backupId", "type": "str"}, - "creation_date": {"key": "properties.creationDate", "type": "iso-8601"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "size": {"key": "properties.size", "type": "int"}, - "label": {"key": "properties.label", "type": "str"}, - "backup_type": {"key": "properties.backupType", "type": "str"}, - "failure_reason": {"key": "properties.failureReason", "type": "str"}, - "volume_name": {"key": "properties.volumeName", "type": "str"}, - "use_existing_snapshot": {"key": "properties.useExistingSnapshot", "type": "bool"}, - } - - def __init__( - self, *, location: str, label: Optional[str] = None, use_existing_snapshot: bool = False, **kwargs: Any - ) -> None: - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword label: Label for backup. - :paramtype label: str - :keyword use_existing_snapshot: Manual backup an already existing snapshot. This will always be - false for scheduled backups and true/false for manual backups. - :paramtype use_existing_snapshot: bool - """ - super().__init__(**kwargs) - self.location = location - self.backup_id = None - self.creation_date = None - self.provisioning_state = None - self.size = None - self.label = label - self.backup_type = None - self.failure_reason = None - self.volume_name = None - self.use_existing_snapshot = use_existing_snapshot - - -class BackupPatch(_serialization.Model): - """Backup patch. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar backup_id: UUID v4 used to identify the Backup. - :vartype backup_id: str - :ivar creation_date: The creation date of the backup. - :vartype creation_date: ~datetime.datetime - :ivar provisioning_state: Azure lifecycle management. - :vartype provisioning_state: str - :ivar size: Size of backup. - :vartype size: int - :ivar label: Label for backup. - :vartype label: str - :ivar backup_type: Type of backup Manual or Scheduled. Known values are: "Manual" and - "Scheduled". - :vartype backup_type: str or ~azure.mgmt.netapp.models.BackupType - :ivar failure_reason: Failure reason. - :vartype failure_reason: str - :ivar volume_name: Volume name. - :vartype volume_name: str - :ivar use_existing_snapshot: Manual backup an already existing snapshot. This will always be - false for scheduled backups and true/false for manual backups. - :vartype use_existing_snapshot: bool - """ - - _validation = { - "backup_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}$", - }, - "creation_date": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "size": {"readonly": True}, - "backup_type": {"readonly": True}, - "failure_reason": {"readonly": True}, - "volume_name": {"readonly": True}, - } - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "backup_id": {"key": "properties.backupId", "type": "str"}, - "creation_date": {"key": "properties.creationDate", "type": "iso-8601"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "size": {"key": "properties.size", "type": "int"}, - "label": {"key": "properties.label", "type": "str"}, - "backup_type": {"key": "properties.backupType", "type": "str"}, - "failure_reason": {"key": "properties.failureReason", "type": "str"}, - "volume_name": {"key": "properties.volumeName", "type": "str"}, - "use_existing_snapshot": {"key": "properties.useExistingSnapshot", "type": "bool"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - label: Optional[str] = None, - use_existing_snapshot: bool = False, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword label: Label for backup. - :paramtype label: str - :keyword use_existing_snapshot: Manual backup an already existing snapshot. This will always be - false for scheduled backups and true/false for manual backups. - :paramtype use_existing_snapshot: bool - """ - super().__init__(**kwargs) - self.tags = tags - self.backup_id = None - self.creation_date = None - self.provisioning_state = None - self.size = None - self.label = label - self.backup_type = None - self.failure_reason = None - self.volume_name = None - self.use_existing_snapshot = use_existing_snapshot - - -class BackupPoliciesList(_serialization.Model): - """List of Backup Policies. - - :ivar value: A list of backup policies. - :vartype value: list[~azure.mgmt.netapp.models.BackupPolicy] - """ - - _attribute_map = { - "value": {"key": "value", "type": "[BackupPolicy]"}, - } - - def __init__(self, *, value: Optional[List["_models.BackupPolicy"]] = None, **kwargs: Any) -> None: - """ - :keyword value: A list of backup policies. - :paramtype value: list[~azure.mgmt.netapp.models.BackupPolicy] - """ - super().__init__(**kwargs) - self.value = value + self.id = None + self.name = None + self.type = None + self.system_data = None class TrackedResource(Resource): @@ -861,139 +633,6 @@ def __init__( self.volume_backups = None -class BackupRestoreFiles(_serialization.Model): - """Restore payload for single file backup restore. - - All required parameters must be populated in order to send to Azure. - - :ivar file_list: List of files to be restored. Required. - :vartype file_list: list[str] - :ivar restore_file_path: Destination folder where the files will be restored. The path name - should start with a forward slash. If it is omitted from request then restore is done at the - root folder of the destination volume by default. - :vartype restore_file_path: str - :ivar destination_volume_id: Resource Id of the destination volume on which the files need to - be restored. Required. - :vartype destination_volume_id: str - """ - - _validation = { - "file_list": {"required": True, "max_items": 8, "min_items": 1}, - "restore_file_path": {"pattern": r"^\/.*$"}, - "destination_volume_id": {"required": True}, - } - - _attribute_map = { - "file_list": {"key": "fileList", "type": "[str]"}, - "restore_file_path": {"key": "restoreFilePath", "type": "str"}, - "destination_volume_id": {"key": "destinationVolumeId", "type": "str"}, - } - - def __init__( - self, - *, - file_list: List[str], - destination_volume_id: str, - restore_file_path: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword file_list: List of files to be restored. Required. - :paramtype file_list: list[str] - :keyword restore_file_path: Destination folder where the files will be restored. The path name - should start with a forward slash. If it is omitted from request then restore is done at the - root folder of the destination volume by default. - :paramtype restore_file_path: str - :keyword destination_volume_id: Resource Id of the destination volume on which the files need - to be restored. Required. - :paramtype destination_volume_id: str - """ - super().__init__(**kwargs) - self.file_list = file_list - self.restore_file_path = restore_file_path - self.destination_volume_id = destination_volume_id - - -class BackupsList(_serialization.Model): - """List of Backups. - - :ivar value: A list of Backups. - :vartype value: list[~azure.mgmt.netapp.models.Backup] - """ - - _attribute_map = { - "value": {"key": "value", "type": "[Backup]"}, - } - - def __init__(self, *, value: Optional[List["_models.Backup"]] = None, **kwargs: Any) -> None: - """ - :keyword value: A list of Backups. - :paramtype value: list[~azure.mgmt.netapp.models.Backup] - """ - super().__init__(**kwargs) - self.value = value - - -class BackupStatus(_serialization.Model): - """Backup status. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar healthy: Backup health status. - :vartype healthy: bool - :ivar relationship_status: Status of the backup mirror relationship. Known values are: "Idle" - and "Transferring". - :vartype relationship_status: str or ~azure.mgmt.netapp.models.RelationshipStatus - :ivar mirror_state: The status of the backup. Known values are: "Uninitialized", "Mirrored", - and "Broken". - :vartype mirror_state: str or ~azure.mgmt.netapp.models.MirrorState - :ivar unhealthy_reason: Reason for the unhealthy backup relationship. - :vartype unhealthy_reason: str - :ivar error_message: Displays error message if the backup is in an error state. - :vartype error_message: str - :ivar last_transfer_size: Displays the last transfer size. - :vartype last_transfer_size: int - :ivar last_transfer_type: Displays the last transfer type. - :vartype last_transfer_type: str - :ivar total_transfer_bytes: Displays the total bytes transferred. - :vartype total_transfer_bytes: int - """ - - _validation = { - "healthy": {"readonly": True}, - "relationship_status": {"readonly": True}, - "mirror_state": {"readonly": True}, - "unhealthy_reason": {"readonly": True}, - "error_message": {"readonly": True}, - "last_transfer_size": {"readonly": True}, - "last_transfer_type": {"readonly": True}, - "total_transfer_bytes": {"readonly": True}, - } - - _attribute_map = { - "healthy": {"key": "healthy", "type": "bool"}, - "relationship_status": {"key": "relationshipStatus", "type": "str"}, - "mirror_state": {"key": "mirrorState", "type": "str"}, - "unhealthy_reason": {"key": "unhealthyReason", "type": "str"}, - "error_message": {"key": "errorMessage", "type": "str"}, - "last_transfer_size": {"key": "lastTransferSize", "type": "int"}, - "last_transfer_type": {"key": "lastTransferType", "type": "str"}, - "total_transfer_bytes": {"key": "totalTransferBytes", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.healthy = None - self.relationship_status = None - self.mirror_state = None - self.unhealthy_reason = None - self.error_message = None - self.last_transfer_size = None - self.last_transfer_type = None - self.total_transfer_bytes = None - - class BreakFileLocksRequest(_serialization.Model): """Break file locks request. @@ -2580,6 +2219,116 @@ def __init__( self.disable_showmount = None +class NetworkSiblingSet(_serialization.Model): + """Describes the contents of a network sibling set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar network_sibling_set_id: Network Sibling Set ID for a group of volumes sharing networking + resources in a subnet. + :vartype network_sibling_set_id: str + :ivar subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation + Microsoft.NetApp/volumes. Example + /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet}. + :vartype subnet_id: str + :ivar network_sibling_set_state_id: Network sibling set state Id identifying the current state + of the sibling set. + :vartype network_sibling_set_state_id: str + :ivar network_features: Network features available to the volume, or current state of update. + Known values are: "Basic", "Standard", "Basic_Standard", and "Standard_Basic". + :vartype network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures + :ivar provisioning_state: Gets the status of the NetworkSiblingSet at the time the operation + was called. Known values are: "Succeeded", "Failed", "Canceled", and "Updating". + :vartype provisioning_state: str or + ~azure.mgmt.netapp.models.NetworkSiblingSetProvisioningState + :ivar nic_info_list: List of NIC information. + :vartype nic_info_list: list[~azure.mgmt.netapp.models.NicInfo] + """ + + _validation = { + "network_sibling_set_id": { + "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}$", + }, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "network_sibling_set_id": {"key": "networkSiblingSetId", "type": "str"}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "network_sibling_set_state_id": {"key": "networkSiblingSetStateId", "type": "str"}, + "network_features": {"key": "networkFeatures", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "nic_info_list": {"key": "nicInfoList", "type": "[NicInfo]"}, + } + + def __init__( + self, + *, + network_sibling_set_id: Optional[str] = None, + subnet_id: Optional[str] = None, + network_sibling_set_state_id: Optional[str] = None, + network_features: Union[str, "_models.NetworkFeatures"] = "Basic", + nic_info_list: Optional[List["_models.NicInfo"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_sibling_set_id: Network Sibling Set ID for a group of volumes sharing + networking resources in a subnet. + :paramtype network_sibling_set_id: str + :keyword subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation + Microsoft.NetApp/volumes. Example + /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet}. + :paramtype subnet_id: str + :keyword network_sibling_set_state_id: Network sibling set state Id identifying the current + state of the sibling set. + :paramtype network_sibling_set_state_id: str + :keyword network_features: Network features available to the volume, or current state of + update. Known values are: "Basic", "Standard", "Basic_Standard", and "Standard_Basic". + :paramtype network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures + :keyword nic_info_list: List of NIC information. + :paramtype nic_info_list: list[~azure.mgmt.netapp.models.NicInfo] + """ + super().__init__(**kwargs) + self.network_sibling_set_id = network_sibling_set_id + self.subnet_id = subnet_id + self.network_sibling_set_state_id = network_sibling_set_state_id + self.network_features = network_features + self.provisioning_state = None + self.nic_info_list = nic_info_list + + +class NicInfo(_serialization.Model): + """NIC information and list of volumes for which the NIC has the primary mount ip address. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: ipAddress. + :vartype ip_address: str + :ivar volume_resource_ids: Volume resource Ids. + :vartype volume_resource_ids: list[str] + """ + + _validation = { + "ip_address": {"readonly": True}, + } + + _attribute_map = { + "ip_address": {"key": "ipAddress", "type": "str"}, + "volume_resource_ids": {"key": "volumeResourceIds", "type": "[str]"}, + } + + def __init__(self, *, volume_resource_ids: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword volume_resource_ids: Volume resource Ids. + :paramtype volume_resource_ids: list[str] + """ + super().__init__(**kwargs) + self.ip_address = None + self.volume_resource_ids = volume_resource_ids + + class Operation(_serialization.Model): """Microsoft.NetApp REST API operation definition. @@ -2756,6 +2505,90 @@ def __init__(self, *, new_pool_resource_id: str, **kwargs: Any) -> None: self.new_pool_resource_id = new_pool_resource_id +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.netapp.models.SystemData + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + + +class QueryNetworkSiblingSetRequest(_serialization.Model): + """Network sibling set query. + + All required parameters must be populated in order to send to Azure. + + :ivar network_sibling_set_id: Network Sibling Set ID for a group of volumes sharing networking + resources in a subnet. Required. + :vartype network_sibling_set_id: str + :ivar subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation + Microsoft.NetApp/volumes. Example + /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet}. + Required. + :vartype subnet_id: str + """ + + _validation = { + "network_sibling_set_id": { + "required": 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}$", + }, + "subnet_id": {"required": True}, + } + + _attribute_map = { + "network_sibling_set_id": {"key": "networkSiblingSetId", "type": "str"}, + "subnet_id": {"key": "subnetId", "type": "str"}, + } + + def __init__(self, *, network_sibling_set_id: str, subnet_id: str, **kwargs: Any) -> None: + """ + :keyword network_sibling_set_id: Network Sibling Set ID for a group of volumes sharing + networking resources in a subnet. Required. + :paramtype network_sibling_set_id: str + :keyword subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation + Microsoft.NetApp/volumes. Example + /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet}. + Required. + :paramtype subnet_id: str + """ + super().__init__(**kwargs) + self.network_sibling_set_id = network_sibling_set_id + self.subnet_id = subnet_id + + class QuotaAvailabilityRequest(_serialization.Model): """Quota availability request content. @@ -2975,6 +2808,8 @@ def __init__( class ReplicationObject(_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 Azure. :ivar replication_id: Id. @@ -2991,6 +2826,7 @@ class ReplicationObject(_serialization.Model): """ _validation = { + "replication_id": {"readonly": True}, "remote_volume_resource_id": {"required": True}, } @@ -3006,15 +2842,12 @@ def __init__( self, *, remote_volume_resource_id: str, - replication_id: Optional[str] = None, endpoint_type: Optional[Union[str, "_models.EndpointType"]] = None, replication_schedule: Optional[Union[str, "_models.ReplicationSchedule"]] = None, remote_volume_region: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword replication_id: Id. - :paramtype replication_id: str :keyword endpoint_type: Indicates whether the local volume is the source or destination for the Volume Replication. Known values are: "src" and "dst". :paramtype endpoint_type: str or ~azure.mgmt.netapp.models.EndpointType @@ -3027,7 +2860,7 @@ def __init__( :paramtype remote_volume_region: str """ super().__init__(**kwargs) - self.replication_id = replication_id + self.replication_id = None self.endpoint_type = endpoint_type self.replication_schedule = replication_schedule self.remote_volume_resource_id = remote_volume_resource_id @@ -4062,6 +3895,78 @@ def __init__( self.last_modified_at = last_modified_at +class UpdateNetworkSiblingSetRequest(_serialization.Model): + """Network sibling set update. + + All required parameters must be populated in order to send to Azure. + + :ivar network_sibling_set_id: Network Sibling Set ID for a group of volumes sharing networking + resources in a subnet. Required. + :vartype network_sibling_set_id: str + :ivar subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation + Microsoft.NetApp/volumes. Example + /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet}. + Required. + :vartype subnet_id: str + :ivar network_sibling_set_state_id: Network sibling set state Id identifying the current state + of the sibling set. Required. + :vartype network_sibling_set_state_id: str + :ivar network_features: Network features available to the volume, some such. Known values are: + "Basic", "Standard", "Basic_Standard", and "Standard_Basic". + :vartype network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures + """ + + _validation = { + "network_sibling_set_id": { + "required": 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}$", + }, + "subnet_id": {"required": True}, + "network_sibling_set_state_id": {"required": True}, + "network_features": {"required": True}, + } + + _attribute_map = { + "network_sibling_set_id": {"key": "networkSiblingSetId", "type": "str"}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "network_sibling_set_state_id": {"key": "networkSiblingSetStateId", "type": "str"}, + "network_features": {"key": "networkFeatures", "type": "str"}, + } + + def __init__( + self, + *, + network_sibling_set_id: str, + subnet_id: str, + network_sibling_set_state_id: str, + network_features: Union[str, "_models.NetworkFeatures"] = "Basic", + **kwargs: Any + ) -> None: + """ + :keyword network_sibling_set_id: Network Sibling Set ID for a group of volumes sharing + networking resources in a subnet. Required. + :paramtype network_sibling_set_id: str + :keyword subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation + Microsoft.NetApp/volumes. Example + /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet}. + Required. + :paramtype subnet_id: str + :keyword network_sibling_set_state_id: Network sibling set state Id identifying the current + state of the sibling set. Required. + :paramtype network_sibling_set_state_id: str + :keyword network_features: Network features available to the volume, some such. Known values + are: "Basic", "Standard", "Basic_Standard", and "Standard_Basic". + :paramtype network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures + """ + super().__init__(**kwargs) + self.network_sibling_set_id = network_sibling_set_id + self.subnet_id = subnet_id + self.network_sibling_set_state_id = network_sibling_set_state_id + self.network_features = network_features + + class UserAssignedIdentity(_serialization.Model): """User assigned identity properties. @@ -4126,7 +4031,7 @@ class Volume(TrackedResource): # pylint: disable=too-many-instance-attributes :vartype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :ivar usage_threshold: Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB, 500Tib for - LargeVolume. Specified in bytes. + LargeVolume or 2400Tib for LargeVolume on exceptional basis. Specified in bytes. :vartype usage_threshold: int :ivar export_policy: Set of export policy rules. :vartype export_policy: ~azure.mgmt.netapp.models.VolumePropertiesExportPolicy @@ -4146,8 +4051,8 @@ class Volume(TrackedResource): # pylint: disable=too-many-instance-attributes :ivar subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Required. :vartype subnet_id: str - :ivar network_features: Basic network, or Standard features available to the volume. Known - values are: "Basic" and "Standard". + :ivar network_features: Network features available to the volume, or current state of update. + Known values are: "Basic", "Standard", "Basic_Standard", and "Standard_Basic". :vartype network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures :ivar network_sibling_set_id: Network Sibling Set ID for the the group of volumes sharing networking resources. @@ -4178,12 +4083,12 @@ class Volume(TrackedResource): # pylint: disable=too-many-instance-attributes :ivar smb_encryption: Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. :vartype smb_encryption: bool - :ivar smb_access_based_enumeration: Enables access based enumeration share property for SMB + :ivar smb_access_based_enumeration: Enables access-based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume. Known values are: "Disabled" and "Enabled". :vartype smb_access_based_enumeration: str or ~azure.mgmt.netapp.models.SmbAccessBasedEnumeration - :ivar smb_non_browsable: Enables non browsable property for SMB Shares. Only applicable for + :ivar smb_non_browsable: Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. Known values are: "Disabled" and "Enabled". :vartype smb_non_browsable: str or ~azure.mgmt.netapp.models.SmbNonBrowsable :ivar smb_continuously_available: Enables continuously available share property for smb volume. @@ -4211,6 +4116,17 @@ class Volume(TrackedResource): # pylint: disable=too-many-instance-attributes :ivar coolness_period: Specifies the number of days after which data that is not accessed by clients will be tiered. :vartype coolness_period: int + :ivar cool_access_retrieval_policy: coolAccessRetrievalPolicy determines the data retrieval + behavior from the cool tier to standard storage based on the read pattern for cool access + enabled volumes. The possible values for this field are: + Default - Data will be pulled from cool tier to standard storage on random reads. This policy + is the default. + OnRead - All client-driven data read is pulled from cool tier to standard storage on both + sequential and random reads. + Never - No client-driven data is pulled from cool tier to standard storage. Known values are: + "Default", "OnRead", and "Never". + :vartype cool_access_retrieval_policy: str or + ~azure.mgmt.netapp.models.CoolAccessRetrievalPolicy :ivar unix_permissions: UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third @@ -4291,7 +4207,7 @@ class Volume(TrackedResource): # pylint: disable=too-many-instance-attributes "min_length": 1, "pattern": r"^[a-zA-Z][a-zA-Z0-9\-]{0,79}$", }, - "usage_threshold": {"required": True, "maximum": 549755813888000, "minimum": 107374182400}, + "usage_threshold": {"required": True, "maximum": 2638827906662400, "minimum": 107374182400}, "provisioning_state": {"readonly": True}, "baremetal_tenant_id": {"readonly": True}, "subnet_id": {"required": True}, @@ -4362,6 +4278,7 @@ class Volume(TrackedResource): # pylint: disable=too-many-instance-attributes "ldap_enabled": {"key": "properties.ldapEnabled", "type": "bool"}, "cool_access": {"key": "properties.coolAccess", "type": "bool"}, "coolness_period": {"key": "properties.coolnessPeriod", "type": "int"}, + "cool_access_retrieval_policy": {"key": "properties.coolAccessRetrievalPolicy", "type": "str"}, "unix_permissions": {"key": "properties.unixPermissions", "type": "str"}, "clone_progress": {"key": "properties.cloneProgress", "type": "int"}, "file_access_logs": {"key": "properties.fileAccessLogs", "type": "str"}, @@ -4416,7 +4333,8 @@ def __init__( # pylint: disable=too-many-locals ldap_enabled: bool = False, cool_access: bool = False, coolness_period: Optional[int] = None, - unix_permissions: str = "0770", + cool_access_retrieval_policy: Optional[Union[str, "_models.CoolAccessRetrievalPolicy"]] = None, + unix_permissions: Optional[str] = None, avs_data_store: Union[str, "_models.AvsDataStore"] = "Disabled", is_default_quota_enabled: bool = False, default_user_quota_in_ki_bs: int = 0, @@ -4444,7 +4362,7 @@ def __init__( # pylint: disable=too-many-locals :paramtype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :keyword usage_threshold: Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB, 500Tib for - LargeVolume. Specified in bytes. + LargeVolume or 2400Tib for LargeVolume on exceptional basis. Specified in bytes. :paramtype usage_threshold: int :keyword export_policy: Set of export policy rules. :paramtype export_policy: ~azure.mgmt.netapp.models.VolumePropertiesExportPolicy @@ -4460,8 +4378,8 @@ def __init__( # pylint: disable=too-many-locals :keyword subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Required. :paramtype subnet_id: str - :keyword network_features: Basic network, or Standard features available to the volume. Known - values are: "Basic" and "Standard". + :keyword network_features: Network features available to the volume, or current state of + 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. @@ -4483,12 +4401,12 @@ def __init__( # pylint: disable=too-many-locals :keyword smb_encryption: Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. :paramtype smb_encryption: bool - :keyword smb_access_based_enumeration: Enables access based enumeration share property for SMB + :keyword smb_access_based_enumeration: Enables access-based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume. Known values are: "Disabled" and "Enabled". :paramtype smb_access_based_enumeration: str or ~azure.mgmt.netapp.models.SmbAccessBasedEnumeration - :keyword smb_non_browsable: Enables non browsable property for SMB Shares. Only applicable for + :keyword smb_non_browsable: Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. Known values are: "Disabled" and "Enabled". :paramtype smb_non_browsable: str or ~azure.mgmt.netapp.models.SmbNonBrowsable :keyword smb_continuously_available: Enables continuously available share property for smb @@ -4513,6 +4431,17 @@ def __init__( # pylint: disable=too-many-locals :keyword coolness_period: Specifies the number of days after which data that is not accessed by clients will be tiered. :paramtype coolness_period: int + :keyword cool_access_retrieval_policy: coolAccessRetrievalPolicy determines the data retrieval + behavior from the cool tier to standard storage based on the read pattern for cool access + enabled volumes. The possible values for this field are: + Default - Data will be pulled from cool tier to standard storage on random reads. This policy + is the default. + OnRead - All client-driven data read is pulled from cool tier to standard storage on both + sequential and random reads. + Never - No client-driven data is pulled from cool tier to standard storage. Known values are: + "Default", "OnRead", and "Never". + :paramtype cool_access_retrieval_policy: str or + ~azure.mgmt.netapp.models.CoolAccessRetrievalPolicy :keyword unix_permissions: UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third @@ -4583,6 +4512,7 @@ def __init__( # pylint: disable=too-many-locals self.ldap_enabled = ldap_enabled self.cool_access = cool_access self.coolness_period = coolness_period + self.cool_access_retrieval_policy = cool_access_retrieval_policy self.unix_permissions = unix_permissions self.clone_progress = None self.file_access_logs = None @@ -4605,45 +4535,6 @@ def __init__( # pylint: disable=too-many-locals self.originating_resource_id = None -class VolumeBackupProperties(_serialization.Model): - """Volume Backup Properties. - - :ivar backup_policy_id: Backup Policy Resource ID. - :vartype backup_policy_id: str - :ivar policy_enforced: Policy Enforced. - :vartype policy_enforced: bool - :ivar backup_enabled: Backup Enabled. - :vartype backup_enabled: bool - """ - - _attribute_map = { - "backup_policy_id": {"key": "backupPolicyId", "type": "str"}, - "policy_enforced": {"key": "policyEnforced", "type": "bool"}, - "backup_enabled": {"key": "backupEnabled", "type": "bool"}, - } - - def __init__( - self, - *, - backup_policy_id: Optional[str] = None, - policy_enforced: Optional[bool] = None, - backup_enabled: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword backup_policy_id: Backup Policy Resource ID. - :paramtype backup_policy_id: str - :keyword policy_enforced: Policy Enforced. - :paramtype policy_enforced: bool - :keyword backup_enabled: Backup Enabled. - :paramtype backup_enabled: bool - """ - super().__init__(**kwargs) - self.backup_policy_id = backup_policy_id - self.policy_enforced = policy_enforced - self.backup_enabled = backup_enabled - - class VolumeBackups(_serialization.Model): """Volume details using the backup policy. @@ -4831,7 +4722,7 @@ class VolumeGroupMetaData(_serialization.Model): :ivar group_description: Group Description. :vartype group_description: str - :ivar application_type: Application Type. "SAP-HANA" + :ivar application_type: Application Type. Known values are: "SAP-HANA" and "ORACLE". :vartype application_type: str or ~azure.mgmt.netapp.models.ApplicationType :ivar application_identifier: Application specific identifier. :vartype application_identifier: str @@ -4870,7 +4761,7 @@ def __init__( """ :keyword group_description: Group Description. :paramtype group_description: str - :keyword application_type: Application Type. "SAP-HANA" + :keyword application_type: Application Type. Known values are: "SAP-HANA" and "ORACLE". :paramtype application_type: str or ~azure.mgmt.netapp.models.ApplicationType :keyword application_identifier: Application specific identifier. :paramtype application_identifier: str @@ -4904,6 +4795,8 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- :vartype type: str :ivar tags: Resource tags. :vartype tags: dict[str, str] + :ivar zones: Availability Zone. + :vartype zones: list[str] :ivar file_system_id: Unique FileSystem Identifier. :vartype file_system_id: str :ivar creation_token: A unique file path for the volume. Used when creating mount targets. @@ -4914,7 +4807,7 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- :vartype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :ivar usage_threshold: Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB, 500Tib for - LargeVolume. Specified in bytes. + LargeVolume or 2400Tib for LargeVolume on exceptional basis. Specified in bytes. :vartype usage_threshold: int :ivar export_policy: Set of export policy rules. :vartype export_policy: ~azure.mgmt.netapp.models.VolumePropertiesExportPolicy @@ -4934,8 +4827,8 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- :ivar subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Required. :vartype subnet_id: str - :ivar network_features: Basic network, or Standard features available to the volume. Known - values are: "Basic" and "Standard". + :ivar network_features: Network features available to the volume, or current state of update. + Known values are: "Basic", "Standard", "Basic_Standard", and "Standard_Basic". :vartype network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures :ivar network_sibling_set_id: Network Sibling Set ID for the the group of volumes sharing networking resources. @@ -4966,12 +4859,12 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- :ivar smb_encryption: Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. :vartype smb_encryption: bool - :ivar smb_access_based_enumeration: Enables access based enumeration share property for SMB + :ivar smb_access_based_enumeration: Enables access-based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume. Known values are: "Disabled" and "Enabled". :vartype smb_access_based_enumeration: str or ~azure.mgmt.netapp.models.SmbAccessBasedEnumeration - :ivar smb_non_browsable: Enables non browsable property for SMB Shares. Only applicable for + :ivar smb_non_browsable: Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. Known values are: "Disabled" and "Enabled". :vartype smb_non_browsable: str or ~azure.mgmt.netapp.models.SmbNonBrowsable :ivar smb_continuously_available: Enables continuously available share property for smb volume. @@ -4999,6 +4892,17 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- :ivar coolness_period: Specifies the number of days after which data that is not accessed by clients will be tiered. :vartype coolness_period: int + :ivar cool_access_retrieval_policy: coolAccessRetrievalPolicy determines the data retrieval + behavior from the cool tier to standard storage based on the read pattern for cool access + enabled volumes. The possible values for this field are: + Default - Data will be pulled from cool tier to standard storage on random reads. This policy + is the default. + OnRead - All client-driven data read is pulled from cool tier to standard storage on both + sequential and random reads. + Never - No client-driven data is pulled from cool tier to standard storage. Known values are: + "Default", "OnRead", and "Never". + :vartype cool_access_retrieval_policy: str or + ~azure.mgmt.netapp.models.CoolAccessRetrievalPolicy :ivar unix_permissions: UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third @@ -5075,7 +4979,7 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- "min_length": 1, "pattern": r"^[a-zA-Z][a-zA-Z0-9\-]{0,79}$", }, - "usage_threshold": {"required": True, "maximum": 549755813888000, "minimum": 107374182400}, + "usage_threshold": {"required": True, "maximum": 2638827906662400, "minimum": 107374182400}, "provisioning_state": {"readonly": True}, "baremetal_tenant_id": {"readonly": True}, "subnet_id": {"required": True}, @@ -5106,6 +5010,7 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, + "zones": {"key": "zones", "type": "[str]"}, "file_system_id": {"key": "properties.fileSystemId", "type": "str"}, "creation_token": {"key": "properties.creationToken", "type": "str"}, "service_level": {"key": "properties.serviceLevel", "type": "str"}, @@ -5142,6 +5047,7 @@ class VolumeGroupVolumeProperties(_serialization.Model): # pylint: disable=too- "ldap_enabled": {"key": "properties.ldapEnabled", "type": "bool"}, "cool_access": {"key": "properties.coolAccess", "type": "bool"}, "coolness_period": {"key": "properties.coolnessPeriod", "type": "int"}, + "cool_access_retrieval_policy": {"key": "properties.coolAccessRetrievalPolicy", "type": "str"}, "unix_permissions": {"key": "properties.unixPermissions", "type": "str"}, "clone_progress": {"key": "properties.cloneProgress", "type": "int"}, "file_access_logs": {"key": "properties.fileAccessLogs", "type": "str"}, @@ -5172,6 +5078,7 @@ def __init__( # pylint: disable=too-many-locals subnet_id: str, name: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, service_level: Union[str, "_models.ServiceLevel"] = "Premium", export_policy: Optional["_models.VolumePropertiesExportPolicy"] = None, protocol_types: Optional[List[str]] = None, @@ -5195,7 +5102,8 @@ def __init__( # pylint: disable=too-many-locals ldap_enabled: bool = False, cool_access: bool = False, coolness_period: Optional[int] = None, - unix_permissions: str = "0770", + cool_access_retrieval_policy: Optional[Union[str, "_models.CoolAccessRetrievalPolicy"]] = None, + unix_permissions: Optional[str] = None, avs_data_store: Union[str, "_models.AvsDataStore"] = "Disabled", is_default_quota_enabled: bool = False, default_user_quota_in_ki_bs: int = 0, @@ -5213,6 +5121,8 @@ def __init__( # pylint: disable=too-many-locals :paramtype name: str :keyword tags: Resource tags. :paramtype tags: dict[str, str] + :keyword zones: Availability Zone. + :paramtype zones: list[str] :keyword creation_token: A unique file path for the volume. Used when creating mount targets. Required. :paramtype creation_token: str @@ -5221,7 +5131,7 @@ def __init__( # pylint: disable=too-many-locals :paramtype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :keyword usage_threshold: Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB, 500Tib for - LargeVolume. Specified in bytes. + LargeVolume or 2400Tib for LargeVolume on exceptional basis. Specified in bytes. :paramtype usage_threshold: int :keyword export_policy: Set of export policy rules. :paramtype export_policy: ~azure.mgmt.netapp.models.VolumePropertiesExportPolicy @@ -5237,8 +5147,8 @@ def __init__( # pylint: disable=too-many-locals :keyword subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Required. :paramtype subnet_id: str - :keyword network_features: Basic network, or Standard features available to the volume. Known - values are: "Basic" and "Standard". + :keyword network_features: Network features available to the volume, or current state of + 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. @@ -5260,12 +5170,12 @@ def __init__( # pylint: disable=too-many-locals :keyword smb_encryption: Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. :paramtype smb_encryption: bool - :keyword smb_access_based_enumeration: Enables access based enumeration share property for SMB + :keyword smb_access_based_enumeration: Enables access-based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume. Known values are: "Disabled" and "Enabled". :paramtype smb_access_based_enumeration: str or ~azure.mgmt.netapp.models.SmbAccessBasedEnumeration - :keyword smb_non_browsable: Enables non browsable property for SMB Shares. Only applicable for + :keyword smb_non_browsable: Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. Known values are: "Disabled" and "Enabled". :paramtype smb_non_browsable: str or ~azure.mgmt.netapp.models.SmbNonBrowsable :keyword smb_continuously_available: Enables continuously available share property for smb @@ -5290,6 +5200,17 @@ def __init__( # pylint: disable=too-many-locals :keyword coolness_period: Specifies the number of days after which data that is not accessed by clients will be tiered. :paramtype coolness_period: int + :keyword cool_access_retrieval_policy: coolAccessRetrievalPolicy determines the data retrieval + behavior from the cool tier to standard storage based on the read pattern for cool access + enabled volumes. The possible values for this field are: + Default - Data will be pulled from cool tier to standard storage on random reads. This policy + is the default. + OnRead - All client-driven data read is pulled from cool tier to standard storage on both + sequential and random reads. + Never - No client-driven data is pulled from cool tier to standard storage. Known values are: + "Default", "OnRead", and "Never". + :paramtype cool_access_retrieval_policy: str or + ~azure.mgmt.netapp.models.CoolAccessRetrievalPolicy :keyword unix_permissions: UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third @@ -5329,6 +5250,7 @@ def __init__( # pylint: disable=too-many-locals self.name = name self.type = None self.tags = tags + self.zones = zones self.file_system_id = None self.creation_token = creation_token self.service_level = service_level @@ -5362,6 +5284,7 @@ def __init__( # pylint: disable=too-many-locals self.ldap_enabled = ldap_enabled self.cool_access = cool_access self.coolness_period = coolness_period + self.cool_access_retrieval_policy = cool_access_retrieval_policy self.unix_permissions = unix_permissions self.clone_progress = None self.file_access_logs = None @@ -5432,7 +5355,7 @@ class VolumePatch(_serialization.Model): # pylint: disable=too-many-instance-at :vartype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :ivar usage_threshold: Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB, 500Tib for - LargeVolume. Specified in bytes. + LargeVolume or 2400Tib for LargeVolume on exceptional basis. Specified in bytes. :vartype usage_threshold: int :ivar export_policy: Set of export policy rules. :vartype export_policy: ~azure.mgmt.netapp.models.VolumePatchPropertiesExportPolicy @@ -5462,16 +5385,35 @@ class VolumePatch(_serialization.Model): # pylint: disable=too-many-instance-at :ivar coolness_period: Specifies the number of days after which data that is not accessed by clients will be tiered. :vartype coolness_period: int + :ivar cool_access_retrieval_policy: coolAccessRetrievalPolicy determines the data retrieval + behavior from the cool tier to standard storage based on the read pattern for cool access + enabled volumes. The possible values for this field are: + Default - Data will be pulled from cool tier to standard storage on random reads. This policy + is the default. + OnRead - All client-driven data read is pulled from cool tier to standard storage on both + sequential and random reads. + Never - No client-driven data is pulled from cool tier to standard storage. Known values are: + "Default", "OnRead", and "Never". + :vartype cool_access_retrieval_policy: str or + ~azure.mgmt.netapp.models.CoolAccessRetrievalPolicy :ivar snapshot_directory_visible: If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots. :vartype snapshot_directory_visible: bool + :ivar smb_access_based_enumeration: Enables access-based enumeration share property for SMB + Shares. Only applicable for SMB/DualProtocol volume. Known values are: "Disabled" and + "Enabled". + :vartype smb_access_based_enumeration: str or + ~azure.mgmt.netapp.models.SmbAccessBasedEnumeration + :ivar smb_non_browsable: Enables non-browsable property for SMB Shares. Only applicable for + SMB/DualProtocol volume. Known values are: "Disabled" and "Enabled". + :vartype smb_non_browsable: str or ~azure.mgmt.netapp.models.SmbNonBrowsable """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "usage_threshold": {"maximum": 549755813888000, "minimum": 107374182400}, + "usage_threshold": {"maximum": 2638827906662400, "minimum": 107374182400}, "unix_permissions": {"max_length": 4, "min_length": 4}, "coolness_period": {"maximum": 63, "minimum": 7}, } @@ -5493,7 +5435,10 @@ class VolumePatch(_serialization.Model): # pylint: disable=too-many-instance-at "unix_permissions": {"key": "properties.unixPermissions", "type": "str"}, "cool_access": {"key": "properties.coolAccess", "type": "bool"}, "coolness_period": {"key": "properties.coolnessPeriod", "type": "int"}, + "cool_access_retrieval_policy": {"key": "properties.coolAccessRetrievalPolicy", "type": "str"}, "snapshot_directory_visible": {"key": "properties.snapshotDirectoryVisible", "type": "bool"}, + "smb_access_based_enumeration": {"key": "properties.smbAccessBasedEnumeration", "type": "str"}, + "smb_non_browsable": {"key": "properties.smbNonBrowsable", "type": "str"}, } def __init__( @@ -5512,7 +5457,10 @@ def __init__( unix_permissions: Optional[str] = None, cool_access: Optional[bool] = None, coolness_period: Optional[int] = None, + cool_access_retrieval_policy: Optional[Union[str, "_models.CoolAccessRetrievalPolicy"]] = None, snapshot_directory_visible: Optional[bool] = None, + smb_access_based_enumeration: Optional[Union[str, "_models.SmbAccessBasedEnumeration"]] = None, + smb_non_browsable: Optional[Union[str, "_models.SmbNonBrowsable"]] = None, **kwargs: Any ) -> None: """ @@ -5525,7 +5473,7 @@ def __init__( :paramtype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel :keyword usage_threshold: Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB, 500Tib for - LargeVolume. Specified in bytes. + LargeVolume or 2400Tib for LargeVolume on exceptional basis. Specified in bytes. :paramtype usage_threshold: int :keyword export_policy: Set of export policy rules. :paramtype export_policy: ~azure.mgmt.netapp.models.VolumePatchPropertiesExportPolicy @@ -5555,9 +5503,28 @@ def __init__( :keyword coolness_period: Specifies the number of days after which data that is not accessed by clients will be tiered. :paramtype coolness_period: int + :keyword cool_access_retrieval_policy: coolAccessRetrievalPolicy determines the data retrieval + behavior from the cool tier to standard storage based on the read pattern for cool access + enabled volumes. The possible values for this field are: + Default - Data will be pulled from cool tier to standard storage on random reads. This policy + is the default. + OnRead - All client-driven data read is pulled from cool tier to standard storage on both + sequential and random reads. + Never - No client-driven data is pulled from cool tier to standard storage. Known values are: + "Default", "OnRead", and "Never". + :paramtype cool_access_retrieval_policy: str or + ~azure.mgmt.netapp.models.CoolAccessRetrievalPolicy :keyword snapshot_directory_visible: If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots. :paramtype snapshot_directory_visible: bool + :keyword smb_access_based_enumeration: Enables access-based enumeration share property for SMB + Shares. Only applicable for SMB/DualProtocol volume. Known values are: "Disabled" and + "Enabled". + :paramtype smb_access_based_enumeration: str or + ~azure.mgmt.netapp.models.SmbAccessBasedEnumeration + :keyword smb_non_browsable: Enables non-browsable property for SMB Shares. Only applicable for + SMB/DualProtocol volume. Known values are: "Disabled" and "Enabled". + :paramtype smb_non_browsable: str or ~azure.mgmt.netapp.models.SmbNonBrowsable """ super().__init__(**kwargs) self.location = location @@ -5576,38 +5543,29 @@ def __init__( self.unix_permissions = unix_permissions self.cool_access = cool_access self.coolness_period = coolness_period + self.cool_access_retrieval_policy = cool_access_retrieval_policy self.snapshot_directory_visible = snapshot_directory_visible + self.smb_access_based_enumeration = smb_access_based_enumeration + self.smb_non_browsable = smb_non_browsable class VolumePatchPropertiesDataProtection(_serialization.Model): """DataProtection type volumes include an object containing details of the replication. - :ivar backup: Backup Properties. - :vartype backup: ~azure.mgmt.netapp.models.VolumeBackupProperties :ivar snapshot: Snapshot properties. :vartype snapshot: ~azure.mgmt.netapp.models.VolumeSnapshotProperties """ _attribute_map = { - "backup": {"key": "backup", "type": "VolumeBackupProperties"}, "snapshot": {"key": "snapshot", "type": "VolumeSnapshotProperties"}, } - def __init__( - self, - *, - backup: Optional["_models.VolumeBackupProperties"] = None, - snapshot: Optional["_models.VolumeSnapshotProperties"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, snapshot: Optional["_models.VolumeSnapshotProperties"] = None, **kwargs: Any) -> None: """ - :keyword backup: Backup Properties. - :paramtype backup: ~azure.mgmt.netapp.models.VolumeBackupProperties :keyword snapshot: Snapshot properties. :paramtype snapshot: ~azure.mgmt.netapp.models.VolumeSnapshotProperties """ super().__init__(**kwargs) - self.backup = backup self.snapshot = snapshot @@ -5634,8 +5592,6 @@ def __init__(self, *, rules: Optional[List["_models.ExportPolicyRule"]] = None, class VolumePropertiesDataProtection(_serialization.Model): """DataProtection type volumes include an object containing details of the replication. - :ivar backup: Backup Properties. - :vartype backup: ~azure.mgmt.netapp.models.VolumeBackupProperties :ivar replication: Replication properties. :vartype replication: ~azure.mgmt.netapp.models.ReplicationObject :ivar snapshot: Snapshot properties. @@ -5645,7 +5601,6 @@ class VolumePropertiesDataProtection(_serialization.Model): """ _attribute_map = { - "backup": {"key": "backup", "type": "VolumeBackupProperties"}, "replication": {"key": "replication", "type": "ReplicationObject"}, "snapshot": {"key": "snapshot", "type": "VolumeSnapshotProperties"}, "volume_relocation": {"key": "volumeRelocation", "type": "VolumeRelocationProperties"}, @@ -5654,15 +5609,12 @@ class VolumePropertiesDataProtection(_serialization.Model): def __init__( self, *, - backup: Optional["_models.VolumeBackupProperties"] = None, replication: Optional["_models.ReplicationObject"] = None, snapshot: Optional["_models.VolumeSnapshotProperties"] = None, volume_relocation: Optional["_models.VolumeRelocationProperties"] = None, **kwargs: Any ) -> None: """ - :keyword backup: Backup Properties. - :paramtype backup: ~azure.mgmt.netapp.models.VolumeBackupProperties :keyword replication: Replication properties. :paramtype replication: ~azure.mgmt.netapp.models.ReplicationObject :keyword snapshot: Snapshot properties. @@ -5671,7 +5623,6 @@ def __init__( :paramtype volume_relocation: ~azure.mgmt.netapp.models.VolumeRelocationProperties """ super().__init__(**kwargs) - self.backup = backup self.replication = replication self.snapshot = snapshot self.volume_relocation = volume_relocation 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 b3614f1db522..0befaf9d46c4 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 @@ -29,6 +29,7 @@ class ApplicationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Application Type.""" SAP_HANA = "SAP-HANA" + ORACLE = "ORACLE" class AvsDataStore(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -40,15 +41,6 @@ class AvsDataStore(str, Enum, metaclass=CaseInsensitiveEnumMeta): """avsDataStore is disabled""" -class BackupType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of backup Manual or Scheduled.""" - - MANUAL = "Manual" - """Manual backup""" - SCHEDULED = "Scheduled" - """Scheduled backup""" - - class CheckNameResourceTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Resource type used for verification.""" @@ -81,6 +73,22 @@ class ChownMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNRESTRICTED = "Unrestricted" +class CoolAccessRetrievalPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """coolAccessRetrievalPolicy determines the data retrieval behavior from the cool tier to standard + storage based on the read pattern for cool access enabled volumes. The possible values for this + field are: + Default - Data will be pulled from cool tier to standard storage on random reads. This policy + is the default. + OnRead - All client-driven data read is pulled from cool tier to standard storage on both + sequential and random reads. + Never - No client-driven data is pulled from cool tier to standard storage. + """ + + DEFAULT = "Default" + ON_READ = "OnRead" + NEVER = "Never" + + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of identity that created the resource.""" @@ -202,12 +210,25 @@ class MirrorState(str, Enum, metaclass=CaseInsensitiveEnumMeta): class NetworkFeatures(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Basic network, or Standard features available to the volume.""" + """Network features available to the volume, or current state of update.""" BASIC = "Basic" - """Basic network feature.""" + """Basic network features.""" STANDARD = "Standard" - """Standard network feature.""" + """Standard network features.""" + BASIC_STANDARD = "Basic_Standard" + """Updating from Basic to Standard network features.""" + STANDARD_BASIC = "Standard_Basic" + """Updating from Standard to Basic network features.""" + + +class NetworkSiblingSetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Gets the status of the NetworkSiblingSet at the time the operation was called.""" + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + UPDATING = "Updating" class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -290,7 +311,7 @@ class ServiceLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): class SmbAccessBasedEnumeration(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enables access based enumeration share property for SMB Shares. Only applicable for + """Enables access-based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume. """ @@ -301,7 +322,7 @@ class SmbAccessBasedEnumeration(str, Enum, metaclass=CaseInsensitiveEnumMeta): class SmbNonBrowsable(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enables non browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume.""" + """Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume.""" DISABLED = "Disabled" """smbNonBrowsable share setting is disabled""" diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py index 3a7f07fd87ec..207ff3039ab7 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py @@ -15,7 +15,6 @@ from ._snapshots_operations import SnapshotsOperations from ._snapshot_policies_operations import SnapshotPoliciesOperations from ._backups_operations import BackupsOperations -from ._account_backups_operations import AccountBackupsOperations from ._backup_policies_operations import BackupPoliciesOperations from ._volume_quota_rules_operations import VolumeQuotaRulesOperations from ._volume_groups_operations import VolumeGroupsOperations @@ -35,7 +34,6 @@ "SnapshotsOperations", "SnapshotPoliciesOperations", "BackupsOperations", - "AccountBackupsOperations", "BackupPoliciesOperations", "VolumeQuotaRulesOperations", "VolumeGroupsOperations", diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_account_backups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_account_backups_operations.py deleted file mode 100644 index a53b3678ecad..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_account_backups_operations.py +++ /dev/null @@ -1,436 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_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", "2022-11-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "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,63}$" - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, account_name: str, backup_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", "2022-11-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "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,63}$" - ), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, account_name: str, backup_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "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,63}$" - ), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -class AccountBackupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.netapp.NetAppManagementClient`'s - :attr:`account_backups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> Iterable["_models.Backup"]: - """List Backups for a Netapp Account. - - List all Backups for a Netapp 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Backup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Backup] - :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.BackupsList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BackupsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups" - } - - @distributed_trace - def get(self, resource_group_name: str, account_name: str, backup_name: str, **kwargs: Any) -> _models.Backup: - """Get Backup for a Netapp Account. - - Gets the specified backup for a Netapp 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 backup_name: The name of the backup. Required. - :type backup_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Backup or the result of cls(response) - :rtype: ~azure.mgmt.netapp.models.Backup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Backup] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Backup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, account_name: str, backup_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}" - } - - @distributed_trace - def begin_delete( - self, resource_group_name: str, account_name: str, backup_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete Backup for a Netapp Account. - - Delete the specified Backup for a Netapp 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 backup_name: The name of the backup. Required. - :type backup_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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._delete_initial( # type: ignore - resource_group_name=resource_group_name, - account_name=account_name, - backup_name=backup_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}" - } 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 bfb5b559f8c9..f57ce10b75d9 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 @@ -30,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +43,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +52,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -67,7 +67,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,7 +82,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -97,7 +97,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,11 +111,11 @@ def build_get_request(resource_group_name: str, account_name: str, subscription_ "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -132,7 +132,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -147,11 +147,11 @@ def build_create_or_update_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -169,7 +169,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -181,11 +181,11 @@ def build_delete_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -214,11 +214,11 @@ def build_update_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -236,7 +236,7 @@ def build_renew_credentials_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -248,11 +248,11 @@ def build_renew_credentials_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") 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 f81a1828288f..b16692c01c1a 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 @@ -30,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +43,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,11 +57,11 @@ def build_list_request(resource_group_name: str, account_name: str, subscription "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -78,7 +78,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,12 +92,12 @@ def build_get_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), "backupPolicyName": _SERIALIZER.url("backup_policy_name", backup_policy_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,7 +114,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -129,12 +129,12 @@ def build_create_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), "backupPolicyName": _SERIALIZER.url("backup_policy_name", backup_policy_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -153,7 +153,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -168,12 +168,12 @@ def build_update_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), "backupPolicyName": _SERIALIZER.url("backup_policy_name", backup_policy_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -191,7 +191,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -203,12 +203,12 @@ def build_delete_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), "backupPolicyName": _SERIALIZER.url("backup_policy_name", backup_policy_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") 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 edfd5ae0d7d3..f30083fa10cf 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 @@ -6,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # 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 urllib.parse +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -18,19 +16,16 @@ ResourceNotModifiedError, map_error, ) -from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -39,54 +34,13 @@ _SERIALIZER.client_side_validation = False -def build_get_status_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", "2022-11-01")) - 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}/backupStatus", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "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,63}$" - ), - "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 = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - def build_get_volume_restore_status_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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,95 +54,7 @@ def build_get_volume_restore_status_request( "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,63}$" - ), - "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 = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_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", "2022-11-01")) - 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}/backups", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "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,63}$" - ), - "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 = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_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", "2022-11-01")) - 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}/backups/{backupName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "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,63}$" + "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}$" @@ -196,10 +62,9 @@ def build_get_request( "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}$" ), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -210,198 +75,6 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_request( - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_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", "2022-11-01")) - 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}/backups/{backupName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "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,63}$" - ), - "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}$" - ), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_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", "2022-11-01")) - 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}/backups/{backupName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "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,63}$" - ), - "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}$" - ), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "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,63}$" - ), - "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}$" - ), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_restore_files_request( - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_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", "2022-11-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}/restoreFiles", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "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,63}$" - ), - "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}$" - ), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$"), - } - - _url: str = _format_url_section(_url, **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") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - class BackupsOperations: """ .. warning:: @@ -422,12 +95,12 @@ def __init__(self, *args, **kwargs): self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_status( + def get_volume_restore_status( self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> _models.BackupStatus: - """Get volume's backup status. + ) -> _models.RestoreStatus: + """Get volume's restore status. - Get the status of the backup for a volume. + Get the status of the restore for a volume. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -439,8 +112,8 @@ def get_status( :param volume_name: The name of the volume. Required. :type volume_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: BackupStatus or the result of cls(response) - :rtype: ~azure.mgmt.netapp.models.BackupStatus + :return: RestoreStatus or the result of cls(response) + :rtype: ~azure.mgmt.netapp.models.RestoreStatus :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -455,16 +128,16 @@ def get_status( _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.BackupStatus] = kwargs.pop("cls", None) + cls: ClsType[_models.RestoreStatus] = kwargs.pop("cls", None) - request = build_get_status_request( + request = build_get_volume_restore_status_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, - template_url=self.get_status.metadata["url"], + template_url=self.get_volume_restore_status.metadata["url"], headers=_headers, params=_params, ) @@ -482,79 +155,7 @@ def get_status( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("BackupStatus", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus" - } - - @distributed_trace - def get_volume_restore_status( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> _models.RestoreStatus: - """Get volume's restore status. - - Get the status of the restore for 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RestoreStatus or the result of cls(response) - :rtype: ~azure.mgmt.netapp.models.RestoreStatus - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RestoreStatus] = kwargs.pop("cls", None) - - request = build_get_volume_restore_status_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, - template_url=self.get_volume_restore_status.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("RestoreStatus", pipeline_response) + deserialized = self._deserialize("RestoreStatus", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -564,1120 +165,3 @@ def get_volume_restore_status( get_volume_restore_status.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/restoreStatus" } - - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any - ) -> Iterable["_models.Backup"]: - """List Backups. - - List all backups for 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Backup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.Backup] - :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.BackupsList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BackupsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups" - } - - @distributed_trace - def get( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - **kwargs: Any - ) -> _models.Backup: - """Get a backup. - - Gets the specified backup of the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Backup or the result of cls(response) - :rtype: ~azure.mgmt.netapp.models.Backup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Backup] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Backup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - def _create_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Union[_models.Backup, IO], - **kwargs: Any - ) -> Optional[_models.Backup]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.Backup]] = 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, "Backup") - - request = build_create_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - 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, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("Backup", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("Backup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: _models.Backup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Create a backup. - - Create a backup for the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.Backup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Backup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Create a backup. - - Create a backup for the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Backup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Union[_models.Backup, IO], - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Create a backup. - - Create a backup for the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Is either a Backup type or a - IO type. Required. - :type body: ~azure.mgmt.netapp.models.Backup or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Backup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :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.Backup] = 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_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_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("Backup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - def _update_initial( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Optional[Union[_models.BackupPatch, IO]] = None, - **kwargs: Any - ) -> _models.Backup: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Backup] = 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, "BackupPatch") - else: - _json = None - - request = build_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Backup", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Backup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Optional[_models.BackupPatch] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Patch a backup. - - Patch a backup for the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Default value is None. - :type body: ~azure.mgmt.netapp.models.BackupPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Backup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Optional[IO] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Patch a backup. - - Patch a backup for the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Default value is None. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Backup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Optional[Union[_models.BackupPatch, IO]] = None, - **kwargs: Any - ) -> LROPoller[_models.Backup]: - """Patch a backup. - - Patch a backup for the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. Is either a BackupPatch type - or a IO type. Default value is None. - :type body: ~azure.mgmt.netapp.models.BackupPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Backup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] - :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.Backup] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_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("Backup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Delete backup. - - Delete a backup of the 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 backup_name: The name of the backup. Required. - :type backup_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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._delete_initial( # type: ignore - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - } - - def _restore_files_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Union[_models.BackupRestoreFiles, IO], - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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: - _json = self._serialize.body(body, "BackupRestoreFiles") - - request = build_restore_files_request( - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._restore_files_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - 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) - - _restore_files_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}/restoreFiles" - } - - @overload - def begin_restore_files( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: _models.BackupRestoreFiles, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Create a new Backup Restore Files request. - - Restore the specified files from the specified backup to the active filesystem. - - :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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Restore payload supplied in the body of the operation. Required. - :type body: ~azure.mgmt.netapp.models.BackupRestoreFiles - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_restore_files( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Create a new Backup Restore Files request. - - Restore the specified files from the specified backup to the active filesystem. - - :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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Restore payload supplied in the body of the operation. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_restore_files( - self, - resource_group_name: str, - account_name: str, - pool_name: str, - volume_name: str, - backup_name: str, - body: Union[_models.BackupRestoreFiles, IO], - **kwargs: Any - ) -> LROPoller[None]: - """Create a new Backup Restore Files request. - - Restore the specified files from the specified backup to the active filesystem. - - :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 backup_name: The name of the backup. Required. - :type backup_name: str - :param body: Restore payload supplied in the body of the operation. Is either a - BackupRestoreFiles type or a IO type. Required. - :type body: ~azure.mgmt.netapp.models.BackupRestoreFiles or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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._restore_files_initial( # type: ignore - resource_group_name=resource_group_name, - account_name=account_name, - pool_name=pool_name, - volume_name=volume_name, - backup_name=backup_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restore_files.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}/restoreFiles" - } 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 d8369ef249ba..fc45e70d1db4 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,7 @@ # 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 +from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -18,14 +18,16 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -38,7 +40,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -52,7 +54,7 @@ def build_check_name_availability_request(location: str, subscription_id: str, * "location": _SERIALIZER.url("location", location, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -69,7 +71,7 @@ def build_check_file_path_availability_request(location: str, subscription_id: s _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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -83,7 +85,7 @@ def build_check_file_path_availability_request(location: str, subscription_id: s "location": _SERIALIZER.url("location", location, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -100,7 +102,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -114,7 +116,7 @@ def build_check_quota_availability_request(location: str, subscription_id: str, "location": _SERIALIZER.url("location", location, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -131,7 +133,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +145,7 @@ def build_query_region_info_request(location: str, subscription_id: str, **kwarg "location": _SERIALIZER.url("location", location, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -154,6 +156,68 @@ def build_query_region_info_request(location: str, subscription_id: str, **kwarg return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_query_network_sibling_set_request(location: 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-05-01")) + 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}/providers/Microsoft.NetApp/locations/{location}/queryNetworkSiblingSet", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "location": _SERIALIZER.url("location", location, "str", min_length=1), + } + + _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_update_network_sibling_set_request(location: 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-05-01")) + 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}/providers/Microsoft.NetApp/locations/{location}/updateNetworkSiblingSet", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "location": _SERIALIZER.url("location", location, "str", min_length=1), + } + + _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 NetAppResourceOperations: """ .. warning:: @@ -469,3 +533,251 @@ def query_region_info(self, location: str, **kwargs: Any) -> _models.RegionInfo: query_region_info.metadata = { "url": "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfo" } + + @distributed_trace + def query_network_sibling_set( + self, location: str, network_sibling_set_id: str, subnet_id: str, **kwargs: Any + ) -> _models.NetworkSiblingSet: + """Describe a network sibling set. + + Get details of the specified network sibling set. + + :param location: The name of Azure region. Required. + :type location: str + :param network_sibling_set_id: Network Sibling Set ID for a group of volumes sharing networking + resources in a subnet. Required. + :type network_sibling_set_id: str + :param subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation + Microsoft.NetApp/volumes. Example + /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet}. + Required. + :type subnet_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSiblingSet or the result of cls(response) + :rtype: ~azure.mgmt.netapp.models.NetworkSiblingSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[_models.NetworkSiblingSet] = kwargs.pop("cls", None) + + _body = _models.QueryNetworkSiblingSetRequest( + network_sibling_set_id=network_sibling_set_id, subnet_id=subnet_id + ) + _json = self._serialize.body(_body, "QueryNetworkSiblingSetRequest") + + request = build_query_network_sibling_set_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.query_network_sibling_set.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkSiblingSet", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + query_network_sibling_set.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/queryNetworkSiblingSet" + } + + def _update_network_sibling_set_initial( + self, + location: str, + network_sibling_set_id: str, + subnet_id: str, + network_sibling_set_state_id: str, + network_features: Union[str, _models.NetworkFeatures] = "Basic", + **kwargs: Any + ) -> Optional[_models.NetworkSiblingSet]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[Optional[_models.NetworkSiblingSet]] = kwargs.pop("cls", None) + + _body = _models.UpdateNetworkSiblingSetRequest( + network_features=network_features, + network_sibling_set_id=network_sibling_set_id, + network_sibling_set_state_id=network_sibling_set_state_id, + subnet_id=subnet_id, + ) + _json = self._serialize.body(_body, "UpdateNetworkSiblingSetRequest") + + request = build_update_network_sibling_set_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._update_network_sibling_set_initial.metadata["url"], + 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("NetworkSiblingSet", 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) + + return deserialized + + _update_network_sibling_set_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/updateNetworkSiblingSet" + } + + @distributed_trace + def begin_update_network_sibling_set( + self, + location: str, + network_sibling_set_id: str, + subnet_id: str, + network_sibling_set_state_id: str, + network_features: Union[str, _models.NetworkFeatures] = "Basic", + **kwargs: Any + ) -> LROPoller[_models.NetworkSiblingSet]: + """Update the network features of a network sibling set. + + Update the network features of the specified network sibling set. + + :param location: The name of Azure region. Required. + :type location: str + :param network_sibling_set_id: Network Sibling Set ID for a group of volumes sharing networking + resources in a subnet. Required. + :type network_sibling_set_id: str + :param subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation + Microsoft.NetApp/volumes. Example + /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet}. + Required. + :type subnet_id: str + :param network_sibling_set_state_id: Network sibling set state Id identifying the current state + of the sibling set. Required. + :type network_sibling_set_state_id: str + :param network_features: Network features available to the volume, some such. Known values are: + "Basic", "Standard", "Basic_Standard", and "Standard_Basic". Default value is "Basic". + :type network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either NetworkSiblingSet or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.NetworkSiblingSet] + :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: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[_models.NetworkSiblingSet] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_network_sibling_set_initial( + location=location, + network_sibling_set_id=network_sibling_set_id, + subnet_id=subnet_id, + network_sibling_set_state_id=network_sibling_set_state_id, + network_features=network_features, + 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("NetworkSiblingSet", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + 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.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_update_network_sibling_set.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/updateNetworkSiblingSet" + } 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 69ff7be49b59..6e4fce5f7de6 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 @@ -27,7 +27,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +40,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +52,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht "location": _SERIALIZER.url("location", location, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -67,7 +67,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +81,7 @@ def build_get_request(location: str, quota_limit_name: str, subscription_id: str "quotaLimitName": _SERIALIZER.url("quota_limit_name", quota_limit_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") 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 dc94c3fda698..c541b615ac46 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 @@ -40,7 +40,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL 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 ec0907c3408f..f2e5d689590d 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 @@ -30,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +43,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,11 +57,11 @@ def build_list_request(resource_group_name: str, account_name: str, subscription "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -78,7 +78,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,14 +92,14 @@ def build_get_request( "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,63}$" + "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}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +116,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,14 +131,14 @@ def build_create_or_update_request( "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,63}$" + "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}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -157,7 +157,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -172,14 +172,14 @@ def build_update_request( "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,63}$" + "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}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,7 +197,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -209,14 +209,14 @@ def build_delete_request( "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,63}$" + "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}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") 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 c8eb87ae2253..accf730ef800 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 @@ -30,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +43,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,11 +57,11 @@ def build_list_request(resource_group_name: str, account_name: str, subscription "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -78,7 +78,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,12 +92,12 @@ def build_get_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), "snapshotPolicyName": _SERIALIZER.url("snapshot_policy_name", snapshot_policy_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,7 +114,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -129,12 +129,12 @@ def build_create_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), "snapshotPolicyName": _SERIALIZER.url("snapshot_policy_name", snapshot_policy_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -153,7 +153,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -168,12 +168,12 @@ def build_update_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), "snapshotPolicyName": _SERIALIZER.url("snapshot_policy_name", snapshot_policy_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -191,7 +191,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -203,12 +203,12 @@ def build_delete_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), "snapshotPolicyName": _SERIALIZER.url("snapshot_policy_name", snapshot_policy_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -222,7 +222,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -236,12 +236,12 @@ def build_list_volumes_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), "snapshotPolicyName": _SERIALIZER.url("snapshot_policy_name", snapshot_policy_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") 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 639ef7ee6c21..2e29d7446a50 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 @@ -31,7 +31,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_list_request( "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,63}$" + "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}$" @@ -75,7 +75,7 @@ def build_list_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_get_request( "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,63}$" + "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}$" @@ -123,7 +123,7 @@ def build_get_request( "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -161,7 +161,7 @@ def build_create_request( "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,63}$" + "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}$" @@ -172,7 +172,7 @@ def build_create_request( "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -214,7 +214,7 @@ def build_update_request( "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,63}$" + "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}$" @@ -225,7 +225,7 @@ def build_update_request( "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -249,7 +249,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -261,7 +261,7 @@ def build_delete_request( "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,63}$" + "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}$" @@ -272,7 +272,7 @@ def build_delete_request( "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -292,7 +292,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -305,7 +305,7 @@ def build_restore_files_request( "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,63}$" + "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}$" @@ -316,7 +316,7 @@ def build_restore_files_request( "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") 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 a8418619dae6..d04accc15912 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 @@ -30,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +45,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_by_volume_request( "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,63}$" + "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}$" @@ -69,7 +69,7 @@ def build_list_by_volume_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,7 +92,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +106,7 @@ def build_get_request( "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,63}$" + "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}$" @@ -124,7 +124,7 @@ def build_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -147,7 +147,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -162,7 +162,7 @@ def build_create_request( "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,63}$" + "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}$" @@ -180,7 +180,7 @@ def build_create_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -205,7 +205,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -220,7 +220,7 @@ def build_update_request( "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,63}$" + "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}$" @@ -238,7 +238,7 @@ def build_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -262,7 +262,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -274,7 +274,7 @@ def build_delete_request( "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,63}$" + "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}$" @@ -292,7 +292,7 @@ def build_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -312,7 +312,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -326,7 +326,7 @@ def build_get_metadata_request( "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,63}$" + "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}$" @@ -344,7 +344,7 @@ def build_get_metadata_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") 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 e2e94342982a..66e0f19af007 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 @@ -30,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +45,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,11 +59,11 @@ def build_list_by_net_app_account_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +80,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +94,7 @@ def build_get_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), "volumeGroupName": _SERIALIZER.url( "volume_group_name", @@ -106,7 +106,7 @@ def build_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -123,7 +123,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -138,7 +138,7 @@ def build_create_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), "volumeGroupName": _SERIALIZER.url( "volume_group_name", @@ -150,7 +150,7 @@ def build_create_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -168,7 +168,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -180,7 +180,7 @@ def build_delete_request( "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,63}$" + "account_name", account_name, "str", pattern=r"^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$" ), "volumeGroupName": _SERIALIZER.url( "volume_group_name", @@ -192,7 +192,7 @@ def build_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") 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 498df4677ee5..3394b232a682 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 @@ -30,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +45,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_by_volume_request( "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,63}$" + "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}$" @@ -69,7 +69,7 @@ def build_list_by_volume_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,7 +92,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +106,7 @@ def build_get_request( "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,63}$" + "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}$" @@ -117,7 +117,7 @@ def build_get_request( "volumeQuotaRuleName": _SERIALIZER.url("volume_quota_rule_name", volume_quota_rule_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,7 +140,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -155,7 +155,7 @@ def build_create_request( "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,63}$" + "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}$" @@ -166,7 +166,7 @@ def build_create_request( "volumeQuotaRuleName": _SERIALIZER.url("volume_quota_rule_name", volume_quota_rule_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -191,7 +191,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -206,7 +206,7 @@ def build_update_request( "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,63}$" + "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}$" @@ -217,7 +217,7 @@ def build_update_request( "volumeQuotaRuleName": _SERIALIZER.url("volume_quota_rule_name", volume_quota_rule_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -241,7 +241,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -253,7 +253,7 @@ def build_delete_request( "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,63}$" + "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}$" @@ -264,7 +264,7 @@ def build_delete_request( "volumeQuotaRuleName": _SERIALIZER.url("volume_quota_rule_name", volume_quota_rule_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") 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 c9e29320033c..38e5dcfe2db8 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 @@ -30,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +45,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,14 +59,14 @@ def build_list_request( "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,63}$" + "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}$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -83,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_get_request( "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,63}$" + "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}$" @@ -107,7 +107,7 @@ def build_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,7 +124,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -139,7 +139,7 @@ def build_create_or_update_request( "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,63}$" + "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}$" @@ -149,7 +149,7 @@ def build_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -168,7 +168,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -183,7 +183,7 @@ def build_update_request( "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,63}$" + "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}$" @@ -193,7 +193,7 @@ def build_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -218,7 +218,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -230,7 +230,7 @@ def build_delete_request( "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,63}$" + "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}$" @@ -240,7 +240,7 @@ def build_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if force_delete is not None: @@ -250,13 +250,54 @@ def build_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) +def build_populate_availability_zone_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-05-01")) + 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}/populateAvailabilityZone", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "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_revert_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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -269,7 +310,7 @@ def build_revert_request( "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,63}$" + "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}$" @@ -279,7 +320,7 @@ def build_revert_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -296,7 +337,7 @@ def build_reset_cifs_password_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -308,7 +349,7 @@ def build_reset_cifs_password_request( "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,63}$" + "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}$" @@ -318,7 +359,7 @@ def build_reset_cifs_password_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -332,7 +373,7 @@ def build_break_file_locks_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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -345,7 +386,7 @@ def build_break_file_locks_request( "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,63}$" + "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}$" @@ -355,7 +396,7 @@ def build_break_file_locks_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -373,7 +414,7 @@ def build_list_get_group_id_list_for_ldap_user_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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -388,7 +429,7 @@ def build_list_get_group_id_list_for_ldap_user_request( "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,63}$" + "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}$" @@ -398,7 +439,7 @@ def build_list_get_group_id_list_for_ldap_user_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -417,7 +458,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -430,7 +471,7 @@ def build_break_replication_request( "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,63}$" + "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}$" @@ -440,7 +481,7 @@ def build_break_replication_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -458,7 +499,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -471,7 +512,7 @@ def build_reestablish_replication_request( "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,63}$" + "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}$" @@ -481,7 +522,7 @@ def build_reestablish_replication_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -499,7 +540,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -513,7 +554,7 @@ def build_replication_status_request( "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,63}$" + "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}$" @@ -523,7 +564,7 @@ def build_replication_status_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -540,7 +581,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -554,7 +595,7 @@ def build_list_replications_request( "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,63}$" + "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}$" @@ -564,7 +605,7 @@ def build_list_replications_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -580,7 +621,7 @@ def build_resync_replication_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -592,7 +633,7 @@ def build_resync_replication_request( "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,63}$" + "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}$" @@ -602,7 +643,7 @@ def build_resync_replication_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -615,7 +656,7 @@ def build_delete_replication_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -627,7 +668,7 @@ def build_delete_replication_request( "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,63}$" + "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}$" @@ -637,7 +678,7 @@ def build_delete_replication_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -651,7 +692,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -664,7 +705,7 @@ def build_authorize_replication_request( "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,63}$" + "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}$" @@ -674,7 +715,7 @@ def build_authorize_replication_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -691,7 +732,7 @@ def build_re_initialize_replication_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -703,7 +744,7 @@ def build_re_initialize_replication_request( "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,63}$" + "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}$" @@ -713,7 +754,7 @@ def build_re_initialize_replication_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -727,7 +768,7 @@ def build_pool_change_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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -740,7 +781,7 @@ def build_pool_change_request( "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,63}$" + "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}$" @@ -750,7 +791,7 @@ def build_pool_change_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -768,7 +809,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", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -781,7 +822,7 @@ def build_relocate_request( "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,63}$" + "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}$" @@ -791,7 +832,7 @@ def build_relocate_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -808,7 +849,7 @@ def build_finalize_relocation_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -820,7 +861,7 @@ def build_finalize_relocation_request( "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,63}$" + "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}$" @@ -830,7 +871,7 @@ def build_finalize_relocation_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -843,7 +884,7 @@ def build_revert_relocation_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -855,7 +896,7 @@ def build_revert_relocation_request( "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,63}$" + "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}$" @@ -865,7 +906,7 @@ def build_revert_relocation_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1709,6 +1750,144 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}" } + 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 = { + 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.Volume]] = kwargs.pop("cls", None) + + request = build_populate_availability_zone_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, + template_url=self._populate_availability_zone_initial.metadata["url"], + 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("Volume", 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) + + return deserialized + + _populate_availability_zone_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/populateAvailabilityZone" + } + + @distributed_trace + def begin_populate_availability_zone( + self, resource_group_name: str, account_name: str, pool_name: str, volume_name: str, **kwargs: Any + ) -> LROPoller[_models.Volume]: + """Populate Availability Zone. + + This operation will populate availability zone information for 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Volume or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume] + :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.Volume] = 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._populate_availability_zone_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("Volume", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + 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.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_populate_availability_zone.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/populateAvailabilityZone" + } + def _revert_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, 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 aa8c803178ea..af79e541af23 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_CreateOrUpdate.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 25767b95548f..ea6ffbfb092b 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 @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_CreateOrUpdateAD.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 92f235f6280b..332cc2d5befd 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_delete.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 c62a3802792c..06f64bbe2b94 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Accounts_Get.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 2fb5ac3d95ce..406d87bd724d 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Accounts_List.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 ea4ff6d6eebb..c95b98a629e3 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 @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_RenewCredentials.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 c63682b3dbe7..35bb3da9abf5 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/accounts_update.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_Update.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 2a2de21ccf81..689372188cb3 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 @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/BackupPolicies_Create.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 7bb78ede9956..2957aa7e659c 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 @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/BackupPolicies_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 ded7d9393c1e..bf5c3574a1bf 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/BackupPolicies_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 2a7e06f25a09..1c837c024f7f 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/BackupPolicies_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 128fb7f82bc9..8aa2908ad7db 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 @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/BackupPolicies_Update.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/BackupPolicies_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_account_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_account_delete.py deleted file mode 100644 index 8d26689cfd10..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_account_delete.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python backups_account_delete.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.account_backups.begin_delete( - resource_group_name="resourceGroup", - account_name="accountName", - backup_name="backupName", - ).result() - - -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Account_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_create.py deleted file mode 100644 index 1376752ffe93..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_create.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python backups_create.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.backups.begin_create( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - backup_name="backup1", - body={"location": "eastus", "properties": {"label": "myLabel"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Create.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_delete.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_delete.py deleted file mode 100644 index 581c8171f767..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_delete.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python backups_delete.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.backups.begin_delete( - resource_group_name="resourceGroup", - account_name="accountName", - pool_name="poolName", - volume_name="volumeName", - backup_name="backupName", - ).result() - - -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_get.py deleted file mode 100644 index de12d5ac8fc8..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_get.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python backups_get.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.backups.get( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - backup_name="backup1", - ) - print(response) - - -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_list.py deleted file mode 100644 index 5ed57bc7e96a..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_list.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python backups_list.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.backups.list( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_List.json -if __name__ == "__main__": - main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_single_file_restore.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_single_file_restore.py deleted file mode 100644 index a2dc4268461a..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_single_file_restore.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python backups_single_file_restore.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.backups.begin_restore_files( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - backup_name="backup1", - body={ - "destinationVolumeId": "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1", - "fileList": ["/dir1/customer1.db", "/dir1/customer2.db"], - }, - ).result() - - -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_SingleFileRestore.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 01b289a1e21c..1a5daca22e9b 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/GroupIdListForLDAPUser.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 093daf13f09d..989d522fb7a5 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/operation_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/operation_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/OperationList.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 3eab02df311c..d95c1540813b 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 @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Pools_CreateOrUpdate.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 ec98b1018e30..36f9bc78a1a1 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Pools_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 7b44fc133ad5..8729a551c62d 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Pools_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 5b4df7bcfaaf..16bab76a7ab3 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/pools_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Pools_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 3ad2bf58d49c..f108dd4dd421 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 @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/QuotaLimits_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 3c1fd1f0a572..3145476de32c 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 @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/QuotaLimits_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 dadb47058543..99b022eb5d21 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/region_info.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/region_info.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/RegionInfo.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/RegionInfo.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 33c24ec5f183..d88be77e3aed 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 @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/SnapshotPolicies_Create.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 f64d85ec9ba2..3a47380c60ba 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 @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/SnapshotPolicies_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 8534eb0933a1..35a31554e7fe 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/SnapshotPolicies_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 210c25c013a7..7f4115be5849 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/SnapshotPolicies_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 1d62113e0ee9..b241687484be 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/SnapshotPolicies_ListVolumes.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 c435c8615e6c..216b3ddcd6df 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 @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/SnapshotPolicies_Update.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 ef51871b6765..5bc065495032 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_create.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Snapshots_Create.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 648323f9dc26..1619675cf3ee 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Snapshots_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 d9d3b20ae68e..8c092f122750 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Snapshots_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 61cdd4ffc1d4..dbf2863bcc0d 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/snapshots_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Snapshots_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 fad7277c8f26..beabd20d23f9 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 @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Snapshots_SingleFileRestore.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 0b21c2dfceab..6399e9094782 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_create.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_create.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Subvolumes_Create.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 3b676313aa1b..d2a3b2d3d18e 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Subvolumes_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 d748208eafaf..0520735de775 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Subvolumes_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 db4216955275..146562b5a59c 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Subvolumes_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 bfd8da7ac9fc..d47b8497dbad 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_metadata.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_metadata.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Subvolumes_Metadata.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 f09dc7975301..544d4e51ee45 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/subvolumes_update.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Subvolumes_Update.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Subvolumes_Update.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create.py deleted file mode 100644 index 2df3700401c3..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python volume_groups_create.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.volume_groups.begin_create( - resource_group_name="myRG", - account_name="account1", - volume_group_name="group1", - body={ - "location": "westus", - "properties": { - "groupMetaData": { - "applicationIdentifier": "DEV", - "applicationType": "SAP-HANA", - "deploymentSpecId": "20542149-bfca-5618-1879-9863dc6767f1", - "groupDescription": "Volume group", - }, - "volumes": [ - { - "name": "test-data-mnt00001", - "properties": { - "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", - "creationToken": "test-data-mnt00001", - "proximityPlacementGroup": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", - "serviceLevel": "Premium", - "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", - "throughputMibps": 10, - "usageThreshold": 107374182400, - "volumeSpecName": "data", - }, - }, - { - "name": "test-log-mnt00001", - "properties": { - "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", - "creationToken": "test-log-mnt00001", - "proximityPlacementGroup": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", - "serviceLevel": "Premium", - "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", - "throughputMibps": 10, - "usageThreshold": 107374182400, - "volumeSpecName": "log", - }, - }, - { - "name": "test-shared", - "properties": { - "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", - "creationToken": "test-shared", - "proximityPlacementGroup": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", - "serviceLevel": "Premium", - "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", - "throughputMibps": 10, - "usageThreshold": 107374182400, - "volumeSpecName": "shared", - }, - }, - ], - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeGroups_Create.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 new file mode 100644 index 000000000000..9609c475c14d --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_oracle.py @@ -0,0 +1,462 @@ +# 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 volume_groups_create_oracle.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.volume_groups.begin_create( + resource_group_name="myRG", + account_name="account1", + volume_group_name="group1", + body={ + "location": "westus", + "properties": { + "groupMetaData": { + "applicationIdentifier": "OR2", + "applicationType": "ORACLE", + "groupDescription": "Volume group", + }, + "volumes": [ + { + "name": "test-ora-data1", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-ora-data1", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "ora-data1", + }, + "zones": ["1"], + }, + { + "name": "test-ora-data2", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-ora-data2", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "ora-data2", + }, + "zones": ["1"], + }, + { + "name": "test-ora-data3", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-ora-data3", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "ora-data3", + }, + "zones": ["1"], + }, + { + "name": "test-ora-data4", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-ora-data4", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "ora-data4", + }, + "zones": ["1"], + }, + { + "name": "test-ora-data5", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-ora-data5", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "ora-data5", + }, + "zones": ["1"], + }, + { + "name": "test-ora-data6", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-ora-data6", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "ora-data6", + }, + "zones": ["1"], + }, + { + "name": "test-ora-data7", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-ora-data7", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "ora-data7", + }, + "zones": ["1"], + }, + { + "name": "test-ora-data8", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-ora-data8", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "ora-data8", + }, + "zones": ["1"], + }, + { + "name": "test-ora-log", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-ora-log", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "ora-log", + }, + "zones": ["1"], + }, + { + "name": "test-ora-log-mirror", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-ora-log-mirror", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "ora-log-mirror", + }, + "zones": ["1"], + }, + { + "name": "test-ora-binary", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-ora-binary", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "ora-binary", + }, + "zones": ["1"], + }, + { + "name": "test-ora-backup", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-ora-backup", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "ora-backup", + }, + "zones": ["1"], + }, + ], + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 new file mode 100644 index 000000000000..d1ad5d3416e9 --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_create_sap_hana.py @@ -0,0 +1,224 @@ +# 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 volume_groups_create_sap_hana.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.volume_groups.begin_create( + resource_group_name="myRG", + account_name="account1", + volume_group_name="group1", + body={ + "location": "westus", + "properties": { + "groupMetaData": { + "applicationIdentifier": "SH9", + "applicationType": "SAP-HANA", + "groupDescription": "Volume group", + }, + "volumes": [ + { + "name": "test-data-mnt00001", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-data-mnt00001", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "proximityPlacementGroup": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "data", + }, + }, + { + "name": "test-log-mnt00001", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-log-mnt00001", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "proximityPlacementGroup": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "log", + }, + }, + { + "name": "test-shared", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-shared", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "proximityPlacementGroup": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "shared", + }, + }, + { + "name": "test-data-backup", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-data-backup", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "proximityPlacementGroup": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "data-backup", + }, + }, + { + "name": "test-log-backup", + "properties": { + "capacityPoolResourceId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + "creationToken": "test-log-backup", + "exportPolicy": { + "rules": [ + { + "allowedClients": "0.0.0.0/0", + "cifs": False, + "hasRootAccess": True, + "kerberos5ReadOnly": False, + "kerberos5ReadWrite": False, + "kerberos5iReadOnly": False, + "kerberos5iReadWrite": False, + "kerberos5pReadOnly": False, + "kerberos5pReadWrite": False, + "nfsv3": False, + "nfsv41": True, + "ruleIndex": 1, + "unixReadOnly": True, + "unixReadWrite": True, + } + ] + }, + "protocolTypes": ["NFSv4.1"], + "proximityPlacementGroup": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + "serviceLevel": "Premium", + "subnetId": "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + "throughputMibps": 10, + "usageThreshold": 107374182400, + "volumeSpecName": "log-backup", + }, + }, + ], + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 566332de421b..00b668191db3 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 @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeGroups_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/VolumeGroups_Delete.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_oracle.py similarity index 93% rename from sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get.py rename to sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_oracle.py index 7efc4fd45d52..3e47cb6a9225 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_oracle.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-netapp # USAGE - python volume_groups_get.py + python volume_groups_get_oracle.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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeGroups_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/VolumeGroups_Get_Oracle.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_account_get.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_sap_hana.py similarity index 88% rename from sdk/netapp/azure-mgmt-netapp/generated_samples/backups_account_get.py rename to sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_sap_hana.py index c9b29934e2f3..a7b072db42f2 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_account_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_get_sap_hana.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-netapp # USAGE - python backups_account_get.py + python volume_groups_get_sap_hana.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, @@ -29,14 +29,14 @@ def main(): subscription_id="D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", ) - response = client.account_backups.get( + response = client.volume_groups.get( resource_group_name="myRG", account_name="account1", - backup_name="backup1", + volume_group_name="group1", ) print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Account_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/VolumeGroups_Get_SapHana.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_oracle.py similarity index 93% rename from sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list.py rename to sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_oracle.py index 966e05ef4852..1cb96d731abd 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_oracle.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-netapp # USAGE - python volume_groups_list.py + python volume_groups_list_oracle.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, @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeGroups_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/VolumeGroups_List_Oracle.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_account_list.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_sap_hana.py similarity index 89% rename from sdk/netapp/azure-mgmt-netapp/generated_samples/backups_account_list.py rename to sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_sap_hana.py index 17580c960f7e..f1be50a9632b 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_account_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volume_groups_list_sap_hana.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-netapp # USAGE - python backups_account_list.py + python volume_groups_list_sap_hana.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, @@ -29,7 +29,7 @@ def main(): subscription_id="D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", ) - response = client.account_backups.list( + response = client.volume_groups.list_by_net_app_account( resource_group_name="myRG", account_name="account1", ) @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Account_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 24e3a9d99e9e..615df3684a98 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 @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeQuotaRules_Create.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 fa58d10ea2b5..aa7e4d914dd0 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 @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeQuotaRules_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 116211a605e0..0d10791ccce7 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeQuotaRules_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 5e3983a99bac..811b46255e03 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 @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeQuotaRules_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 05b9d1a6a1a8..d7082eace5e8 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 @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeQuotaRules_Update.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 c0275eb9b1f6..c35433580065 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 @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_AuthorizeReplication.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_AuthorizeReplication.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_backup_status.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_backup_status.py deleted file mode 100644 index 068aadad4a94..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_backup_status.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.netapp import NetAppManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-netapp -# USAGE - python volumes_backup_status.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.backups.get_status( - resource_group_name="myRG", - account_name="account1", - pool_name="pool1", - volume_name="volume1", - ) - print(response) - - -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_BackupStatus.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 b6cf93ba0517..a7d322c84fe1 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 @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_BreakFileLocks.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 da831d286d6f..b7926158ca3f 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 @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_BreakReplication.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_BreakReplication.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 6fda686dde16..1d0f9bd79788 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 @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_CreateOrUpdate.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 0bdefe5d0242..20bea9132667 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_Delete.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 78bc434610f2..e0efec83fed4 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 @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_DeleteReplication.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_DeleteReplication.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 ece343c0fb43..d7430cad0776 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 @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_FinalizeRelocation.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 eb02040644e1..a9f99e77ad61 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_get.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_Get.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_Get.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 0f8581d64cb2..753626d24db2 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_List.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 308f6f0b9101..06768e455712 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 @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_ListReplications.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_ListReplications.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 ce06998f7251..ea47cb6d0f7b 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 @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_PoolChange.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_PoolChange.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_update.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_populate_availability_zones.py similarity index 88% rename from sdk/netapp/azure-mgmt-netapp/generated_samples/backups_update.py rename to sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_populate_availability_zones.py index 95dd71581eea..d94639de0df8 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/backups_update.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_populate_availability_zones.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-netapp # USAGE - python backups_update.py + python volumes_populate_availability_zones.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, @@ -29,16 +29,15 @@ def main(): subscription_id="D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", ) - response = client.backups.begin_update( + response = client.volumes.begin_populate_availability_zone( resource_group_name="myRG", account_name="account1", pool_name="pool1", volume_name="volume1", - backup_name="backup1", ).result() print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Update.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 64e73a42e889..0e1c375e25c6 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 @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_ReInitializeReplication.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 0ae7bc63a777..3ce2dd20e3c8 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 @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_ReestablishReplication.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 e687ec5cb7ca..cac6aa5df420 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_relocate.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_relocate.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_Relocate.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 99c55a30c33f..9a4cd77dc328 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_ReplicationStatus.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 5b8ac9160ecf..759a819ceec9 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 @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_ResetCifsPassword.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_ResetCifsPassword.json if __name__ == "__main__": main() diff --git a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_restore_status.py b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_restore_status.py index 185f46d18d7e..f0d0666bf248 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_restore_status.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_restore_status.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_RestoreStatus.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_RestoreStatus.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 1e803e9838db..c182c83a7f2b 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 @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_ResyncReplication.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 b35f08110865..8beebaac1f9c 100644 --- a/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert.py +++ b/sdk/netapp/azure-mgmt-netapp/generated_samples/volumes_revert.py @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_Revert.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/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 34868af7ad33..4048780b1b97 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 @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_RevertRelocation.json +# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_RevertRelocation.json if __name__ == "__main__": main()