Skip to content

Commit 8c8765b

Browse files
author
SDKAuto
committed
CodeGen from PR 13055 in Azure/azure-rest-api-specs
Merge 37b26cdcd5f6775c314b4720c21f1978c64a0289 into 9800a75
1 parent f7062ad commit 8c8765b

File tree

7 files changed

+200
-67
lines changed

7 files changed

+200
-67
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"client": {
55
"name": "NetAppManagementClient",
66
"filename": "_net_app_management_client",
7-
"description": "Microsoft NetApp Azure Resource Provider specification.",
7+
"description": "Microsoft NetApp Files Azure Resource Provider specification.",
88
"base_url": "\u0027https://management.azure.com\u0027",
99
"custom_base_url": null,
1010
"azure_arm": true,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434

3535
class NetAppManagementClient(object):
36-
"""Microsoft NetApp Azure Resource Provider specification.
36+
"""Microsoft NetApp Files Azure Resource Provider specification.
3737
3838
:ivar operations: Operations operations
3939
:vartype operations: azure.mgmt.netapp.operations.Operations

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232

3333
class NetAppManagementClient(object):
34-
"""Microsoft NetApp Azure Resource Provider specification.
34+
"""Microsoft NetApp Files Azure Resource Provider specification.
3535
3636
:ivar operations: Operations operations
3737
:vartype operations: azure.mgmt.netapp.aio.operations.Operations

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

Lines changed: 97 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def get_long_running_output(pipeline_response):
351351
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
352352
begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}'} # type: ignore
353353

354-
async def update(
354+
async def _update_initial(
355355
self,
356356
resource_group_name: str,
357357
account_name: str,
@@ -361,27 +361,6 @@ async def update(
361361
body: Optional["_models.BackupPatch"] = None,
362362
**kwargs
363363
) -> "_models.Backup":
364-
"""Patch a backup.
365-
366-
Patch a backup for the volume.
367-
368-
:param resource_group_name: The name of the resource group.
369-
:type resource_group_name: str
370-
:param account_name: The name of the NetApp account.
371-
:type account_name: str
372-
:param pool_name: The name of the capacity pool.
373-
:type pool_name: str
374-
:param volume_name: The name of the volume.
375-
:type volume_name: str
376-
:param backup_name: The name of the backup.
377-
:type backup_name: str
378-
:param body: Backup object supplied in the body of the operation.
379-
:type body: ~azure.mgmt.netapp.models.BackupPatch
380-
:keyword callable cls: A custom type or function that will be passed the direct response
381-
:return: Backup, or the result of cls(response)
382-
:rtype: ~azure.mgmt.netapp.models.Backup
383-
:raises: ~azure.core.exceptions.HttpResponseError
384-
"""
385364
cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"]
386365
error_map = {
387366
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
@@ -392,7 +371,7 @@ async def update(
392371
accept = "application/json"
393372

394373
# Construct URL
395-
url = self.update.metadata['url'] # type: ignore
374+
url = self._update_initial.metadata['url'] # type: ignore
396375
path_format_arguments = {
397376
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
398377
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
@@ -422,17 +401,109 @@ async def update(
422401
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
423402
response = pipeline_response.http_response
424403

425-
if response.status_code not in [200]:
404+
if response.status_code not in [200, 202]:
426405
map_error(status_code=response.status_code, response=response, error_map=error_map)
427406
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
428407

429-
deserialized = self._deserialize('Backup', pipeline_response)
408+
if response.status_code == 200:
409+
deserialized = self._deserialize('Backup', pipeline_response)
410+
411+
if response.status_code == 202:
412+
deserialized = self._deserialize('Backup', pipeline_response)
430413

431414
if cls:
432415
return cls(pipeline_response, deserialized, {})
433416

434417
return deserialized
435-
update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}'} # type: ignore
418+
_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}'} # type: ignore
419+
420+
async def begin_update(
421+
self,
422+
resource_group_name: str,
423+
account_name: str,
424+
pool_name: str,
425+
volume_name: str,
426+
backup_name: str,
427+
body: Optional["_models.BackupPatch"] = None,
428+
**kwargs
429+
) -> AsyncLROPoller["_models.Backup"]:
430+
"""Patch a backup.
431+
432+
Patch a backup for the volume.
433+
434+
:param resource_group_name: The name of the resource group.
435+
:type resource_group_name: str
436+
:param account_name: The name of the NetApp account.
437+
:type account_name: str
438+
:param pool_name: The name of the capacity pool.
439+
:type pool_name: str
440+
:param volume_name: The name of the volume.
441+
:type volume_name: str
442+
:param backup_name: The name of the backup.
443+
:type backup_name: str
444+
:param body: Backup object supplied in the body of the operation.
445+
:type body: ~azure.mgmt.netapp.models.BackupPatch
446+
:keyword callable cls: A custom type or function that will be passed the direct response
447+
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
448+
:keyword polling: True for ARMPolling, False for no polling, or a
449+
polling object for personal polling strategy
450+
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
451+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
452+
:return: An instance of AsyncLROPoller that returns either Backup or the result of cls(response)
453+
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Backup]
454+
:raises ~azure.core.exceptions.HttpResponseError:
455+
"""
456+
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
457+
cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"]
458+
lro_delay = kwargs.pop(
459+
'polling_interval',
460+
self._config.polling_interval
461+
)
462+
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
463+
if cont_token is None:
464+
raw_result = await self._update_initial(
465+
resource_group_name=resource_group_name,
466+
account_name=account_name,
467+
pool_name=pool_name,
468+
volume_name=volume_name,
469+
backup_name=backup_name,
470+
body=body,
471+
cls=lambda x,y,z: x,
472+
**kwargs
473+
)
474+
475+
kwargs.pop('error_map', None)
476+
kwargs.pop('content_type', None)
477+
478+
def get_long_running_output(pipeline_response):
479+
deserialized = self._deserialize('Backup', pipeline_response)
480+
481+
if cls:
482+
return cls(pipeline_response, deserialized, {})
483+
return deserialized
484+
485+
path_format_arguments = {
486+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
487+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
488+
'accountName': self._serialize.url("account_name", account_name, 'str'),
489+
'poolName': self._serialize.url("pool_name", pool_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$'),
490+
'volumeName': self._serialize.url("volume_name", volume_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$'),
491+
'backupName': self._serialize.url("backup_name", backup_name, 'str'),
492+
}
493+
494+
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs)
495+
elif polling is False: polling_method = AsyncNoPolling()
496+
else: polling_method = polling
497+
if cont_token:
498+
return AsyncLROPoller.from_continuation_token(
499+
polling_method=polling_method,
500+
continuation_token=cont_token,
501+
client=self._client,
502+
deserialization_callback=get_long_running_output
503+
)
504+
else:
505+
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
506+
begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}'} # type: ignore
436507

437508
async def _delete_initial(
438509
self,

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,7 @@ class SystemData(msrest.serialization.Model):
19411941
:param last_modified_by_type: The type of identity that last modified the resource. Possible
19421942
values include: "User", "Application", "ManagedIdentity", "Key".
19431943
:type last_modified_by_type: str or ~azure.mgmt.netapp.models.CreatedByType
1944-
:param last_modified_at: The type of identity that last modified the resource.
1944+
:param last_modified_at: The timestamp of resource last modification (UTC).
19451945
:type last_modified_at: ~datetime.datetime
19461946
"""
19471947

@@ -2051,8 +2051,6 @@ class Volume(msrest.serialization.Model):
20512051
:type tags: dict[str, str]
20522052
:ivar file_system_id: Unique FileSystem Identifier.
20532053
:vartype file_system_id: str
2054-
:ivar name_properties_name: Resource name.
2055-
:vartype name_properties_name: str
20562054
:param creation_token: Required. A unique file path for the volume. Used when creating mount
20572055
targets.
20582056
:type creation_token: str
@@ -2114,7 +2112,6 @@ class Volume(msrest.serialization.Model):
21142112
'name': {'readonly': True},
21152113
'type': {'readonly': True},
21162114
'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}$'},
2117-
'name_properties_name': {'readonly': True},
21182115
'creation_token': {'required': True, 'max_length': 80, 'min_length': 1, 'pattern': r'^[a-zA-Z][a-zA-Z0-9\-]{0,79}$'},
21192116
'usage_threshold': {'required': True, 'maximum': 109951162777600, 'minimum': 107374182400},
21202117
'provisioning_state': {'readonly': True},
@@ -2133,7 +2130,6 @@ class Volume(msrest.serialization.Model):
21332130
'type': {'key': 'type', 'type': 'str'},
21342131
'tags': {'key': 'tags', 'type': '{str}'},
21352132
'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'},
2136-
'name_properties_name': {'key': 'properties.name', 'type': 'str'},
21372133
'creation_token': {'key': 'properties.creationToken', 'type': 'str'},
21382134
'service_level': {'key': 'properties.serviceLevel', 'type': 'str'},
21392135
'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'},
@@ -2168,7 +2164,6 @@ def __init__(
21682164
self.type = None
21692165
self.tags = kwargs.get('tags', None)
21702166
self.file_system_id = None
2171-
self.name_properties_name = None
21722167
self.creation_token = kwargs['creation_token']
21732168
self.service_level = kwargs.get('service_level', None)
21742169
self.usage_threshold = kwargs.get('usage_threshold', 107374182400)

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,7 +2162,7 @@ class SystemData(msrest.serialization.Model):
21622162
:param last_modified_by_type: The type of identity that last modified the resource. Possible
21632163
values include: "User", "Application", "ManagedIdentity", "Key".
21642164
:type last_modified_by_type: str or ~azure.mgmt.netapp.models.CreatedByType
2165-
:param last_modified_at: The type of identity that last modified the resource.
2165+
:param last_modified_at: The timestamp of resource last modification (UTC).
21662166
:type last_modified_at: ~datetime.datetime
21672167
"""
21682168

@@ -2284,8 +2284,6 @@ class Volume(msrest.serialization.Model):
22842284
:type tags: dict[str, str]
22852285
:ivar file_system_id: Unique FileSystem Identifier.
22862286
:vartype file_system_id: str
2287-
:ivar name_properties_name: Resource name.
2288-
:vartype name_properties_name: str
22892287
:param creation_token: Required. A unique file path for the volume. Used when creating mount
22902288
targets.
22912289
:type creation_token: str
@@ -2347,7 +2345,6 @@ class Volume(msrest.serialization.Model):
23472345
'name': {'readonly': True},
23482346
'type': {'readonly': True},
23492347
'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}$'},
2350-
'name_properties_name': {'readonly': True},
23512348
'creation_token': {'required': True, 'max_length': 80, 'min_length': 1, 'pattern': r'^[a-zA-Z][a-zA-Z0-9\-]{0,79}$'},
23522349
'usage_threshold': {'required': True, 'maximum': 109951162777600, 'minimum': 107374182400},
23532350
'provisioning_state': {'readonly': True},
@@ -2366,7 +2363,6 @@ class Volume(msrest.serialization.Model):
23662363
'type': {'key': 'type', 'type': 'str'},
23672364
'tags': {'key': 'tags', 'type': '{str}'},
23682365
'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'},
2369-
'name_properties_name': {'key': 'properties.name', 'type': 'str'},
23702366
'creation_token': {'key': 'properties.creationToken', 'type': 'str'},
23712367
'service_level': {'key': 'properties.serviceLevel', 'type': 'str'},
23722368
'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'},
@@ -2422,7 +2418,6 @@ def __init__(
24222418
self.type = None
24232419
self.tags = tags
24242420
self.file_system_id = None
2425-
self.name_properties_name = None
24262421
self.creation_token = creation_token
24272422
self.service_level = service_level
24282423
self.usage_threshold = usage_threshold

0 commit comments

Comments
 (0)