Skip to content

Commit 534271d

Browse files
author
SDKAuto
committed
CodeGen from PR 18201 in Azure/azure-rest-api-specs
Merge 78c740349acb28572fe43faa51c716e38d19aff4 into 96da969aa75e2beb27c3dbc2d69a76900856cc52
1 parent 573d68e commit 534271d

29 files changed

+2531
-78
lines changed

sdk/netapp/azure-mgmt-netapp/_meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"@autorest/[email protected]",
55
"@autorest/[email protected]"
66
],
7-
"commit": "4822ca2526928075b1278df6788ea88d6f6586fe",
7+
"commit": "86fc7ac77ad48e14f33b34888d3f65967d7c68d4",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
99
"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/[email protected] --use=@autorest/[email protected] --version=3.7.2",
1010
"readme": "specification/netapp/resource-manager/readme.md"

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
48-
self.api_version = "2021-08-01"
48+
self.api_version = "2021-10-01"
4949
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5050
kwargs.setdefault('sdk_moniker', 'mgmt-netapp/{}'.format(VERSION))
5151
self._configure(**kwargs)

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_metadata.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"chosen_version": "2021-08-01",
3-
"total_api_version_list": ["2021-08-01"],
2+
"chosen_version": "2021-10-01",
3+
"total_api_version_list": ["2021-10-01"],
44
"client": {
55
"name": "NetAppManagementClient",
66
"filename": "_net_app_management_client",
@@ -109,6 +109,7 @@
109109
"account_backups": "AccountBackupsOperations",
110110
"backup_policies": "BackupPoliciesOperations",
111111
"vaults": "VaultsOperations",
112-
"volume_groups": "VolumeGroupsOperations"
112+
"volume_groups": "VolumeGroupsOperations",
113+
"subvolumes": "SubvolumesOperations"
113114
}
114115
}

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_net_app_management_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from . import models
1717
from ._configuration import NetAppManagementClientConfiguration
18-
from .operations import AccountBackupsOperations, AccountsOperations, BackupPoliciesOperations, BackupsOperations, NetAppResourceOperations, NetAppResourceQuotaLimitsOperations, Operations, PoolsOperations, SnapshotPoliciesOperations, SnapshotsOperations, VaultsOperations, VolumeGroupsOperations, VolumesOperations
18+
from .operations import AccountBackupsOperations, AccountsOperations, BackupPoliciesOperations, BackupsOperations, NetAppResourceOperations, NetAppResourceQuotaLimitsOperations, Operations, PoolsOperations, SnapshotPoliciesOperations, SnapshotsOperations, SubvolumesOperations, VaultsOperations, VolumeGroupsOperations, VolumesOperations
1919

2020
if TYPE_CHECKING:
2121
# pylint: disable=unused-import,ungrouped-imports
@@ -51,6 +51,8 @@ class NetAppManagementClient:
5151
:vartype vaults: azure.mgmt.netapp.operations.VaultsOperations
5252
:ivar volume_groups: VolumeGroupsOperations operations
5353
:vartype volume_groups: azure.mgmt.netapp.operations.VolumeGroupsOperations
54+
:ivar subvolumes: SubvolumesOperations operations
55+
:vartype subvolumes: azure.mgmt.netapp.operations.SubvolumesOperations
5456
:param credential: Credential needed for the client to connect to Azure.
5557
:type credential: ~azure.core.credentials.TokenCredential
5658
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
@@ -89,6 +91,7 @@ def __init__(
8991
self.backup_policies = BackupPoliciesOperations(self._client, self._config, self._serialize, self._deserialize)
9092
self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize)
9193
self.volume_groups = VolumeGroupsOperations(self._client, self._config, self._serialize, self._deserialize)
94+
self.subvolumes = SubvolumesOperations(self._client, self._config, self._serialize, self._deserialize)
9295

9396

9497
def _send_request(

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "6.0.1"
9+
VERSION = "5.1.0"

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
48-
self.api_version = "2021-08-01"
48+
self.api_version = "2021-10-01"
4949
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5050
kwargs.setdefault('sdk_moniker', 'mgmt-netapp/{}'.format(VERSION))
5151
self._configure(**kwargs)

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_net_app_management_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from .. import models
1717
from ._configuration import NetAppManagementClientConfiguration
18-
from .operations import AccountBackupsOperations, AccountsOperations, BackupPoliciesOperations, BackupsOperations, NetAppResourceOperations, NetAppResourceQuotaLimitsOperations, Operations, PoolsOperations, SnapshotPoliciesOperations, SnapshotsOperations, VaultsOperations, VolumeGroupsOperations, VolumesOperations
18+
from .operations import AccountBackupsOperations, AccountsOperations, BackupPoliciesOperations, BackupsOperations, NetAppResourceOperations, NetAppResourceQuotaLimitsOperations, Operations, PoolsOperations, SnapshotPoliciesOperations, SnapshotsOperations, SubvolumesOperations, VaultsOperations, VolumeGroupsOperations, VolumesOperations
1919

2020
if TYPE_CHECKING:
2121
# pylint: disable=unused-import,ungrouped-imports
@@ -51,6 +51,8 @@ class NetAppManagementClient:
5151
:vartype vaults: azure.mgmt.netapp.aio.operations.VaultsOperations
5252
:ivar volume_groups: VolumeGroupsOperations operations
5353
:vartype volume_groups: azure.mgmt.netapp.aio.operations.VolumeGroupsOperations
54+
:ivar subvolumes: SubvolumesOperations operations
55+
:vartype subvolumes: azure.mgmt.netapp.aio.operations.SubvolumesOperations
5456
:param credential: Credential needed for the client to connect to Azure.
5557
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
5658
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
@@ -89,6 +91,7 @@ def __init__(
8991
self.backup_policies = BackupPoliciesOperations(self._client, self._config, self._serialize, self._deserialize)
9092
self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize)
9193
self.volume_groups = VolumeGroupsOperations(self._client, self._config, self._serialize, self._deserialize)
94+
self.subvolumes = SubvolumesOperations(self._client, self._config, self._serialize, self._deserialize)
9295

9396

9497
def _send_request(

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from ._backup_policies_operations import BackupPoliciesOperations
2020
from ._vaults_operations import VaultsOperations
2121
from ._volume_groups_operations import VolumeGroupsOperations
22+
from ._subvolumes_operations import SubvolumesOperations
2223

2324
__all__ = [
2425
'Operations',
@@ -34,4 +35,5 @@
3435
'BackupPoliciesOperations',
3536
'VaultsOperations',
3637
'VolumeGroupsOperations',
38+
'SubvolumesOperations',
3739
]

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshots_operations.py

Lines changed: 129 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from ... import models as _models
2424
from ..._vendor import _convert_request
25-
from ...operations._snapshots_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial
25+
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
2626
T = TypeVar('T')
2727
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
2828

@@ -589,3 +589,131 @@ def get_long_running_output(pipeline_response):
589589
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
590590

591591
begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} # type: ignore
592+
593+
async def _restore_files_initial(
594+
self,
595+
resource_group_name: str,
596+
account_name: str,
597+
pool_name: str,
598+
volume_name: str,
599+
snapshot_name: str,
600+
body: "_models.SnapshotRestoreFiles",
601+
**kwargs: Any
602+
) -> None:
603+
cls = kwargs.pop('cls', None) # type: ClsType[None]
604+
error_map = {
605+
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
606+
}
607+
error_map.update(kwargs.pop('error_map', {}))
608+
609+
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
610+
611+
_json = self._serialize.body(body, 'SnapshotRestoreFiles')
612+
613+
request = build_restore_files_request_initial(
614+
subscription_id=self._config.subscription_id,
615+
resource_group_name=resource_group_name,
616+
account_name=account_name,
617+
pool_name=pool_name,
618+
volume_name=volume_name,
619+
snapshot_name=snapshot_name,
620+
content_type=content_type,
621+
json=_json,
622+
template_url=self._restore_files_initial.metadata['url'],
623+
)
624+
request = _convert_request(request)
625+
request.url = self._client.format_url(request.url)
626+
627+
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
628+
response = pipeline_response.http_response
629+
630+
if response.status_code not in [200, 202]:
631+
map_error(status_code=response.status_code, response=response, error_map=error_map)
632+
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
633+
634+
if cls:
635+
return cls(pipeline_response, None, {})
636+
637+
_restore_files_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}/restoreFiles'} # type: ignore
638+
639+
640+
@distributed_trace_async
641+
async def begin_restore_files(
642+
self,
643+
resource_group_name: str,
644+
account_name: str,
645+
pool_name: str,
646+
volume_name: str,
647+
snapshot_name: str,
648+
body: "_models.SnapshotRestoreFiles",
649+
**kwargs: Any
650+
) -> AsyncLROPoller[None]:
651+
"""Create a new Snapshot Restore Files request.
652+
653+
Restore the specified files from the specified snapshot to the active filesystem.
654+
655+
:param resource_group_name: The name of the resource group.
656+
:type resource_group_name: str
657+
:param account_name: The name of the NetApp account.
658+
:type account_name: str
659+
:param pool_name: The name of the capacity pool.
660+
:type pool_name: str
661+
:param volume_name: The name of the volume.
662+
:type volume_name: str
663+
:param snapshot_name: The name of the snapshot.
664+
:type snapshot_name: str
665+
:param body: Restore payload supplied in the body of the operation.
666+
:type body: ~azure.mgmt.netapp.models.SnapshotRestoreFiles
667+
:keyword callable cls: A custom type or function that will be passed the direct response
668+
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
669+
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
670+
this operation to not poll, or pass in your own initialized polling object for a personal
671+
polling strategy.
672+
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
673+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
674+
Retry-After header is present.
675+
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
676+
:rtype: ~azure.core.polling.AsyncLROPoller[None]
677+
:raises: ~azure.core.exceptions.HttpResponseError
678+
"""
679+
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
680+
polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod]
681+
cls = kwargs.pop('cls', None) # type: ClsType[None]
682+
lro_delay = kwargs.pop(
683+
'polling_interval',
684+
self._config.polling_interval
685+
)
686+
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
687+
if cont_token is None:
688+
raw_result = await self._restore_files_initial(
689+
resource_group_name=resource_group_name,
690+
account_name=account_name,
691+
pool_name=pool_name,
692+
volume_name=volume_name,
693+
snapshot_name=snapshot_name,
694+
body=body,
695+
content_type=content_type,
696+
cls=lambda x,y,z: x,
697+
**kwargs
698+
)
699+
kwargs.pop('error_map', None)
700+
701+
def get_long_running_output(pipeline_response):
702+
if cls:
703+
return cls(pipeline_response, None, {})
704+
705+
706+
if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
707+
elif polling is False: polling_method = AsyncNoPolling()
708+
else: polling_method = polling
709+
if cont_token:
710+
return AsyncLROPoller.from_continuation_token(
711+
polling_method=polling_method,
712+
continuation_token=cont_token,
713+
client=self._client,
714+
deserialization_callback=get_long_running_output
715+
)
716+
else:
717+
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
718+
719+
begin_restore_files.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}/restoreFiles'} # type: ignore

0 commit comments

Comments
 (0)