From 1563d2829db50d3e26f0dd21dc7c3e0ea0e350ac Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sat, 12 Feb 2022 02:04:49 +0000 Subject: [PATCH] CodeGen from PR 17827 in Azure/azure-rest-api-specs Merge 6298506a310492065a6a2db33e5f34b7515800fd into 0229905ebb1e140b68ce2f4b90ef185dea0f79ad --- sdk/netapp/azure-mgmt-netapp/_meta.json | 2 +- .../azure/mgmt/netapp/_configuration.py | 2 +- .../azure/mgmt/netapp/_metadata.json | 7 +- .../mgmt/netapp/_net_app_management_client.py | 5 +- .../azure/mgmt/netapp/_version.py | 2 +- .../azure/mgmt/netapp/aio/_configuration.py | 2 +- .../netapp/aio/_net_app_management_client.py | 5 +- .../mgmt/netapp/aio/operations/__init__.py | 2 + .../aio/operations/_snapshots_operations.py | 130 ++- .../aio/operations/_subvolumes_operations.py | 720 +++++++++++++ .../aio/operations/_volumes_operations.py | 7 + .../azure/mgmt/netapp/models/__init__.py | 14 + .../azure/mgmt/netapp/models/_models_py3.py | 413 +++++++- .../_net_app_management_client_enums.py | 9 + .../azure/mgmt/netapp/operations/__init__.py | 2 + .../operations/_account_backups_operations.py | 6 +- .../netapp/operations/_accounts_operations.py | 12 +- .../operations/_backup_policies_operations.py | 10 +- .../netapp/operations/_backups_operations.py | 14 +- .../_net_app_resource_operations.py | 6 +- ...et_app_resource_quota_limits_operations.py | 4 +- .../mgmt/netapp/operations/_operations.py | 2 +- .../netapp/operations/_pools_operations.py | 10 +- .../_snapshot_policies_operations.py | 12 +- .../operations/_snapshots_operations.py | 186 +++- .../operations/_subvolumes_operations.py | 978 ++++++++++++++++++ .../netapp/operations/_vaults_operations.py | 2 +- .../operations/_volume_groups_operations.py | 8 +- .../netapp/operations/_volumes_operations.py | 37 +- 29 files changed, 2531 insertions(+), 78 deletions(-) create mode 100644 sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_subvolumes_operations.py create mode 100644 sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_subvolumes_operations.py diff --git a/sdk/netapp/azure-mgmt-netapp/_meta.json b/sdk/netapp/azure-mgmt-netapp/_meta.json index fc87a8fa38030..bf835be2709c4 100644 --- a/sdk/netapp/azure-mgmt-netapp/_meta.json +++ b/sdk/netapp/azure-mgmt-netapp/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.12.0", "@autorest/modelerfour@4.19.3" ], - "commit": "4822ca2526928075b1278df6788ea88d6f6586fe", + "commit": "46ad97970c9c2050396de6d1d0f586166b8d0417", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/netapp/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/netapp/resource-manager/readme.md" 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 7dbd4c884fc61..f641660ee7403 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-08-01" + self.api_version = "2021-10-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-netapp/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_metadata.json b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_metadata.json index aaf44ea3ab6f5..9cf1df5116b1d 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_metadata.json +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2021-08-01", - "total_api_version_list": ["2021-08-01"], + "chosen_version": "2021-10-01", + "total_api_version_list": ["2021-10-01"], "client": { "name": "NetAppManagementClient", "filename": "_net_app_management_client", @@ -109,6 +109,7 @@ "account_backups": "AccountBackupsOperations", "backup_policies": "BackupPoliciesOperations", "vaults": "VaultsOperations", - "volume_groups": "VolumeGroupsOperations" + "volume_groups": "VolumeGroupsOperations", + "subvolumes": "SubvolumesOperations" } } \ No newline at end of file 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 3173cbab61ebe..aa2fcdaaf8ae7 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 @@ -15,7 +15,7 @@ from . import models from ._configuration import NetAppManagementClientConfiguration -from .operations import AccountBackupsOperations, AccountsOperations, BackupPoliciesOperations, BackupsOperations, NetAppResourceOperations, NetAppResourceQuotaLimitsOperations, Operations, PoolsOperations, SnapshotPoliciesOperations, SnapshotsOperations, VaultsOperations, VolumeGroupsOperations, VolumesOperations +from .operations import AccountBackupsOperations, AccountsOperations, BackupPoliciesOperations, BackupsOperations, NetAppResourceOperations, NetAppResourceQuotaLimitsOperations, Operations, PoolsOperations, SnapshotPoliciesOperations, SnapshotsOperations, SubvolumesOperations, VaultsOperations, VolumeGroupsOperations, VolumesOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -51,6 +51,8 @@ class NetAppManagementClient: :vartype vaults: azure.mgmt.netapp.operations.VaultsOperations :ivar volume_groups: VolumeGroupsOperations operations :vartype volume_groups: azure.mgmt.netapp.operations.VolumeGroupsOperations + :ivar subvolumes: SubvolumesOperations operations + :vartype subvolumes: azure.mgmt.netapp.operations.SubvolumesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure @@ -89,6 +91,7 @@ def __init__( self.backup_policies = BackupPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize) self.volume_groups = VolumeGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.subvolumes = SubvolumesOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request( 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 08b59bc06f083..e786ca9d25659 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 = "6.0.1" +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 62d66353af207..037ccb42cda78 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 @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-08-01" + self.api_version = "2021-10-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-netapp/{}'.format(VERSION)) self._configure(**kwargs) 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 46f034177fadc..c4639d602d3da 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 @@ -15,7 +15,7 @@ from .. import models from ._configuration import NetAppManagementClientConfiguration -from .operations import AccountBackupsOperations, AccountsOperations, BackupPoliciesOperations, BackupsOperations, NetAppResourceOperations, NetAppResourceQuotaLimitsOperations, Operations, PoolsOperations, SnapshotPoliciesOperations, SnapshotsOperations, VaultsOperations, VolumeGroupsOperations, VolumesOperations +from .operations import AccountBackupsOperations, AccountsOperations, BackupPoliciesOperations, BackupsOperations, NetAppResourceOperations, NetAppResourceQuotaLimitsOperations, Operations, PoolsOperations, SnapshotPoliciesOperations, SnapshotsOperations, SubvolumesOperations, VaultsOperations, VolumeGroupsOperations, VolumesOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -51,6 +51,8 @@ class NetAppManagementClient: :vartype vaults: azure.mgmt.netapp.aio.operations.VaultsOperations :ivar volume_groups: VolumeGroupsOperations operations :vartype volume_groups: azure.mgmt.netapp.aio.operations.VolumeGroupsOperations + :ivar subvolumes: SubvolumesOperations operations + :vartype subvolumes: azure.mgmt.netapp.aio.operations.SubvolumesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure @@ -89,6 +91,7 @@ def __init__( self.backup_policies = BackupPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize) self.volume_groups = VolumeGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.subvolumes = SubvolumesOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request( 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 ce5a3a9ff24fa..8e72a6f608831 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 @@ -19,6 +19,7 @@ from ._backup_policies_operations import BackupPoliciesOperations from ._vaults_operations import VaultsOperations from ._volume_groups_operations import VolumeGroupsOperations +from ._subvolumes_operations import SubvolumesOperations __all__ = [ 'Operations', @@ -34,4 +35,5 @@ 'BackupPoliciesOperations', 'VaultsOperations', 'VolumeGroupsOperations', + 'SubvolumesOperations', ] diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshots_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshots_operations.py index 65141d6fa001f..00484d9f11607 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshots_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshots_operations.py @@ -22,7 +22,7 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._snapshots_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial +from ...operations._snapshots_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_restore_files_request_initial, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -589,3 +589,131 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} # type: ignore + + async def _restore_files_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: "_models.SnapshotRestoreFiles", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(body, 'SnapshotRestoreFiles') + + request = build_restore_files_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, + content_type=content_type, + json=_json, + template_url=self._restore_files_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_files_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}/restoreFiles'} # type: ignore + + + @distributed_trace_async + async def begin_restore_files( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: "_models.SnapshotRestoreFiles", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Create a new Snapshot Restore Files request. + + Restore the specified files from the specified snapshot to the active filesystem. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :type volume_name: str + :param snapshot_name: The name of the snapshot. + :type snapshot_name: str + :param body: Restore payload supplied in the body of the operation. + :type body: ~azure.mgmt.netapp.models.SnapshotRestoreFiles + :keyword callable cls: A custom type or function 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 + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_files_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, + body=body, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_restore_files.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}/restoreFiles'} # type: ignore diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_subvolumes_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_subvolumes_operations.py new file mode 100644 index 0000000000000..bcc31207a63f1 --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_subvolumes_operations.py @@ -0,0 +1,720 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +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.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._subvolumes_operations import build_create_request_initial, build_delete_request_initial, build_get_metadata_request_initial, build_get_request, build_list_by_volume_request, build_update_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SubvolumesOperations: + """SubvolumesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.netapp.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_volume( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SubvolumesList"]: + """List of all the subvolumes. + + Returns a list of the subvolumes in the volume. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :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 SubvolumesList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.SubvolumesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_volume_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + template_url=self.list_by_volume.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_volume_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + template_url=next_link, + ) + 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("SubvolumesList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_volume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes'} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any + ) -> "_models.SubvolumeInfo": + """Get the path associated with the subvolumeName. + + Returns the path associated with the subvolumeName provided. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :type volume_name: str + :param subvolume_name: The name of the subvolume. + :type subvolume_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SubvolumeInfo, or the result of cls(response) + :rtype: ~azure.mgmt.netapp.models.SubvolumeInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SubvolumeInfo', 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}/subvolumes/{subvolumeName}'} # type: ignore + + + async def _create_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: "_models.SubvolumeInfo", + **kwargs: Any + ) -> Optional["_models.SubvolumeInfo"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SubvolumeInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(body, 'SubvolumeInfo') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SubvolumeInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SubvolumeInfo', 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}/subvolumes/{subvolumeName}'} # type: ignore + + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: "_models.SubvolumeInfo", + **kwargs: Any + ) -> AsyncLROPoller["_models.SubvolumeInfo"]: + """Create or clone a new subvolume. + + Creates a subvolume in the path or clones the subvolume mentioned in the parentPath. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :type volume_name: str + :param subvolume_name: The name of the subvolume. + :type subvolume_name: str + :param body: Subvolume object supplied in the body of the operation. + :type body: ~azure.mgmt.netapp.models.SubvolumeInfo + :keyword callable cls: A custom type or function 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 SubvolumeInfo or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.SubvolumeInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + body=body, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('SubvolumeInfo', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: "_models.SubvolumePatchRequest", + **kwargs: Any + ) -> Optional["_models.SubvolumeInfo"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SubvolumeInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(body, 'SubvolumePatchRequest') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SubvolumeInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}'} # type: ignore + + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: "_models.SubvolumePatchRequest", + **kwargs: Any + ) -> AsyncLROPoller["_models.SubvolumeInfo"]: + """Update a subvolume. + + Patch a subvolume. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :type volume_name: str + :param subvolume_name: The name of the subvolume. + :type subvolume_name: str + :param body: Subvolume object supplied in the body of the operation. + :type body: ~azure.mgmt.netapp.models.SubvolumePatchRequest + :keyword callable cls: A custom type or function 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 SubvolumeInfo or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.SubvolumeInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + body=body, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('SubvolumeInfo', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a subvolume. + + Delete subvolume. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :type volume_name: str + :param subvolume_name: The name of the subvolume. + :type subvolume_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}'} # type: ignore + + async def _get_metadata_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any + ) -> Optional["_models.SubvolumeModel"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SubvolumeModel"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_metadata_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + template_url=self._get_metadata_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SubvolumeModel', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _get_metadata_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}/getMetadata'} # type: ignore + + + @distributed_trace_async + async def begin_get_metadata( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.SubvolumeModel"]: + """Describe a subvolume. + + Get details of the specified subvolume. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :type volume_name: str + :param subvolume_name: The name of the subvolume. + :type subvolume_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 SubvolumeModel or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.SubvolumeModel] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeModel"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_metadata_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('SubvolumeModel', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_get_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}/getMetadata'} # type: ignore 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 66433016d648f..89277da68d6ad 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 @@ -462,6 +462,7 @@ async def _delete_initial( account_name: str, pool_name: str, volume_name: str, + force_delete: Optional[bool] = None, **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -477,6 +478,7 @@ async def _delete_initial( account_name=account_name, pool_name=pool_name, volume_name=volume_name, + force_delete=force_delete, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) @@ -502,6 +504,7 @@ async def begin_delete( account_name: str, pool_name: str, volume_name: str, + force_delete: Optional[bool] = None, **kwargs: Any ) -> AsyncLROPoller[None]: """Delete a volume. @@ -516,6 +519,9 @@ async def begin_delete( :type pool_name: str :param volume_name: The name of the volume. :type volume_name: str + :param force_delete: An option to force delete the volume. Will cleanup resources connected to + the particular volume. + :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -541,6 +547,7 @@ async def begin_delete( account_name=account_name, pool_name=pool_name, volume_name=volume_name, + force_delete=force_delete, cls=lambda x,y,z: x, **kwargs ) 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 5d5e0343f13eb..c1875ba4618cd 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 @@ -28,6 +28,7 @@ from ._models_py3 import ExportPolicyRule from ._models_py3 import FilePathAvailabilityRequest from ._models_py3 import HourlySchedule +from ._models_py3 import LdapSearchScopeOpt from ._models_py3 import LogSpecification from ._models_py3 import MetricSpecification from ._models_py3 import MonthlySchedule @@ -56,9 +57,14 @@ from ._models_py3 import SnapshotPolicyDetails from ._models_py3 import SnapshotPolicyPatch from ._models_py3 import SnapshotPolicyVolumeList +from ._models_py3 import SnapshotRestoreFiles from ._models_py3 import SnapshotsList from ._models_py3 import SubscriptionQuotaItem from ._models_py3 import SubscriptionQuotaItemList +from ._models_py3 import SubvolumeInfo +from ._models_py3 import SubvolumeModel +from ._models_py3 import SubvolumePatchRequest +from ._models_py3 import SubvolumesList from ._models_py3 import SystemData from ._models_py3 import Vault from ._models_py3 import VaultList @@ -90,6 +96,7 @@ CheckQuotaNameResourceTypes, ChownMode, CreatedByType, + EnableSubvolumes, EncryptionType, EndpointType, InAvailabilityReasonType, @@ -127,6 +134,7 @@ 'ExportPolicyRule', 'FilePathAvailabilityRequest', 'HourlySchedule', + 'LdapSearchScopeOpt', 'LogSpecification', 'MetricSpecification', 'MonthlySchedule', @@ -155,9 +163,14 @@ 'SnapshotPolicyDetails', 'SnapshotPolicyPatch', 'SnapshotPolicyVolumeList', + 'SnapshotRestoreFiles', 'SnapshotsList', 'SubscriptionQuotaItem', 'SubscriptionQuotaItemList', + 'SubvolumeInfo', + 'SubvolumeModel', + 'SubvolumePatchRequest', + 'SubvolumesList', 'SystemData', 'Vault', 'VaultList', @@ -186,6 +199,7 @@ 'CheckQuotaNameResourceTypes', 'ChownMode', 'CreatedByType', + 'EnableSubvolumes', 'EncryptionType', 'EndpointType', 'InAvailabilityReasonType', 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 c8239b06064b3..e3e98c9367705 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 @@ -101,6 +101,8 @@ class ActiveDirectory(msrest.serialization.Model): :ivar encrypt_dc_connections: If enabled, Traffic between the SMB server to Domain Controller (DC) will be encrypted. :vartype encrypt_dc_connections: bool + :ivar ldap_search_scope: LDAP Search scope options. + :vartype ldap_search_scope: ~azure.mgmt.netapp.models.LdapSearchScopeOpt """ _validation = { @@ -134,6 +136,7 @@ class ActiveDirectory(msrest.serialization.Model): 'ldap_over_tls': {'key': 'ldapOverTLS', 'type': 'bool'}, 'allow_local_nfs_users_with_ldap': {'key': 'allowLocalNfsUsersWithLdap', 'type': 'bool'}, 'encrypt_dc_connections': {'key': 'encryptDCConnections', 'type': 'bool'}, + 'ldap_search_scope': {'key': 'ldapSearchScope', 'type': 'LdapSearchScopeOpt'}, } def __init__( @@ -158,6 +161,7 @@ def __init__( ldap_over_tls: Optional[bool] = None, allow_local_nfs_users_with_ldap: Optional[bool] = None, encrypt_dc_connections: Optional[bool] = None, + ldap_search_scope: Optional["LdapSearchScopeOpt"] = None, **kwargs ): """ @@ -213,6 +217,8 @@ def __init__( :keyword encrypt_dc_connections: If enabled, Traffic between the SMB server to Domain Controller (DC) will be encrypted. :paramtype encrypt_dc_connections: bool + :keyword ldap_search_scope: LDAP Search scope options. + :paramtype ldap_search_scope: ~azure.mgmt.netapp.models.LdapSearchScopeOpt """ super(ActiveDirectory, self).__init__(**kwargs) self.active_directory_id = active_directory_id @@ -236,6 +242,7 @@ def __init__( self.ldap_over_tls = ldap_over_tls self.allow_local_nfs_users_with_ldap = allow_local_nfs_users_with_ldap self.encrypt_dc_connections = encrypt_dc_connections + self.ldap_search_scope = ldap_search_scope class AuthorizeRequest(msrest.serialization.Model): @@ -489,6 +496,8 @@ class BackupPolicy(msrest.serialization.Model): :vartype type: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.netapp.models.SystemData :ivar backup_policy_id: Backup Policy Resource ID. :vartype backup_policy_id: str :ivar provisioning_state: Azure lifecycle management. @@ -513,6 +522,7 @@ class BackupPolicy(msrest.serialization.Model): 'name': {'readonly': True}, 'etag': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'backup_policy_id': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'volumes_assigned': {'readonly': True}, @@ -526,6 +536,7 @@ class BackupPolicy(msrest.serialization.Model): 'etag': {'key': 'etag', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'backup_policy_id': {'key': 'properties.backupPolicyId', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'daily_backups_to_keep': {'key': 'properties.dailyBackupsToKeep', 'type': 'int'}, @@ -568,6 +579,7 @@ def __init__( self.etag = None self.type = None self.tags = tags + self.system_data = None self.backup_policy_id = None self.provisioning_state = None self.daily_backups_to_keep = daily_backups_to_keep @@ -913,9 +925,11 @@ class CapacityPool(msrest.serialization.Model): :vartype type: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.netapp.models.SystemData :ivar pool_id: UUID v4 used to identify the Pool. :vartype pool_id: str - :ivar size: Required. Provisioned size of the pool (in bytes). Allowed values are in 4TiB + :ivar size: Required. Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be multiply of 4398046511104). :vartype size: long :ivar service_level: Required. The service level of the file system. Possible values include: @@ -943,8 +957,9 @@ class CapacityPool(msrest.serialization.Model): 'name': {'readonly': True}, 'etag': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'pool_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}$'}, - 'size': {'required': True, 'maximum': 549755813888000, 'minimum': 4398046511104}, + 'size': {'required': True}, 'service_level': {'required': True}, 'provisioning_state': {'readonly': True}, 'total_throughput_mibps': {'readonly': True}, @@ -958,6 +973,7 @@ class CapacityPool(msrest.serialization.Model): 'etag': {'key': 'etag', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'pool_id': {'key': 'properties.poolId', 'type': 'str'}, 'size': {'key': 'properties.size', 'type': 'long'}, 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, @@ -973,7 +989,7 @@ def __init__( self, *, location: str, - size: int, + size: int = 4398046511104, service_level: Union[str, "ServiceLevel"] = "Premium", tags: Optional[Dict[str, str]] = None, qos_type: Optional[Union[str, "QosType"]] = None, @@ -986,7 +1002,7 @@ def __init__( :paramtype location: str :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] - :keyword size: Required. Provisioned size of the pool (in bytes). Allowed values are in 4TiB + :keyword size: Required. Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be multiply of 4398046511104). :paramtype size: long :keyword service_level: Required. The service level of the file system. Possible values @@ -1008,6 +1024,7 @@ def __init__( self.etag = None self.type = None self.tags = tags + self.system_data = None self.pool_id = None self.size = size self.service_level = service_level @@ -1066,7 +1083,7 @@ class CapacityPoolPatch(msrest.serialization.Model): :vartype type: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] - :ivar size: Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value + :ivar size: Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be multiply of 4398046511104). :vartype size: long :ivar qos_type: The qos type of the pool. Possible values include: "Auto", "Manual". @@ -1077,7 +1094,6 @@ class CapacityPoolPatch(msrest.serialization.Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'size': {'maximum': 549755813888000, 'minimum': 4398046511104}, } _attribute_map = { @@ -1104,7 +1120,7 @@ def __init__( :paramtype location: str :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] - :keyword size: Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks + :keyword size: Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be multiply of 4398046511104). :paramtype size: long :keyword qos_type: The qos type of the pool. Possible values include: "Auto", "Manual". @@ -1510,6 +1526,53 @@ def __init__( self.used_bytes = used_bytes +class LdapSearchScopeOpt(msrest.serialization.Model): + """LDAP search scope. + + :ivar user_dn: This specifies the user DN, which overrides the base DN for user lookups. + :vartype user_dn: str + :ivar group_dn: This specifies the group DN, which overrides the base DN for group lookups. + :vartype group_dn: str + :ivar group_membership_filter: This specifies the custom LDAP search filter to be used when + looking up group membership from LDAP server. + :vartype group_membership_filter: str + """ + + _validation = { + 'user_dn': {'max_length': 255, 'min_length': 0}, + 'group_dn': {'max_length': 255, 'min_length': 0}, + 'group_membership_filter': {'max_length': 255, 'min_length': 0}, + } + + _attribute_map = { + 'user_dn': {'key': 'userDN', 'type': 'str'}, + 'group_dn': {'key': 'groupDN', 'type': 'str'}, + 'group_membership_filter': {'key': 'groupMembershipFilter', 'type': 'str'}, + } + + def __init__( + self, + *, + user_dn: Optional[str] = None, + group_dn: Optional[str] = None, + group_membership_filter: Optional[str] = None, + **kwargs + ): + """ + :keyword user_dn: This specifies the user DN, which overrides the base DN for user lookups. + :paramtype user_dn: str + :keyword group_dn: This specifies the group DN, which overrides the base DN for group lookups. + :paramtype group_dn: str + :keyword group_membership_filter: This specifies the custom LDAP search filter to be used when + looking up group membership from LDAP server. + :paramtype group_membership_filter: str + """ + super(LdapSearchScopeOpt, self).__init__(**kwargs) + self.user_dn = user_dn + self.group_dn = group_dn + self.group_membership_filter = group_membership_filter + + class LogSpecification(msrest.serialization.Model): """Log Definition of a single resource metric. @@ -2772,6 +2835,8 @@ class SnapshotPolicy(msrest.serialization.Model): :vartype type: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.netapp.models.SystemData :ivar hourly_schedule: Schedule for hourly snapshots. :vartype hourly_schedule: ~azure.mgmt.netapp.models.HourlySchedule :ivar daily_schedule: Schedule for daily snapshots. @@ -2792,6 +2857,7 @@ class SnapshotPolicy(msrest.serialization.Model): 'name': {'readonly': True}, 'etag': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -2802,6 +2868,7 @@ class SnapshotPolicy(msrest.serialization.Model): 'etag': {'key': 'etag', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'hourly_schedule': {'key': 'properties.hourlySchedule', 'type': 'HourlySchedule'}, 'daily_schedule': {'key': 'properties.dailySchedule', 'type': 'DailySchedule'}, 'weekly_schedule': {'key': 'properties.weeklySchedule', 'type': 'WeeklySchedule'}, @@ -2845,6 +2912,7 @@ def __init__( self.etag = None self.type = None self.tags = tags + self.system_data = None self.hourly_schedule = hourly_schedule self.daily_schedule = daily_schedule self.weekly_schedule = weekly_schedule @@ -3062,6 +3130,44 @@ def __init__( self.value = value +class SnapshotRestoreFiles(msrest.serialization.Model): + """Restore payload for Single File Snapshot Restore. + + All required parameters must be populated in order to send to Azure. + + :ivar file_paths: Required. List of files to be restored. + :vartype file_paths: list[str] + :ivar destination_path: Destination folder where the files will be restored. + :vartype destination_path: str + """ + + _validation = { + 'file_paths': {'required': True, 'max_items': 10, 'min_items': 1}, + } + + _attribute_map = { + 'file_paths': {'key': 'filePaths', 'type': '[str]'}, + 'destination_path': {'key': 'destinationPath', 'type': 'str'}, + } + + def __init__( + self, + *, + file_paths: List[str], + destination_path: Optional[str] = None, + **kwargs + ): + """ + :keyword file_paths: Required. List of files to be restored. + :paramtype file_paths: list[str] + :keyword destination_path: Destination folder where the files will be restored. + :paramtype destination_path: str + """ + super(SnapshotRestoreFiles, self).__init__(**kwargs) + self.file_paths = file_paths + self.destination_path = destination_path + + class SnapshotsList(msrest.serialization.Model): """List of Snapshots. @@ -3163,6 +3269,246 @@ def __init__( self.value = value +class SubvolumeInfo(ProxyResource): + """Subvolume Information properties. + + 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: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.netapp.models.SystemData + :ivar path: Path to the subvolume. + :vartype path: str + :ivar size: Truncate subvolume to the provided size in bytes. + :vartype size: long + :ivar parent_path: parent path to the subvolume. + :vartype parent_path: str + :ivar provisioning_state: Azure lifecycle management. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'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'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'size': {'key': 'properties.size', 'type': 'long'}, + 'parent_path': {'key': 'properties.parentPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + size: Optional[int] = None, + parent_path: Optional[str] = None, + **kwargs + ): + """ + :keyword path: Path to the subvolume. + :paramtype path: str + :keyword size: Truncate subvolume to the provided size in bytes. + :paramtype size: long + :keyword parent_path: parent path to the subvolume. + :paramtype parent_path: str + """ + super(SubvolumeInfo, self).__init__(**kwargs) + self.system_data = None + self.path = path + self.size = size + self.parent_path = parent_path + self.provisioning_state = None + + +class SubvolumeModel(msrest.serialization.Model): + """Result of the post subvolume and action is to get metadata of the subvolume. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar path: Path to the subvolume. + :vartype path: str + :ivar parent_path: Path to the parent subvolume. + :vartype parent_path: str + :ivar size: Size of subvolume. + :vartype size: long + :ivar bytes_used: Bytes used. + :vartype bytes_used: long + :ivar permissions: Permissions of the subvolume. + :vartype permissions: str + :ivar creation_time_stamp: Creation time and date. + :vartype creation_time_stamp: ~datetime.datetime + :ivar accessed_time_stamp: Most recent access time and date. + :vartype accessed_time_stamp: ~datetime.datetime + :ivar modified_time_stamp: Most recent modification time and date. + :vartype modified_time_stamp: ~datetime.datetime + :ivar changed_time_stamp: Most recent change time and date. + :vartype changed_time_stamp: ~datetime.datetime + :ivar provisioning_state: Azure lifecycle management. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'parent_path': {'key': 'properties.parentPath', 'type': 'str'}, + 'size': {'key': 'properties.size', 'type': 'long'}, + 'bytes_used': {'key': 'properties.bytesUsed', 'type': 'long'}, + 'permissions': {'key': 'properties.permissions', 'type': 'str'}, + 'creation_time_stamp': {'key': 'properties.creationTimeStamp', 'type': 'iso-8601'}, + 'accessed_time_stamp': {'key': 'properties.accessedTimeStamp', 'type': 'iso-8601'}, + 'modified_time_stamp': {'key': 'properties.modifiedTimeStamp', 'type': 'iso-8601'}, + 'changed_time_stamp': {'key': 'properties.changedTimeStamp', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + parent_path: Optional[str] = None, + size: Optional[int] = None, + bytes_used: Optional[int] = None, + permissions: Optional[str] = None, + creation_time_stamp: Optional[datetime.datetime] = None, + accessed_time_stamp: Optional[datetime.datetime] = None, + modified_time_stamp: Optional[datetime.datetime] = None, + changed_time_stamp: Optional[datetime.datetime] = None, + provisioning_state: Optional[str] = None, + **kwargs + ): + """ + :keyword path: Path to the subvolume. + :paramtype path: str + :keyword parent_path: Path to the parent subvolume. + :paramtype parent_path: str + :keyword size: Size of subvolume. + :paramtype size: long + :keyword bytes_used: Bytes used. + :paramtype bytes_used: long + :keyword permissions: Permissions of the subvolume. + :paramtype permissions: str + :keyword creation_time_stamp: Creation time and date. + :paramtype creation_time_stamp: ~datetime.datetime + :keyword accessed_time_stamp: Most recent access time and date. + :paramtype accessed_time_stamp: ~datetime.datetime + :keyword modified_time_stamp: Most recent modification time and date. + :paramtype modified_time_stamp: ~datetime.datetime + :keyword changed_time_stamp: Most recent change time and date. + :paramtype changed_time_stamp: ~datetime.datetime + :keyword provisioning_state: Azure lifecycle management. + :paramtype provisioning_state: str + """ + super(SubvolumeModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.path = path + self.parent_path = parent_path + self.size = size + self.bytes_used = bytes_used + self.permissions = permissions + self.creation_time_stamp = creation_time_stamp + self.accessed_time_stamp = accessed_time_stamp + self.modified_time_stamp = modified_time_stamp + self.changed_time_stamp = changed_time_stamp + self.provisioning_state = provisioning_state + + +class SubvolumePatchRequest(msrest.serialization.Model): + """Subvolume Patch Request properties. + + :ivar size: Truncate subvolume to the provided size in bytes. + :vartype size: long + :ivar path: path to the subvolume. + :vartype path: str + """ + + _attribute_map = { + 'size': {'key': 'properties.size', 'type': 'long'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + } + + def __init__( + self, + *, + size: Optional[int] = None, + path: Optional[str] = None, + **kwargs + ): + """ + :keyword size: Truncate subvolume to the provided size in bytes. + :paramtype size: long + :keyword path: path to the subvolume. + :paramtype path: str + """ + super(SubvolumePatchRequest, self).__init__(**kwargs) + self.size = size + self.path = path + + +class SubvolumesList(msrest.serialization.Model): + """List of Subvolumes. + + :ivar value: A list of Subvolumes. + :vartype value: list[~azure.mgmt.netapp.models.SubvolumeInfo] + :ivar next_link: URL to get the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SubvolumeInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["SubvolumeInfo"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: A list of Subvolumes. + :paramtype value: list[~azure.mgmt.netapp.models.SubvolumeInfo] + :keyword next_link: URL to get the next set of results. + :paramtype next_link: str + """ + super(SubvolumesList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. @@ -3326,6 +3672,8 @@ class Volume(msrest.serialization.Model): :vartype type: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.netapp.models.SystemData :ivar file_system_id: Unique FileSystem Identifier. :vartype file_system_id: str :ivar creation_token: Required. A unique file path for the volume. Used when creating mount @@ -3423,6 +3771,9 @@ class Volume(msrest.serialization.Model): :ivar default_group_quota_in_ki_bs: Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. :vartype default_group_quota_in_ki_bs: long + :ivar maximum_number_of_files: Maximum number of files allowed. Needs a service request in + order to be changed. Only allowed to be changed if volume quota is more than 4TiB. + :vartype maximum_number_of_files: long :ivar volume_group_name: Volume Group Name. :vartype volume_group_name: str :ivar capacity_pool_resource_id: Pool Resource Id used in case of creating a volume through @@ -3437,6 +3788,9 @@ class Volume(msrest.serialization.Model): :vartype volume_spec_name: str :ivar placement_rules: Application specific placement rules for the particular volume. :vartype placement_rules: list[~azure.mgmt.netapp.models.PlacementKeyValuePairs] + :ivar enable_subvolumes: Flag indicating whether subvolume operations are enabled on the + volume. Possible values include: "Enabled", "Disabled". Default value: "Disabled". + :vartype enable_subvolumes: str or ~azure.mgmt.netapp.models.EnableSubvolumes """ _validation = { @@ -3445,6 +3799,7 @@ class Volume(msrest.serialization.Model): 'name': {'readonly': True}, 'etag': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'file_system_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_token': {'required': True, 'max_length': 80, 'min_length': 1, 'pattern': r'^[a-zA-Z][a-zA-Z0-9\-]{0,79}$'}, 'usage_threshold': {'required': True, 'maximum': 109951162777600, 'minimum': 107374182400}, @@ -3459,6 +3814,7 @@ class Volume(msrest.serialization.Model): 'coolness_period': {'maximum': 63, 'minimum': 7}, 'unix_permissions': {'max_length': 4, 'min_length': 4}, 'clone_progress': {'readonly': True}, + 'maximum_number_of_files': {'readonly': True}, 'volume_group_name': {'readonly': True}, 't2_network': {'readonly': True}, } @@ -3470,6 +3826,7 @@ class Volume(msrest.serialization.Model): 'etag': {'key': 'etag', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, 'creation_token': {'key': 'properties.creationToken', 'type': 'str'}, 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, @@ -3504,12 +3861,14 @@ class Volume(msrest.serialization.Model): 'is_default_quota_enabled': {'key': 'properties.isDefaultQuotaEnabled', 'type': 'bool'}, 'default_user_quota_in_ki_bs': {'key': 'properties.defaultUserQuotaInKiBs', 'type': 'long'}, 'default_group_quota_in_ki_bs': {'key': 'properties.defaultGroupQuotaInKiBs', 'type': 'long'}, + 'maximum_number_of_files': {'key': 'properties.maximumNumberOfFiles', 'type': 'long'}, 'volume_group_name': {'key': 'properties.volumeGroupName', 'type': 'str'}, 'capacity_pool_resource_id': {'key': 'properties.capacityPoolResourceId', 'type': 'str'}, 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'str'}, 't2_network': {'key': 'properties.t2Network', 'type': 'str'}, 'volume_spec_name': {'key': 'properties.volumeSpecName', 'type': 'str'}, 'placement_rules': {'key': 'properties.placementRules', 'type': '[PlacementKeyValuePairs]'}, + 'enable_subvolumes': {'key': 'properties.enableSubvolumes', 'type': 'str'}, } def __init__( @@ -3548,6 +3907,7 @@ def __init__( proximity_placement_group: Optional[str] = None, volume_spec_name: Optional[str] = None, placement_rules: Optional[List["PlacementKeyValuePairs"]] = None, + enable_subvolumes: Optional[Union[str, "EnableSubvolumes"]] = "Disabled", **kwargs ): """ @@ -3643,6 +4003,9 @@ def __init__( :paramtype volume_spec_name: str :keyword placement_rules: Application specific placement rules for the particular volume. :paramtype placement_rules: list[~azure.mgmt.netapp.models.PlacementKeyValuePairs] + :keyword enable_subvolumes: Flag indicating whether subvolume operations are enabled on the + volume. Possible values include: "Enabled", "Disabled". Default value: "Disabled". + :paramtype enable_subvolumes: str or ~azure.mgmt.netapp.models.EnableSubvolumes """ super(Volume, self).__init__(**kwargs) self.location = location @@ -3651,6 +4014,7 @@ def __init__( self.etag = None self.type = None self.tags = tags + self.system_data = None self.file_system_id = None self.creation_token = creation_token self.service_level = service_level @@ -3685,12 +4049,14 @@ def __init__( self.is_default_quota_enabled = is_default_quota_enabled self.default_user_quota_in_ki_bs = default_user_quota_in_ki_bs self.default_group_quota_in_ki_bs = default_group_quota_in_ki_bs + self.maximum_number_of_files = None self.volume_group_name = None self.capacity_pool_resource_id = capacity_pool_resource_id self.proximity_placement_group = proximity_placement_group self.t2_network = None self.volume_spec_name = volume_spec_name self.placement_rules = placement_rules + self.enable_subvolumes = enable_subvolumes class VolumeBackupProperties(msrest.serialization.Model): @@ -4115,6 +4481,9 @@ class VolumeGroupVolumeProperties(msrest.serialization.Model): :ivar default_group_quota_in_ki_bs: Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. :vartype default_group_quota_in_ki_bs: long + :ivar maximum_number_of_files: Maximum number of files allowed. Needs a service request in + order to be changed. Only allowed to be changed if volume quota is more than 4TiB. + :vartype maximum_number_of_files: long :ivar volume_group_name: Volume Group Name. :vartype volume_group_name: str :ivar capacity_pool_resource_id: Pool Resource Id used in case of creating a volume through @@ -4129,6 +4498,9 @@ class VolumeGroupVolumeProperties(msrest.serialization.Model): :vartype volume_spec_name: str :ivar placement_rules: Application specific placement rules for the particular volume. :vartype placement_rules: list[~azure.mgmt.netapp.models.PlacementKeyValuePairs] + :ivar enable_subvolumes: Flag indicating whether subvolume operations are enabled on the + volume. Possible values include: "Enabled", "Disabled". Default value: "Disabled". + :vartype enable_subvolumes: str or ~azure.mgmt.netapp.models.EnableSubvolumes """ _validation = { @@ -4148,6 +4520,7 @@ class VolumeGroupVolumeProperties(msrest.serialization.Model): 'coolness_period': {'maximum': 63, 'minimum': 7}, 'unix_permissions': {'max_length': 4, 'min_length': 4}, 'clone_progress': {'readonly': True}, + 'maximum_number_of_files': {'readonly': True}, 'volume_group_name': {'readonly': True}, 't2_network': {'readonly': True}, } @@ -4191,12 +4564,14 @@ class VolumeGroupVolumeProperties(msrest.serialization.Model): 'is_default_quota_enabled': {'key': 'properties.isDefaultQuotaEnabled', 'type': 'bool'}, 'default_user_quota_in_ki_bs': {'key': 'properties.defaultUserQuotaInKiBs', 'type': 'long'}, 'default_group_quota_in_ki_bs': {'key': 'properties.defaultGroupQuotaInKiBs', 'type': 'long'}, + 'maximum_number_of_files': {'key': 'properties.maximumNumberOfFiles', 'type': 'long'}, 'volume_group_name': {'key': 'properties.volumeGroupName', 'type': 'str'}, 'capacity_pool_resource_id': {'key': 'properties.capacityPoolResourceId', 'type': 'str'}, 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'str'}, 't2_network': {'key': 'properties.t2Network', 'type': 'str'}, 'volume_spec_name': {'key': 'properties.volumeSpecName', 'type': 'str'}, 'placement_rules': {'key': 'properties.placementRules', 'type': '[PlacementKeyValuePairs]'}, + 'enable_subvolumes': {'key': 'properties.enableSubvolumes', 'type': 'str'}, } def __init__( @@ -4235,6 +4610,7 @@ def __init__( proximity_placement_group: Optional[str] = None, volume_spec_name: Optional[str] = None, placement_rules: Optional[List["PlacementKeyValuePairs"]] = None, + enable_subvolumes: Optional[Union[str, "EnableSubvolumes"]] = "Disabled", **kwargs ): """ @@ -4330,6 +4706,9 @@ def __init__( :paramtype volume_spec_name: str :keyword placement_rules: Application specific placement rules for the particular volume. :paramtype placement_rules: list[~azure.mgmt.netapp.models.PlacementKeyValuePairs] + :keyword enable_subvolumes: Flag indicating whether subvolume operations are enabled on the + volume. Possible values include: "Enabled", "Disabled". Default value: "Disabled". + :paramtype enable_subvolumes: str or ~azure.mgmt.netapp.models.EnableSubvolumes """ super(VolumeGroupVolumeProperties, self).__init__(**kwargs) self.id = None @@ -4370,12 +4749,14 @@ def __init__( self.is_default_quota_enabled = is_default_quota_enabled self.default_user_quota_in_ki_bs = default_user_quota_in_ki_bs self.default_group_quota_in_ki_bs = default_group_quota_in_ki_bs + self.maximum_number_of_files = None self.volume_group_name = None self.capacity_pool_resource_id = capacity_pool_resource_id self.proximity_placement_group = proximity_placement_group self.t2_network = None self.volume_spec_name = volume_spec_name self.placement_rules = placement_rules + self.enable_subvolumes = enable_subvolumes class VolumeList(msrest.serialization.Model): @@ -4448,6 +4829,13 @@ class VolumePatch(msrest.serialization.Model): :ivar default_group_quota_in_ki_bs: Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. :vartype default_group_quota_in_ki_bs: long + :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 + selects permissions for other users in the same group. the fourth for other users not in the + group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other + users. + :vartype unix_permissions: str """ _validation = { @@ -4455,6 +4843,7 @@ class VolumePatch(msrest.serialization.Model): 'name': {'readonly': True}, 'type': {'readonly': True}, 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, + 'unix_permissions': {'max_length': 4, 'min_length': 4}, } _attribute_map = { @@ -4471,6 +4860,7 @@ class VolumePatch(msrest.serialization.Model): 'is_default_quota_enabled': {'key': 'properties.isDefaultQuotaEnabled', 'type': 'bool'}, 'default_user_quota_in_ki_bs': {'key': 'properties.defaultUserQuotaInKiBs', 'type': 'long'}, 'default_group_quota_in_ki_bs': {'key': 'properties.defaultGroupQuotaInKiBs', 'type': 'long'}, + 'unix_permissions': {'key': 'properties.unixPermissions', 'type': 'str'}, } def __init__( @@ -4486,6 +4876,7 @@ def __init__( is_default_quota_enabled: Optional[bool] = False, default_user_quota_in_ki_bs: Optional[int] = 0, default_group_quota_in_ki_bs: Optional[int] = 0, + unix_permissions: Optional[str] = None, **kwargs ): """ @@ -4516,6 +4907,13 @@ def __init__( :keyword default_group_quota_in_ki_bs: Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. :paramtype default_group_quota_in_ki_bs: long + :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 + selects permissions for other users in the same group. the fourth for other users not in the + group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other + users. + :paramtype unix_permissions: str """ super(VolumePatch, self).__init__(**kwargs) self.location = location @@ -4531,6 +4929,7 @@ def __init__( self.is_default_quota_enabled = is_default_quota_enabled self.default_user_quota_in_ki_bs = default_user_quota_in_ki_bs self.default_group_quota_in_ki_bs = default_group_quota_in_ki_bs + self.unix_permissions = unix_permissions class VolumePatchPropertiesDataProtection(msrest.serialization.Model): 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 39a9c6b8d79ea..b9157e8f8b5c7 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 @@ -86,6 +86,15 @@ class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" +class EnableSubvolumes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Flag indicating whether subvolume operations are enabled on the volume + """ + + #: subvolumes are enabled. + ENABLED = "Enabled" + #: subvolumes are not enabled. + DISABLED = "Disabled" + class EncryptionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Encryption type of the capacity pool, set encryption type for data at rest for this pool and all volumes in it. This value can only be set when creating new pool. 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 ce5a3a9ff24fa..8e72a6f608831 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 @@ -19,6 +19,7 @@ from ._backup_policies_operations import BackupPoliciesOperations from ._vaults_operations import VaultsOperations from ._volume_groups_operations import VolumeGroupsOperations +from ._subvolumes_operations import SubvolumesOperations __all__ = [ 'Operations', @@ -34,4 +35,5 @@ 'BackupPoliciesOperations', 'VaultsOperations', 'VolumeGroupsOperations', + 'SubvolumesOperations', ] 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 index 00d659b3165c3..4fe908c4bcc46 100644 --- 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 @@ -34,7 +34,7 @@ def build_list_request( account_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups') @@ -70,7 +70,7 @@ def build_get_request( backup_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}') @@ -107,7 +107,7 @@ def build_delete_request_initial( backup_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}') path_format_arguments = { 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 6c77f6586cd81..a5ca791e6b28a 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 @@ -33,7 +33,7 @@ def build_list_by_subscription_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/netAppAccounts') @@ -65,7 +65,7 @@ def build_list_request( resource_group_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts') @@ -99,7 +99,7 @@ def build_get_request( account_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}') @@ -139,7 +139,7 @@ def build_create_or_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}') @@ -178,7 +178,7 @@ def build_delete_request_initial( account_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}') path_format_arguments = { @@ -212,7 +212,7 @@ def build_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}') 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 0d9dc057aabbf..39c1177967116 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 @@ -35,7 +35,7 @@ def build_list_request( account_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies') @@ -71,7 +71,7 @@ def build_get_request( backup_policy_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}') @@ -113,7 +113,7 @@ def build_create_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}') @@ -159,7 +159,7 @@ def build_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}') @@ -200,7 +200,7 @@ def build_delete_request_initial( backup_policy_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}') path_format_arguments = { 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 ab4d0ae8d23de..cc4fff8a03872 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 @@ -37,7 +37,7 @@ def build_get_status_request( volume_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus') @@ -76,7 +76,7 @@ def build_get_volume_restore_status_request( volume_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/restoreStatus') @@ -115,7 +115,7 @@ def build_list_request( volume_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups') @@ -155,7 +155,7 @@ def build_get_request( backup_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" 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}') @@ -201,7 +201,7 @@ def build_create_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" 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}') @@ -251,7 +251,7 @@ def build_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" 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}') @@ -296,7 +296,7 @@ def build_delete_request_initial( backup_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}') path_format_arguments = { 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 3de821364f825..049560270363e 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 @@ -36,7 +36,7 @@ def build_check_name_availability_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability') @@ -78,7 +78,7 @@ def build_check_file_path_availability_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability') @@ -120,7 +120,7 @@ def build_check_quota_availability_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkQuotaAvailability') 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 717ed20e015a3..bf5532359663b 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 @@ -31,7 +31,7 @@ def build_list_request( location: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits') @@ -65,7 +65,7 @@ def build_get_request( quota_limit_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits/{quotaLimitName}') 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 612920a32ece6..4c59e8b85b90b 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 @@ -29,7 +29,7 @@ def build_list_request( **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/providers/Microsoft.NetApp/operations') 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 952ee443895d1..690af793bb29c 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 @@ -35,7 +35,7 @@ def build_list_request( account_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools') @@ -71,7 +71,7 @@ def build_get_request( pool_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}') @@ -113,7 +113,7 @@ def build_create_or_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}') @@ -159,7 +159,7 @@ def build_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}') @@ -200,7 +200,7 @@ def build_delete_request_initial( pool_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}') path_format_arguments = { 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 43190ed450e29..637d9af22673e 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 @@ -35,7 +35,7 @@ def build_list_request( account_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies') @@ -71,7 +71,7 @@ def build_get_request( snapshot_policy_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}') @@ -113,7 +113,7 @@ def build_create_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}') @@ -159,7 +159,7 @@ def build_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}') @@ -200,7 +200,7 @@ def build_delete_request_initial( snapshot_policy_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}') path_format_arguments = { @@ -231,7 +231,7 @@ def build_list_volumes_request( snapshot_policy_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}/volumes') 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 7cf00d0cb224a..eb42d413b7eaf 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 @@ -37,7 +37,7 @@ def build_list_request( volume_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots') @@ -77,7 +77,7 @@ def build_get_request( snapshot_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}') @@ -123,7 +123,7 @@ def build_create_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}') @@ -173,7 +173,7 @@ def build_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}') @@ -218,7 +218,7 @@ def build_delete_request_initial( snapshot_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}') path_format_arguments = { @@ -243,6 +243,54 @@ def build_delete_request_initial( **kwargs ) + +def build_restore_files_request_initial( + subscription_id: str, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}/restoreFiles') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "accountName": _SERIALIZER.url("account_name", account_name, 'str'), + "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}$'), + "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + class SnapshotsOperations(object): """SnapshotsOperations operations. @@ -804,3 +852,131 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} # type: ignore + + def _restore_files_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: "_models.SnapshotRestoreFiles", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(body, 'SnapshotRestoreFiles') + + request = build_restore_files_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, + content_type=content_type, + json=_json, + template_url=self._restore_files_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_files_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}/restoreFiles'} # type: ignore + + + @distributed_trace + def begin_restore_files( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + snapshot_name: str, + body: "_models.SnapshotRestoreFiles", + **kwargs: Any + ) -> LROPoller[None]: + """Create a new Snapshot Restore Files request. + + Restore the specified files from the specified snapshot to the active filesystem. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :type volume_name: str + :param snapshot_name: The name of the snapshot. + :type snapshot_name: str + :param body: Restore payload supplied in the body of the operation. + :type body: ~azure.mgmt.netapp.models.SnapshotRestoreFiles + :keyword callable cls: A custom type or function 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 + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_files_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, + body=body, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_restore_files.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}/restoreFiles'} # type: ignore 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 new file mode 100644 index 0000000000000..adc4f3cbfdbe8 --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_subvolumes_operations.py @@ -0,0 +1,978 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import 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.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_volume_request( + subscription_id: str, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "accountName": _SERIALIZER.url("account_name", account_name, 'str'), + "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 = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "accountName": _SERIALIZER.url("account_name", account_name, 'str'), + "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}$'), + "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + subscription_id: str, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "accountName": _SERIALIZER.url("account_name", account_name, 'str'), + "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}$'), + "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "accountName": _SERIALIZER.url("account_name", account_name, 'str'), + "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}$'), + "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "accountName": _SERIALIZER.url("account_name", account_name, 'str'), + "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}$'), + "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_get_metadata_request_initial( + subscription_id: str, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}/getMetadata') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "accountName": _SERIALIZER.url("account_name", account_name, 'str'), + "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}$'), + "subvolumeName": _SERIALIZER.url("subvolume_name", subvolume_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class SubvolumesOperations(object): + """SubvolumesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.netapp.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_volume( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + **kwargs: Any + ) -> Iterable["_models.SubvolumesList"]: + """List of all the subvolumes. + + Returns a list of the subvolumes in the volume. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :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 SubvolumesList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.SubvolumesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_volume_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + template_url=self.list_by_volume.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_volume_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + template_url=next_link, + ) + 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("SubvolumesList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_volume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes'} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any + ) -> "_models.SubvolumeInfo": + """Get the path associated with the subvolumeName. + + Returns the path associated with the subvolumeName provided. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :type volume_name: str + :param subvolume_name: The name of the subvolume. + :type subvolume_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SubvolumeInfo, or the result of cls(response) + :rtype: ~azure.mgmt.netapp.models.SubvolumeInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SubvolumeInfo', 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}/subvolumes/{subvolumeName}'} # type: ignore + + + def _create_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: "_models.SubvolumeInfo", + **kwargs: Any + ) -> Optional["_models.SubvolumeInfo"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SubvolumeInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(body, 'SubvolumeInfo') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SubvolumeInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SubvolumeInfo', 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}/subvolumes/{subvolumeName}'} # type: ignore + + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: "_models.SubvolumeInfo", + **kwargs: Any + ) -> LROPoller["_models.SubvolumeInfo"]: + """Create or clone a new subvolume. + + Creates a subvolume in the path or clones the subvolume mentioned in the parentPath. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :type volume_name: str + :param subvolume_name: The name of the subvolume. + :type subvolume_name: str + :param body: Subvolume object supplied in the body of the operation. + :type body: ~azure.mgmt.netapp.models.SubvolumeInfo + :keyword callable cls: A custom type or function 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 SubvolumeInfo or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SubvolumeInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + body=body, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('SubvolumeInfo', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}'} # type: ignore + + def _update_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: "_models.SubvolumePatchRequest", + **kwargs: Any + ) -> Optional["_models.SubvolumeInfo"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SubvolumeInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(body, 'SubvolumePatchRequest') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SubvolumeInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}'} # type: ignore + + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + body: "_models.SubvolumePatchRequest", + **kwargs: Any + ) -> LROPoller["_models.SubvolumeInfo"]: + """Update a subvolume. + + Patch a subvolume. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :type volume_name: str + :param subvolume_name: The name of the subvolume. + :type subvolume_name: str + :param body: Subvolume object supplied in the body of the operation. + :type body: ~azure.mgmt.netapp.models.SubvolumePatchRequest + :keyword callable cls: A custom type or function 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 SubvolumeInfo or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SubvolumeInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + body=body, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('SubvolumeInfo', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Delete a subvolume. + + Delete subvolume. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :type volume_name: str + :param subvolume_name: The name of the subvolume. + :type subvolume_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}'} # type: ignore + + def _get_metadata_initial( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any + ) -> Optional["_models.SubvolumeModel"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SubvolumeModel"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_metadata_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + template_url=self._get_metadata_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SubvolumeModel', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _get_metadata_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}/getMetadata'} # type: ignore + + + @distributed_trace + def begin_get_metadata( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + subvolume_name: str, + **kwargs: Any + ) -> LROPoller["_models.SubvolumeModel"]: + """Describe a subvolume. + + Get details of the specified subvolume. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account. + :type account_name: str + :param pool_name: The name of the capacity pool. + :type pool_name: str + :param volume_name: The name of the volume. + :type volume_name: str + :param subvolume_name: The name of the subvolume. + :type subvolume_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 SubvolumeModel or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SubvolumeModel] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeModel"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_metadata_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + subvolume_name=subvolume_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('SubvolumeModel', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_get_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}/getMetadata'} # type: ignore diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_vaults_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_vaults_operations.py index d115f03f9c0fe..8777ddbe3c018 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_vaults_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_vaults_operations.py @@ -32,7 +32,7 @@ def build_list_request( account_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/vaults') 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 49322362e99c4..cdcf3fc175a92 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 @@ -35,7 +35,7 @@ def build_list_by_net_app_account_request( account_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups') @@ -71,7 +71,7 @@ def build_get_request( volume_group_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}') @@ -113,7 +113,7 @@ def build_create_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}') @@ -154,7 +154,7 @@ def build_delete_request_initial( volume_group_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}') path_format_arguments = { 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 67d0c0b13d5df..41122116f5da7 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 @@ -36,7 +36,7 @@ def build_list_request( pool_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes') @@ -74,7 +74,7 @@ def build_get_request( volume_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}') @@ -118,7 +118,7 @@ def build_create_or_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}') @@ -166,7 +166,7 @@ def build_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}') @@ -207,9 +207,11 @@ def build_delete_request_initial( account_name: str, pool_name: str, volume_name: str, + *, + force_delete: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}') path_format_arguments = { @@ -224,6 +226,8 @@ def build_delete_request_initial( # Construct parameters query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if force_delete is not None: + query_parameters['forceDelete'] = _SERIALIZER.query("force_delete", force_delete, 'bool') query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') return HttpRequest( @@ -247,7 +251,7 @@ def build_revert_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert') path_format_arguments = { @@ -293,7 +297,7 @@ def build_break_replication_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication') path_format_arguments = { @@ -334,7 +338,7 @@ def build_replication_status_request( volume_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus') @@ -373,7 +377,7 @@ def build_resync_replication_request_initial( volume_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication') path_format_arguments = { @@ -406,7 +410,7 @@ def build_delete_replication_request_initial( volume_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication') path_format_arguments = { @@ -444,7 +448,7 @@ def build_authorize_replication_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication') path_format_arguments = { @@ -485,7 +489,7 @@ def build_re_initialize_replication_request_initial( volume_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication') path_format_arguments = { @@ -523,7 +527,7 @@ def build_pool_change_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" + api_version = "2021-10-01" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange') path_format_arguments = { @@ -989,6 +993,7 @@ def _delete_initial( account_name: str, pool_name: str, volume_name: str, + force_delete: Optional[bool] = None, **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1004,6 +1009,7 @@ def _delete_initial( account_name=account_name, pool_name=pool_name, volume_name=volume_name, + force_delete=force_delete, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) @@ -1029,6 +1035,7 @@ def begin_delete( account_name: str, pool_name: str, volume_name: str, + force_delete: Optional[bool] = None, **kwargs: Any ) -> LROPoller[None]: """Delete a volume. @@ -1043,6 +1050,9 @@ def begin_delete( :type pool_name: str :param volume_name: The name of the volume. :type volume_name: str + :param force_delete: An option to force delete the volume. Will cleanup resources connected to + the particular volume. + :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1068,6 +1078,7 @@ def begin_delete( account_name=account_name, pool_name=pool_name, volume_name=volume_name, + force_delete=force_delete, cls=lambda x,y,z: x, **kwargs )