diff --git a/sdk/netapp/azure-mgmt-netapp/CHANGELOG.md b/sdk/netapp/azure-mgmt-netapp/CHANGELOG.md index 65cc6ea6176e..0d97a93753be 100644 --- a/sdk/netapp/azure-mgmt-netapp/CHANGELOG.md +++ b/sdk/netapp/azure-mgmt-netapp/CHANGELOG.md @@ -1,5 +1,24 @@ # Release History +## 2.0.0 (2021-03-16) + +**Features** + + - Model Volume has a new parameter ldap_enabled + - Model Backup has a new parameter volume_name + - Model ActiveDirectory has a new parameter allow_local_nfs_users_with_ldap + - Model BackupPatch has a new parameter volume_name + - Added operation BackupsOperations.begin_update + - Added operation group VolumeBackupStatusOperations + +**Breaking changes** + + - Model SnapshotPolicyDetails no longer has parameter name_properties_name + - Model SnapshotPolicyPatch no longer has parameter name_properties_name + - Model Volume no longer has parameter name_properties_name + - Model SnapshotPolicy no longer has parameter name_properties_name + - Removed operation BackupsOperations.update + ## 1.0.0 (2021-02-04) **Features** 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 8c1ecc699a9f..b8eb1d97fde7 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-11-01" + self.api_version = "2020-12-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 7dc68ab50c13..0185d639fa8c 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_metadata.json +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_metadata.json @@ -1,10 +1,10 @@ { - "chosen_version": "2020-11-01", - "total_api_version_list": ["2020-11-01"], + "chosen_version": "2020-12-01", + "total_api_version_list": ["2020-12-01"], "client": { "name": "NetAppManagementClient", "filename": "_net_app_management_client", - "description": "Microsoft NetApp Azure Resource Provider specification.", + "description": "Microsoft NetApp Files Azure Resource Provider specification.", "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, @@ -59,6 +59,7 @@ "volumes": "VolumesOperations", "snapshots": "SnapshotsOperations", "snapshot_policies": "SnapshotPoliciesOperations", + "volume_backup_status": "VolumeBackupStatusOperations", "account_backups": "AccountBackupsOperations", "backups": "BackupsOperations", "backup_policies": "BackupPoliciesOperations", 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 30f8ab1da59b..90193bd4fca0 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 @@ -25,6 +25,7 @@ from .operations import VolumesOperations from .operations import SnapshotsOperations from .operations import SnapshotPoliciesOperations +from .operations import VolumeBackupStatusOperations from .operations import AccountBackupsOperations from .operations import BackupsOperations from .operations import BackupPoliciesOperations @@ -33,7 +34,7 @@ class NetAppManagementClient(object): - """Microsoft NetApp Azure Resource Provider specification. + """Microsoft NetApp Files Azure Resource Provider specification. :ivar operations: Operations operations :vartype operations: azure.mgmt.netapp.operations.Operations @@ -49,6 +50,8 @@ class NetAppManagementClient(object): :vartype snapshots: azure.mgmt.netapp.operations.SnapshotsOperations :ivar snapshot_policies: SnapshotPoliciesOperations operations :vartype snapshot_policies: azure.mgmt.netapp.operations.SnapshotPoliciesOperations + :ivar volume_backup_status: VolumeBackupStatusOperations operations + :vartype volume_backup_status: azure.mgmt.netapp.operations.VolumeBackupStatusOperations :ivar account_backups: AccountBackupsOperations operations :vartype account_backups: azure.mgmt.netapp.operations.AccountBackupsOperations :ivar backups: BackupsOperations operations @@ -96,6 +99,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.snapshot_policies = SnapshotPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) + self.volume_backup_status = VolumeBackupStatusOperations( + self._client, self._config, self._serialize, self._deserialize) self.account_backups = AccountBackupsOperations( self._client, self._config, self._serialize, self._deserialize) self.backups = BackupsOperations( 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 c47f66669f1b..48944bf3938a 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 = "1.0.0" +VERSION = "2.0.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 b90414d4f71d..81f90e6a86e7 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 = "2020-11-01" + self.api_version = "2020-12-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 0bd52eb924a2..a8ee416a2288 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 @@ -23,6 +23,7 @@ from .operations import VolumesOperations from .operations import SnapshotsOperations from .operations import SnapshotPoliciesOperations +from .operations import VolumeBackupStatusOperations from .operations import AccountBackupsOperations from .operations import BackupsOperations from .operations import BackupPoliciesOperations @@ -31,7 +32,7 @@ class NetAppManagementClient(object): - """Microsoft NetApp Azure Resource Provider specification. + """Microsoft NetApp Files Azure Resource Provider specification. :ivar operations: Operations operations :vartype operations: azure.mgmt.netapp.aio.operations.Operations @@ -47,6 +48,8 @@ class NetAppManagementClient(object): :vartype snapshots: azure.mgmt.netapp.aio.operations.SnapshotsOperations :ivar snapshot_policies: SnapshotPoliciesOperations operations :vartype snapshot_policies: azure.mgmt.netapp.aio.operations.SnapshotPoliciesOperations + :ivar volume_backup_status: VolumeBackupStatusOperations operations + :vartype volume_backup_status: azure.mgmt.netapp.aio.operations.VolumeBackupStatusOperations :ivar account_backups: AccountBackupsOperations operations :vartype account_backups: azure.mgmt.netapp.aio.operations.AccountBackupsOperations :ivar backups: BackupsOperations operations @@ -93,6 +96,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.snapshot_policies = SnapshotPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) + self.volume_backup_status = VolumeBackupStatusOperations( + self._client, self._config, self._serialize, self._deserialize) self.account_backups = AccountBackupsOperations( self._client, self._config, self._serialize, self._deserialize) self.backups = BackupsOperations( 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 7e2e0c961a9b..90d13bae0251 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 @@ -13,6 +13,7 @@ from ._volumes_operations import VolumesOperations from ._snapshots_operations import SnapshotsOperations from ._snapshot_policies_operations import SnapshotPoliciesOperations +from ._volume_backup_status_operations import VolumeBackupStatusOperations from ._account_backups_operations import AccountBackupsOperations from ._backups_operations import BackupsOperations from ._backup_policies_operations import BackupPoliciesOperations @@ -26,6 +27,7 @@ 'VolumesOperations', 'SnapshotsOperations', 'SnapshotPoliciesOperations', + 'VolumeBackupStatusOperations', 'AccountBackupsOperations', 'BackupsOperations', 'BackupPoliciesOperations', diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_account_backups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_account_backups_operations.py index 55be8b3517bb..b37f59b8a039 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_account_backups_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_account_backups_operations.py @@ -66,7 +66,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -129,7 +129,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -178,7 +178,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -267,7 +267,7 @@ def get_long_running_output(pipeline_response): 'backupName': self._serialize.url("backup_name", backup_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py index 9f323376d725..f52a1072fc44 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py @@ -64,7 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -139,7 +139,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -187,7 +187,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -291,7 +291,7 @@ def get_long_running_output(pipeline_response): 'accountName': self._serialize.url("account_name", account_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -316,7 +316,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -399,7 +399,7 @@ def get_long_running_output(pipeline_response): 'accountName': self._serialize.url("account_name", account_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -425,7 +425,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_operations.py index 9bc0ee150eb5..abf62c68f231 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_operations.py @@ -67,7 +67,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -146,7 +146,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -196,7 +196,7 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -307,7 +307,7 @@ def get_long_running_output(pipeline_response): 'backupPolicyName': self._serialize.url("backup_policy_name", backup_policy_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +351,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -409,7 +409,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -498,7 +498,7 @@ def get_long_running_output(pipeline_response): 'backupPolicyName': self._serialize.url("backup_policy_name", backup_policy_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py index 1ad7845de346..532b43b7a947 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py @@ -73,7 +73,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -160,7 +160,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -214,7 +214,7 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -337,7 +337,7 @@ def get_long_running_output(pipeline_response): 'backupName': self._serialize.url("backup_name", backup_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +351,7 @@ def get_long_running_output(pipeline_response): 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}/backups/{backupName}'} # type: ignore - async def update( + async def _update_initial( self, resource_group_name: str, account_name: str, @@ -361,38 +361,17 @@ async def update( body: Optional["_models.BackupPatch"] = None, **kwargs ) -> "_models.Backup": - """Patch a backup. - - Patch a backup for 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 - :param backup_name: The name of the backup. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. - :type body: ~azure.mgmt.netapp.models.BackupPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Backup, or the result of cls(response) - :rtype: ~azure.mgmt.netapp.models.Backup - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.update.metadata['url'] # type: ignore + url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), '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( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('Backup', pipeline_response) + if response.status_code == 200: + deserialized = self._deserialize('Backup', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Backup', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}'} # type: ignore + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + backup_name: str, + body: Optional["_models.BackupPatch"] = None, + **kwargs + ) -> AsyncLROPoller["_models.Backup"]: + """Patch a backup. + + Patch a backup for 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 + :param backup_name: The name of the backup. + :type backup_name: str + :param body: Backup object supplied in the body of the operation. + :type body: ~azure.mgmt.netapp.models.BackupPatch + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Backup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Backup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"] + 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, + backup_name=backup_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Backup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + '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}$'), + '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}$'), + 'backupName': self._serialize.url("backup_name", backup_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **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}/backups/{backupName}'} # type: ignore async def _delete_initial( self, @@ -448,7 +519,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -549,7 +620,7 @@ def get_long_running_output(pipeline_response): 'backupName': self._serialize.url("backup_name", backup_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_operations.py index d9c64d34828b..4200d2e74afb 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_operations.py @@ -72,7 +72,7 @@ async def check_name_availability( error_map.update(kwargs.pop('error_map', {})) _body = _models.ResourceNameAvailabilityRequest(name=name, type=type, resource_group=resource_group) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -144,7 +144,7 @@ async def check_file_path_availability( error_map.update(kwargs.pop('error_map', {})) _body = _models.ResourceNameAvailabilityRequest(name=name, type=type, resource_group=resource_group) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -216,7 +216,7 @@ async def check_quota_availability( error_map.update(kwargs.pop('error_map', {})) _body = _models.QuotaAvailabilityRequest(name=name, type=type, resource_group=resource_group) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py index 367b60b17873..320bd8cd1728 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py @@ -59,7 +59,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_pools_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_pools_operations.py index 0cd2da58cfd2..371962958270 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_pools_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_pools_operations.py @@ -67,7 +67,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -146,7 +146,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -196,7 +196,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -333,7 +333,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -441,7 +441,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -467,7 +467,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -556,7 +556,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshot_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshot_policies_operations.py index f4846099b122..b00beaf2a92d 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshot_policies_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshot_policies_operations.py @@ -65,7 +65,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -142,7 +142,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -207,7 +207,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -266,7 +266,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -400,7 +400,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -487,7 +487,7 @@ def get_long_running_output(pipeline_response): 'snapshotPolicyName': self._serialize.url("snapshot_policy_name", snapshot_policy_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -528,7 +528,7 @@ async def list_volumes( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL 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 caa38d3fe96f..6779584191ef 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 @@ -73,7 +73,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -160,7 +160,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -214,7 +214,7 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -334,7 +334,7 @@ def get_long_running_output(pipeline_response): 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -363,7 +363,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -483,7 +483,7 @@ def get_long_running_output(pipeline_response): 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -511,7 +511,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -612,7 +612,7 @@ def get_long_running_output(pipeline_response): 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_vaults_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_vaults_operations.py index b3b711ae96fb..9360177d8558 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_vaults_operations.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_vaults_operations.py @@ -65,7 +65,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_backup_status_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_backup_status_operations.py new file mode 100644 index 000000000000..15363e45344f --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_backup_status_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VolumeBackupStatusOperations: + """VolumeBackupStatusOperations 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 + + async def get( + self, + resource_group_name: str, + account_name: str, + pool_name: str, + volume_name: str, + **kwargs + ) -> "_models.BackupStatus": + """Get volume's backup status. + + Get the status of the backup for a volume. + + :param resource_group_name: The name of the resource group. + :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: BackupStatus, or the result of cls(response) + :rtype: ~azure.mgmt.netapp.models.BackupStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + '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}$'), + '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}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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('BackupStatus', 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}/backupStatus'} # 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 b7511221f797..d9ca523fbd41 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 @@ -70,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -153,7 +153,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -205,7 +205,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -322,7 +322,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +350,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -464,7 +464,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -491,7 +491,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -586,7 +586,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -614,7 +614,7 @@ async def _revert_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -718,7 +718,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -746,7 +746,7 @@ async def _break_replication_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -853,7 +853,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -897,7 +897,7 @@ async def replication_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -948,7 +948,7 @@ async def _resync_replication_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._resync_replication_initial.metadata['url'] # type: ignore @@ -1044,7 +1044,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1071,7 +1071,7 @@ async def _delete_replication_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_replication_initial.metadata['url'] # type: ignore @@ -1167,7 +1167,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1195,7 +1195,7 @@ async def _authorize_replication_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -1299,7 +1299,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1326,7 +1326,7 @@ async def _re_initialize_replication_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._re_initialize_replication_initial.metadata['url'] # type: ignore @@ -1421,7 +1421,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1449,7 +1449,7 @@ async def _pool_change_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -1553,7 +1553,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: 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 7ac1f198fd31..2687cfd52fc5 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 @@ -16,6 +16,7 @@ from ._models_py3 import BackupPolicy from ._models_py3 import BackupPolicyDetails from ._models_py3 import BackupPolicyPatch + from ._models_py3 import BackupStatus from ._models_py3 import BackupsList from ._models_py3 import BreakReplicationRequest from ._models_py3 import CapacityPool @@ -41,6 +42,7 @@ from ._models_py3 import QuotaAvailabilityRequest from ._models_py3 import ReplicationObject from ._models_py3 import ReplicationStatus + from ._models_py3 import ResourceIdentity from ._models_py3 import ResourceNameAvailabilityRequest from ._models_py3 import ServiceSpecification from ._models_py3 import Snapshot @@ -75,6 +77,7 @@ from ._models import BackupPolicy # type: ignore from ._models import BackupPolicyDetails # type: ignore from ._models import BackupPolicyPatch # type: ignore + from ._models import BackupStatus # type: ignore from ._models import BackupsList # type: ignore from ._models import BreakReplicationRequest # type: ignore from ._models import CapacityPool # type: ignore @@ -100,6 +103,7 @@ from ._models import QuotaAvailabilityRequest # type: ignore from ._models import ReplicationObject # type: ignore from ._models import ReplicationStatus # type: ignore + from ._models import ResourceIdentity # type: ignore from ._models import ResourceNameAvailabilityRequest # type: ignore from ._models import ServiceSpecification # type: ignore from ._models import Snapshot # type: ignore @@ -132,7 +136,6 @@ CreatedByType, EndpointType, InAvailabilityReasonType, - KeySource, MirrorState, QosType, RelationshipStatus, @@ -151,6 +154,7 @@ 'BackupPolicy', 'BackupPolicyDetails', 'BackupPolicyPatch', + 'BackupStatus', 'BackupsList', 'BreakReplicationRequest', 'CapacityPool', @@ -176,6 +180,7 @@ 'QuotaAvailabilityRequest', 'ReplicationObject', 'ReplicationStatus', + 'ResourceIdentity', 'ResourceNameAvailabilityRequest', 'ServiceSpecification', 'Snapshot', @@ -206,7 +211,6 @@ 'CreatedByType', 'EndpointType', 'InAvailabilityReasonType', - 'KeySource', 'MirrorState', 'QosType', 'RelationshipStatus', diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models.py index b76a8fd31918..d1e53ba8791a 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models.py @@ -12,9 +12,8 @@ class AccountEncryption(msrest.serialization.Model): """Encryption settings. - :param key_source: Encryption Key Source. Possible values are: 'Microsoft.NetApp'. Possible - values include: "Microsoft.NetApp". - :type key_source: str or ~azure.mgmt.netapp.models.KeySource + :param key_source: Encryption Key Source. Possible values are: 'Microsoft.NetApp'. + :type key_source: str """ _attribute_map = { @@ -82,6 +81,9 @@ class ActiveDirectory(msrest.serialization.Model): :type security_operators: list[str] :param ldap_over_tls: Specifies whether or not the LDAP traffic needs to be secured via TLS. :type ldap_over_tls: bool + :param allow_local_nfs_users_with_ldap: If enabled, NFS client local users can also (in + addition to LDAP users) access the NFS volumes. + :type allow_local_nfs_users_with_ldap: bool """ _validation = { @@ -112,6 +114,7 @@ class ActiveDirectory(msrest.serialization.Model): 'ldap_signing': {'key': 'ldapSigning', 'type': 'bool'}, 'security_operators': {'key': 'securityOperators', 'type': '[str]'}, 'ldap_over_tls': {'key': 'ldapOverTLS', 'type': 'bool'}, + 'allow_local_nfs_users_with_ldap': {'key': 'allowLocalNfsUsersWithLdap', 'type': 'bool'}, } def __init__( @@ -137,6 +140,7 @@ def __init__( self.ldap_signing = kwargs.get('ldap_signing', None) self.security_operators = kwargs.get('security_operators', None) self.ldap_over_tls = kwargs.get('ldap_over_tls', None) + self.allow_local_nfs_users_with_ldap = kwargs.get('allow_local_nfs_users_with_ldap', None) class AuthorizeRequest(msrest.serialization.Model): @@ -187,6 +191,8 @@ class Backup(msrest.serialization.Model): :vartype backup_type: str :ivar failure_reason: Failure reason. :vartype failure_reason: str + :ivar volume_name: Volume name. + :vartype volume_name: str """ _validation = { @@ -200,6 +206,7 @@ class Backup(msrest.serialization.Model): 'size': {'readonly': True}, 'backup_type': {'readonly': True}, 'failure_reason': {'readonly': True}, + 'volume_name': {'readonly': True}, } _attribute_map = { @@ -214,6 +221,7 @@ class Backup(msrest.serialization.Model): 'label': {'key': 'properties.label', 'type': 'str'}, 'backup_type': {'key': 'properties.backupType', 'type': 'str'}, 'failure_reason': {'key': 'properties.failureReason', 'type': 'str'}, + 'volume_name': {'key': 'properties.volumeName', 'type': 'str'}, } def __init__( @@ -232,6 +240,7 @@ def __init__( self.label = kwargs.get('label', None) self.backup_type = None self.failure_reason = None + self.volume_name = None class BackupPatch(msrest.serialization.Model): @@ -255,6 +264,8 @@ class BackupPatch(msrest.serialization.Model): :vartype backup_type: str :ivar failure_reason: Failure reason. :vartype failure_reason: str + :ivar volume_name: Volume name. + :vartype volume_name: str """ _validation = { @@ -264,6 +275,7 @@ class BackupPatch(msrest.serialization.Model): 'size': {'readonly': True}, 'backup_type': {'readonly': True}, 'failure_reason': {'readonly': True}, + 'volume_name': {'readonly': True}, } _attribute_map = { @@ -275,6 +287,7 @@ class BackupPatch(msrest.serialization.Model): 'label': {'key': 'properties.label', 'type': 'str'}, 'backup_type': {'key': 'properties.backupType', 'type': 'str'}, 'failure_reason': {'key': 'properties.failureReason', 'type': 'str'}, + 'volume_name': {'key': 'properties.volumeName', 'type': 'str'}, } def __init__( @@ -290,6 +303,7 @@ def __init__( self.label = kwargs.get('label', None) self.backup_type = None self.failure_reason = None + self.volume_name = None class BackupPoliciesList(msrest.serialization.Model): @@ -576,6 +590,53 @@ def __init__( self.value = kwargs.get('value', None) +class BackupStatus(msrest.serialization.Model): + """Backup status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar healthy: Backup health status. + :vartype healthy: bool + :ivar relationship_status: Status of the backup mirror relationship. Possible values include: + "Idle", "Transferring". + :vartype relationship_status: str or ~azure.mgmt.netapp.models.RelationshipStatus + :ivar mirror_state: The status of the backup. Possible values include: "Uninitialized", + "Mirrored", "Broken". + :vartype mirror_state: str or ~azure.mgmt.netapp.models.MirrorState + :ivar unhealthy_reason: Reason for the unhealthy backup relationship. + :vartype unhealthy_reason: str + :ivar error_message: Displays error message if the backup is in an error state. + :vartype error_message: str + """ + + _validation = { + 'healthy': {'readonly': True}, + 'relationship_status': {'readonly': True}, + 'mirror_state': {'readonly': True}, + 'unhealthy_reason': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'healthy': {'key': 'healthy', 'type': 'bool'}, + 'relationship_status': {'key': 'relationshipStatus', 'type': 'str'}, + 'mirror_state': {'key': 'mirrorState', 'type': 'str'}, + 'unhealthy_reason': {'key': 'unhealthyReason', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupStatus, self).__init__(**kwargs) + self.healthy = None + self.relationship_status = None + self.mirror_state = None + self.unhealthy_reason = None + self.error_message = None + + class BreakReplicationRequest(msrest.serialization.Model): """Break replication request. @@ -1533,6 +1594,40 @@ def __init__( self.error_message = kwargs.get('error_message', None) +class ResourceIdentity(msrest.serialization.Model): + """ResourceIdentity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Object id of the identity resource. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the resource. + :vartype tenant_id: str + :param type: Type of Identity. Supported values are: 'None', 'SystemAssigned'. + :type type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + class ResourceNameAvailabilityRequest(msrest.serialization.Model): """Resource name availability request content. @@ -1683,8 +1778,6 @@ class SnapshotPolicy(msrest.serialization.Model): :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :ivar name_properties_name: Snapshot policy name. - :vartype name_properties_name: str :param hourly_schedule: Schedule for hourly snapshots. :type hourly_schedule: ~azure.mgmt.netapp.models.HourlySchedule :param daily_schedule: Schedule for daily snapshots. @@ -1704,7 +1797,6 @@ class SnapshotPolicy(msrest.serialization.Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'name_properties_name': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -1714,7 +1806,6 @@ class SnapshotPolicy(msrest.serialization.Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, 'hourly_schedule': {'key': 'properties.hourlySchedule', 'type': 'HourlySchedule'}, 'daily_schedule': {'key': 'properties.dailySchedule', 'type': 'DailySchedule'}, 'weekly_schedule': {'key': 'properties.weeklySchedule', 'type': 'WeeklySchedule'}, @@ -1733,7 +1824,6 @@ def __init__( self.name = None self.type = None self.tags = kwargs.get('tags', None) - self.name_properties_name = None self.hourly_schedule = kwargs.get('hourly_schedule', None) self.daily_schedule = kwargs.get('daily_schedule', None) self.weekly_schedule = kwargs.get('weekly_schedule', None) @@ -1757,8 +1847,6 @@ class SnapshotPolicyDetails(msrest.serialization.Model): :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :ivar name_properties_name: Snapshot policy name. - :vartype name_properties_name: str :param hourly_schedule: Schedule for hourly snapshots. :type hourly_schedule: ~azure.mgmt.netapp.models.HourlySchedule :param daily_schedule: Schedule for daily snapshots. @@ -1777,7 +1865,6 @@ class SnapshotPolicyDetails(msrest.serialization.Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'name_properties_name': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -1787,7 +1874,6 @@ class SnapshotPolicyDetails(msrest.serialization.Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, 'hourly_schedule': {'key': 'properties.hourlySchedule', 'type': 'HourlySchedule'}, 'daily_schedule': {'key': 'properties.dailySchedule', 'type': 'DailySchedule'}, 'weekly_schedule': {'key': 'properties.weeklySchedule', 'type': 'WeeklySchedule'}, @@ -1806,7 +1892,6 @@ def __init__( self.name = None self.type = None self.tags = kwargs.get('tags', None) - self.name_properties_name = None self.hourly_schedule = kwargs.get('hourly_schedule', None) self.daily_schedule = kwargs.get('daily_schedule', None) self.weekly_schedule = kwargs.get('weekly_schedule', None) @@ -1830,8 +1915,6 @@ class SnapshotPolicyPatch(msrest.serialization.Model): :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :ivar name_properties_name: Snapshot policy name. - :vartype name_properties_name: str :param hourly_schedule: Schedule for hourly snapshots. :type hourly_schedule: ~azure.mgmt.netapp.models.HourlySchedule :param daily_schedule: Schedule for daily snapshots. @@ -1850,7 +1933,6 @@ class SnapshotPolicyPatch(msrest.serialization.Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'name_properties_name': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -1860,7 +1942,6 @@ class SnapshotPolicyPatch(msrest.serialization.Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, 'hourly_schedule': {'key': 'properties.hourlySchedule', 'type': 'HourlySchedule'}, 'daily_schedule': {'key': 'properties.dailySchedule', 'type': 'DailySchedule'}, 'weekly_schedule': {'key': 'properties.weeklySchedule', 'type': 'WeeklySchedule'}, @@ -1879,7 +1960,6 @@ def __init__( self.name = None self.type = None self.tags = kwargs.get('tags', None) - self.name_properties_name = None self.hourly_schedule = kwargs.get('hourly_schedule', None) self.daily_schedule = kwargs.get('daily_schedule', None) self.weekly_schedule = kwargs.get('weekly_schedule', None) @@ -1941,7 +2021,7 @@ class SystemData(msrest.serialization.Model): :param last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". :type last_modified_by_type: str or ~azure.mgmt.netapp.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. + :param last_modified_at: The timestamp of resource last modification (UTC). :type last_modified_at: ~datetime.datetime """ @@ -2051,8 +2131,6 @@ class Volume(msrest.serialization.Model): :type tags: dict[str, str] :ivar file_system_id: Unique FileSystem Identifier. :vartype file_system_id: str - :ivar name_properties_name: Resource name. - :vartype name_properties_name: str :param creation_token: Required. A unique file path for the volume. Used when creating mount targets. :type creation_token: str @@ -2106,6 +2184,8 @@ class Volume(msrest.serialization.Model): :type throughput_mibps: float :param encryption_key_source: Encryption Key Source. Possible values are: 'Microsoft.NetApp'. :type encryption_key_source: str + :param ldap_enabled: Specifies whether LDAP is enabled or not for a given NFS volume. + :type ldap_enabled: bool """ _validation = { @@ -2114,7 +2194,6 @@ class Volume(msrest.serialization.Model): 'name': {'readonly': True}, 'type': {'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}$'}, - 'name_properties_name': {'readonly': True}, '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}, 'provisioning_state': {'readonly': True}, @@ -2123,7 +2202,7 @@ class Volume(msrest.serialization.Model): 'baremetal_tenant_id': {'readonly': True}, 'subnet_id': {'required': True}, 'mount_targets': {'readonly': True}, - 'throughput_mibps': {'maximum': 4500, 'minimum': 0, 'multiple': 0.001}, + 'throughput_mibps': {'maximum': 4500, 'minimum': 0}, } _attribute_map = { @@ -2133,7 +2212,6 @@ class Volume(msrest.serialization.Model): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, - 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, 'creation_token': {'key': 'properties.creationToken', 'type': 'str'}, 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, @@ -2155,6 +2233,7 @@ class Volume(msrest.serialization.Model): 'smb_continuously_available': {'key': 'properties.smbContinuouslyAvailable', 'type': 'bool'}, 'throughput_mibps': {'key': 'properties.throughputMibps', 'type': 'float'}, 'encryption_key_source': {'key': 'properties.encryptionKeySource', 'type': 'str'}, + 'ldap_enabled': {'key': 'properties.ldapEnabled', 'type': 'bool'}, } def __init__( @@ -2168,7 +2247,6 @@ def __init__( self.type = None self.tags = kwargs.get('tags', None) self.file_system_id = None - self.name_properties_name = None self.creation_token = kwargs['creation_token'] self.service_level = kwargs.get('service_level', None) self.usage_threshold = kwargs.get('usage_threshold', 107374182400) @@ -2190,6 +2268,7 @@ def __init__( self.smb_continuously_available = kwargs.get('smb_continuously_available', False) self.throughput_mibps = kwargs.get('throughput_mibps', 0) self.encryption_key_source = kwargs.get('encryption_key_source', None) + self.ldap_enabled = kwargs.get('ldap_enabled', False) class VolumeBackupProperties(msrest.serialization.Model): @@ -2309,7 +2388,7 @@ class VolumePatch(msrest.serialization.Model): 'name': {'readonly': True}, 'type': {'readonly': True}, 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, - 'throughput_mibps': {'maximum': 4500, 'minimum': 1, 'multiple': 0.001}, + 'throughput_mibps': {'maximum': 4500, 'minimum': 1}, } _attribute_map = { 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 cda4b6637e67..784e4d79b151 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 @@ -17,9 +17,8 @@ class AccountEncryption(msrest.serialization.Model): """Encryption settings. - :param key_source: Encryption Key Source. Possible values are: 'Microsoft.NetApp'. Possible - values include: "Microsoft.NetApp". - :type key_source: str or ~azure.mgmt.netapp.models.KeySource + :param key_source: Encryption Key Source. Possible values are: 'Microsoft.NetApp'. + :type key_source: str """ _attribute_map = { @@ -29,7 +28,7 @@ class AccountEncryption(msrest.serialization.Model): def __init__( self, *, - key_source: Optional[Union[str, "KeySource"]] = None, + key_source: Optional[str] = None, **kwargs ): super(AccountEncryption, self).__init__(**kwargs) @@ -89,6 +88,9 @@ class ActiveDirectory(msrest.serialization.Model): :type security_operators: list[str] :param ldap_over_tls: Specifies whether or not the LDAP traffic needs to be secured via TLS. :type ldap_over_tls: bool + :param allow_local_nfs_users_with_ldap: If enabled, NFS client local users can also (in + addition to LDAP users) access the NFS volumes. + :type allow_local_nfs_users_with_ldap: bool """ _validation = { @@ -119,6 +121,7 @@ class ActiveDirectory(msrest.serialization.Model): 'ldap_signing': {'key': 'ldapSigning', 'type': 'bool'}, 'security_operators': {'key': 'securityOperators', 'type': '[str]'}, 'ldap_over_tls': {'key': 'ldapOverTLS', 'type': 'bool'}, + 'allow_local_nfs_users_with_ldap': {'key': 'allowLocalNfsUsersWithLdap', 'type': 'bool'}, } def __init__( @@ -140,6 +143,7 @@ def __init__( ldap_signing: Optional[bool] = None, security_operators: Optional[List[str]] = None, ldap_over_tls: Optional[bool] = None, + allow_local_nfs_users_with_ldap: Optional[bool] = None, **kwargs ): super(ActiveDirectory, self).__init__(**kwargs) @@ -161,6 +165,7 @@ def __init__( self.ldap_signing = ldap_signing self.security_operators = security_operators self.ldap_over_tls = ldap_over_tls + self.allow_local_nfs_users_with_ldap = allow_local_nfs_users_with_ldap class AuthorizeRequest(msrest.serialization.Model): @@ -213,6 +218,8 @@ class Backup(msrest.serialization.Model): :vartype backup_type: str :ivar failure_reason: Failure reason. :vartype failure_reason: str + :ivar volume_name: Volume name. + :vartype volume_name: str """ _validation = { @@ -226,6 +233,7 @@ class Backup(msrest.serialization.Model): 'size': {'readonly': True}, 'backup_type': {'readonly': True}, 'failure_reason': {'readonly': True}, + 'volume_name': {'readonly': True}, } _attribute_map = { @@ -240,6 +248,7 @@ class Backup(msrest.serialization.Model): 'label': {'key': 'properties.label', 'type': 'str'}, 'backup_type': {'key': 'properties.backupType', 'type': 'str'}, 'failure_reason': {'key': 'properties.failureReason', 'type': 'str'}, + 'volume_name': {'key': 'properties.volumeName', 'type': 'str'}, } def __init__( @@ -261,6 +270,7 @@ def __init__( self.label = label self.backup_type = None self.failure_reason = None + self.volume_name = None class BackupPatch(msrest.serialization.Model): @@ -284,6 +294,8 @@ class BackupPatch(msrest.serialization.Model): :vartype backup_type: str :ivar failure_reason: Failure reason. :vartype failure_reason: str + :ivar volume_name: Volume name. + :vartype volume_name: str """ _validation = { @@ -293,6 +305,7 @@ class BackupPatch(msrest.serialization.Model): 'size': {'readonly': True}, 'backup_type': {'readonly': True}, 'failure_reason': {'readonly': True}, + 'volume_name': {'readonly': True}, } _attribute_map = { @@ -304,6 +317,7 @@ class BackupPatch(msrest.serialization.Model): 'label': {'key': 'properties.label', 'type': 'str'}, 'backup_type': {'key': 'properties.backupType', 'type': 'str'}, 'failure_reason': {'key': 'properties.failureReason', 'type': 'str'}, + 'volume_name': {'key': 'properties.volumeName', 'type': 'str'}, } def __init__( @@ -322,6 +336,7 @@ def __init__( self.label = label self.backup_type = None self.failure_reason = None + self.volume_name = None class BackupPoliciesList(msrest.serialization.Model): @@ -642,6 +657,53 @@ def __init__( self.value = value +class BackupStatus(msrest.serialization.Model): + """Backup status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar healthy: Backup health status. + :vartype healthy: bool + :ivar relationship_status: Status of the backup mirror relationship. Possible values include: + "Idle", "Transferring". + :vartype relationship_status: str or ~azure.mgmt.netapp.models.RelationshipStatus + :ivar mirror_state: The status of the backup. Possible values include: "Uninitialized", + "Mirrored", "Broken". + :vartype mirror_state: str or ~azure.mgmt.netapp.models.MirrorState + :ivar unhealthy_reason: Reason for the unhealthy backup relationship. + :vartype unhealthy_reason: str + :ivar error_message: Displays error message if the backup is in an error state. + :vartype error_message: str + """ + + _validation = { + 'healthy': {'readonly': True}, + 'relationship_status': {'readonly': True}, + 'mirror_state': {'readonly': True}, + 'unhealthy_reason': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'healthy': {'key': 'healthy', 'type': 'bool'}, + 'relationship_status': {'key': 'relationshipStatus', 'type': 'str'}, + 'mirror_state': {'key': 'mirrorState', 'type': 'str'}, + 'unhealthy_reason': {'key': 'unhealthyReason', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupStatus, self).__init__(**kwargs) + self.healthy = None + self.relationship_status = None + self.mirror_state = None + self.unhealthy_reason = None + self.error_message = None + + class BreakReplicationRequest(msrest.serialization.Model): """Break replication request. @@ -1716,6 +1778,42 @@ def __init__( self.error_message = error_message +class ResourceIdentity(msrest.serialization.Model): + """ResourceIdentity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Object id of the identity resource. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the resource. + :vartype tenant_id: str + :param type: Type of Identity. Supported values are: 'None', 'SystemAssigned'. + :type type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + class ResourceNameAvailabilityRequest(msrest.serialization.Model): """Resource name availability request content. @@ -1876,8 +1974,6 @@ class SnapshotPolicy(msrest.serialization.Model): :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :ivar name_properties_name: Snapshot policy name. - :vartype name_properties_name: str :param hourly_schedule: Schedule for hourly snapshots. :type hourly_schedule: ~azure.mgmt.netapp.models.HourlySchedule :param daily_schedule: Schedule for daily snapshots. @@ -1897,7 +1993,6 @@ class SnapshotPolicy(msrest.serialization.Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'name_properties_name': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -1907,7 +2002,6 @@ class SnapshotPolicy(msrest.serialization.Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, 'hourly_schedule': {'key': 'properties.hourlySchedule', 'type': 'HourlySchedule'}, 'daily_schedule': {'key': 'properties.dailySchedule', 'type': 'DailySchedule'}, 'weekly_schedule': {'key': 'properties.weeklySchedule', 'type': 'WeeklySchedule'}, @@ -1934,7 +2028,6 @@ def __init__( self.name = None self.type = None self.tags = tags - self.name_properties_name = None self.hourly_schedule = hourly_schedule self.daily_schedule = daily_schedule self.weekly_schedule = weekly_schedule @@ -1958,8 +2051,6 @@ class SnapshotPolicyDetails(msrest.serialization.Model): :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :ivar name_properties_name: Snapshot policy name. - :vartype name_properties_name: str :param hourly_schedule: Schedule for hourly snapshots. :type hourly_schedule: ~azure.mgmt.netapp.models.HourlySchedule :param daily_schedule: Schedule for daily snapshots. @@ -1978,7 +2069,6 @@ class SnapshotPolicyDetails(msrest.serialization.Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'name_properties_name': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -1988,7 +2078,6 @@ class SnapshotPolicyDetails(msrest.serialization.Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, 'hourly_schedule': {'key': 'properties.hourlySchedule', 'type': 'HourlySchedule'}, 'daily_schedule': {'key': 'properties.dailySchedule', 'type': 'DailySchedule'}, 'weekly_schedule': {'key': 'properties.weeklySchedule', 'type': 'WeeklySchedule'}, @@ -2015,7 +2104,6 @@ def __init__( self.name = None self.type = None self.tags = tags - self.name_properties_name = None self.hourly_schedule = hourly_schedule self.daily_schedule = daily_schedule self.weekly_schedule = weekly_schedule @@ -2039,8 +2127,6 @@ class SnapshotPolicyPatch(msrest.serialization.Model): :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :ivar name_properties_name: Snapshot policy name. - :vartype name_properties_name: str :param hourly_schedule: Schedule for hourly snapshots. :type hourly_schedule: ~azure.mgmt.netapp.models.HourlySchedule :param daily_schedule: Schedule for daily snapshots. @@ -2059,7 +2145,6 @@ class SnapshotPolicyPatch(msrest.serialization.Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'name_properties_name': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -2069,7 +2154,6 @@ class SnapshotPolicyPatch(msrest.serialization.Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, 'hourly_schedule': {'key': 'properties.hourlySchedule', 'type': 'HourlySchedule'}, 'daily_schedule': {'key': 'properties.dailySchedule', 'type': 'DailySchedule'}, 'weekly_schedule': {'key': 'properties.weeklySchedule', 'type': 'WeeklySchedule'}, @@ -2096,7 +2180,6 @@ def __init__( self.name = None self.type = None self.tags = tags - self.name_properties_name = None self.hourly_schedule = hourly_schedule self.daily_schedule = daily_schedule self.weekly_schedule = weekly_schedule @@ -2162,7 +2245,7 @@ class SystemData(msrest.serialization.Model): :param last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". :type last_modified_by_type: str or ~azure.mgmt.netapp.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. + :param last_modified_at: The timestamp of resource last modification (UTC). :type last_modified_at: ~datetime.datetime """ @@ -2284,8 +2367,6 @@ class Volume(msrest.serialization.Model): :type tags: dict[str, str] :ivar file_system_id: Unique FileSystem Identifier. :vartype file_system_id: str - :ivar name_properties_name: Resource name. - :vartype name_properties_name: str :param creation_token: Required. A unique file path for the volume. Used when creating mount targets. :type creation_token: str @@ -2339,6 +2420,8 @@ class Volume(msrest.serialization.Model): :type throughput_mibps: float :param encryption_key_source: Encryption Key Source. Possible values are: 'Microsoft.NetApp'. :type encryption_key_source: str + :param ldap_enabled: Specifies whether LDAP is enabled or not for a given NFS volume. + :type ldap_enabled: bool """ _validation = { @@ -2347,7 +2430,6 @@ class Volume(msrest.serialization.Model): 'name': {'readonly': True}, 'type': {'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}$'}, - 'name_properties_name': {'readonly': True}, '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}, 'provisioning_state': {'readonly': True}, @@ -2356,7 +2438,7 @@ class Volume(msrest.serialization.Model): 'baremetal_tenant_id': {'readonly': True}, 'subnet_id': {'required': True}, 'mount_targets': {'readonly': True}, - 'throughput_mibps': {'maximum': 4500, 'minimum': 0, 'multiple': 0.001}, + 'throughput_mibps': {'maximum': 4500, 'minimum': 0}, } _attribute_map = { @@ -2366,7 +2448,6 @@ class Volume(msrest.serialization.Model): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, - 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, 'creation_token': {'key': 'properties.creationToken', 'type': 'str'}, 'service_level': {'key': 'properties.serviceLevel', 'type': 'str'}, 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, @@ -2388,6 +2469,7 @@ class Volume(msrest.serialization.Model): 'smb_continuously_available': {'key': 'properties.smbContinuouslyAvailable', 'type': 'bool'}, 'throughput_mibps': {'key': 'properties.throughputMibps', 'type': 'float'}, 'encryption_key_source': {'key': 'properties.encryptionKeySource', 'type': 'str'}, + 'ldap_enabled': {'key': 'properties.ldapEnabled', 'type': 'bool'}, } def __init__( @@ -2413,6 +2495,7 @@ def __init__( smb_continuously_available: Optional[bool] = False, throughput_mibps: Optional[float] = 0, encryption_key_source: Optional[str] = None, + ldap_enabled: Optional[bool] = False, **kwargs ): super(Volume, self).__init__(**kwargs) @@ -2422,7 +2505,6 @@ def __init__( self.type = None self.tags = tags self.file_system_id = None - self.name_properties_name = None self.creation_token = creation_token self.service_level = service_level self.usage_threshold = usage_threshold @@ -2444,6 +2526,7 @@ def __init__( self.smb_continuously_available = smb_continuously_available self.throughput_mibps = throughput_mibps self.encryption_key_source = encryption_key_source + self.ldap_enabled = ldap_enabled class VolumeBackupProperties(msrest.serialization.Model): @@ -2575,7 +2658,7 @@ class VolumePatch(msrest.serialization.Model): 'name': {'readonly': True}, 'type': {'readonly': True}, 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, - 'throughput_mibps': {'maximum': 4500, 'minimum': 1, 'multiple': 0.001}, + 'throughput_mibps': {'maximum': 4500, 'minimum': 1}, } _attribute_map = { 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 80474e2a1716..6ef94d15a25e 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 @@ -79,12 +79,6 @@ class InAvailabilityReasonType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enu INVALID = "Invalid" ALREADY_EXISTS = "AlreadyExists" -class KeySource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Encryption Key Source. Possible values are: 'Microsoft.NetApp'. - """ - - MICROSOFT_NET_APP = "Microsoft.NetApp" #: The service manages the keys. - class MirrorState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The status of the replication """ 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 7e2e0c961a9b..90d13bae0251 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 @@ -13,6 +13,7 @@ from ._volumes_operations import VolumesOperations from ._snapshots_operations import SnapshotsOperations from ._snapshot_policies_operations import SnapshotPoliciesOperations +from ._volume_backup_status_operations import VolumeBackupStatusOperations from ._account_backups_operations import AccountBackupsOperations from ._backups_operations import BackupsOperations from ._backup_policies_operations import BackupPoliciesOperations @@ -26,6 +27,7 @@ 'VolumesOperations', 'SnapshotsOperations', 'SnapshotPoliciesOperations', + 'VolumeBackupStatusOperations', 'AccountBackupsOperations', 'BackupsOperations', 'BackupPoliciesOperations', 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 38f8b34b72ba..434c3d118d81 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 @@ -71,7 +71,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -135,7 +135,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -185,7 +185,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -275,7 +275,7 @@ def get_long_running_output(pipeline_response): 'backupName': self._serialize.url("backup_name", backup_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: 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 a5a61c3fd34d..6a4aca3631ed 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 @@ -69,7 +69,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -145,7 +145,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -194,7 +194,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -299,7 +299,7 @@ def get_long_running_output(pipeline_response): 'accountName': self._serialize.url("account_name", account_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -325,7 +325,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -409,7 +409,7 @@ def get_long_running_output(pipeline_response): 'accountName': self._serialize.url("account_name", account_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -436,7 +436,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" 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 f783b03d0c2c..c7424da5c7df 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 @@ -72,7 +72,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -152,7 +152,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -203,7 +203,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -315,7 +315,7 @@ def get_long_running_output(pipeline_response): 'backupPolicyName': self._serialize.url("backup_policy_name", backup_policy_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +360,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -419,7 +419,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -509,7 +509,7 @@ def get_long_running_output(pipeline_response): 'backupPolicyName': self._serialize.url("backup_policy_name", backup_policy_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: 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 49e891d252be..14bd7afdad65 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 @@ -78,7 +78,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -166,7 +166,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -221,7 +221,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -345,7 +345,7 @@ def get_long_running_output(pipeline_response): 'backupName': self._serialize.url("backup_name", backup_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +359,7 @@ def get_long_running_output(pipeline_response): 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}/backups/{backupName}'} # type: ignore - def update( + def _update_initial( self, resource_group_name, # type: str account_name, # type: str @@ -370,38 +370,17 @@ def update( **kwargs # type: Any ): # type: (...) -> "_models.Backup" - """Patch a backup. - - Patch a backup for 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 - :param backup_name: The name of the backup. - :type backup_name: str - :param body: Backup object supplied in the body of the operation. - :type body: ~azure.mgmt.netapp.models.BackupPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Backup, or the result of cls(response) - :rtype: ~azure.mgmt.netapp.models.Backup - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.update.metadata['url'] # type: ignore + url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -431,17 +410,110 @@ def update( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('Backup', pipeline_response) + if response.status_code == 200: + deserialized = self._deserialize('Backup', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Backup', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}'} # type: ignore + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + account_name, # type: str + pool_name, # type: str + volume_name, # type: str + backup_name, # type: str + body=None, # type: Optional["_models.BackupPatch"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Backup"] + """Patch a backup. + + Patch a backup for 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 + :param backup_name: The name of the backup. + :type backup_name: str + :param body: Backup object supplied in the body of the operation. + :type body: ~azure.mgmt.netapp.models.BackupPatch + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Backup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"] + 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, + backup_name=backup_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Backup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + '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}$'), + '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}$'), + 'backupName': self._serialize.url("backup_name", backup_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **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}/backups/{backupName}'} # type: ignore def _delete_initial( self, @@ -458,7 +530,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -560,7 +632,7 @@ def get_long_running_output(pipeline_response): 'backupName': self._serialize.url("backup_name", backup_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: 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 c41bc5f859b5..0d9c4d4f9e7d 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 @@ -77,7 +77,7 @@ def check_name_availability( error_map.update(kwargs.pop('error_map', {})) _body = _models.ResourceNameAvailabilityRequest(name=name, type=type, resource_group=resource_group) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -150,7 +150,7 @@ def check_file_path_availability( error_map.update(kwargs.pop('error_map', {})) _body = _models.ResourceNameAvailabilityRequest(name=name, type=type, resource_group=resource_group) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -223,7 +223,7 @@ def check_quota_availability( error_map.update(kwargs.pop('error_map', {})) _body = _models.QuotaAvailabilityRequest(name=name, type=type, resource_group=resource_group) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" 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 6965d005f903..8836a0ead984 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 @@ -64,7 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): 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 e3a5f229d44b..064096bae2c0 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 @@ -72,7 +72,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -152,7 +152,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -203,7 +203,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -342,7 +342,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -451,7 +451,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -478,7 +478,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -568,7 +568,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: 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 71b83af539fa..77c060bab7fa 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 @@ -70,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -148,7 +148,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -214,7 +214,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -274,7 +274,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -410,7 +410,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -498,7 +498,7 @@ def get_long_running_output(pipeline_response): 'snapshotPolicyName': self._serialize.url("snapshot_policy_name", snapshot_policy_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -540,7 +540,7 @@ def list_volumes( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL 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 6d819557b477..d75e875f9593 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 @@ -78,7 +78,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -166,7 +166,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -221,7 +221,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -342,7 +342,7 @@ def get_long_running_output(pipeline_response): 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -372,7 +372,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -493,7 +493,7 @@ def get_long_running_output(pipeline_response): 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -522,7 +522,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -624,7 +624,7 @@ def get_long_running_output(pipeline_response): 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: 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 ad203cb4f08b..b9f0f9b5d98c 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 @@ -70,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_backup_status_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_backup_status_operations.py new file mode 100644 index 000000000000..eeb3599e1230 --- /dev/null +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_backup_status_operations.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VolumeBackupStatusOperations(object): + """VolumeBackupStatusOperations 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 + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + pool_name, # type: str + volume_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupStatus" + """Get volume's backup status. + + Get the status of the backup for a volume. + + :param resource_group_name: The name of the resource group. + :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: BackupStatus, or the result of cls(response) + :rtype: ~azure.mgmt.netapp.models.BackupStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + '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}$'), + '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}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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('BackupStatus', 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}/backupStatus'} # type: ignore 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 1c3f3eaad60a..139c6dde72ca 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 @@ -75,7 +75,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -159,7 +159,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -212,7 +212,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -330,7 +330,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +359,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -474,7 +474,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -502,7 +502,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -598,7 +598,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -627,7 +627,7 @@ def _revert_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -732,7 +732,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -761,7 +761,7 @@ def _break_replication_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -869,7 +869,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -914,7 +914,7 @@ def replication_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -966,7 +966,7 @@ def _resync_replication_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._resync_replication_initial.metadata['url'] # type: ignore @@ -1063,7 +1063,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1091,7 +1091,7 @@ def _delete_replication_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._delete_replication_initial.metadata['url'] # type: ignore @@ -1188,7 +1188,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1217,7 +1217,7 @@ def _authorize_replication_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -1322,7 +1322,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1350,7 +1350,7 @@ def _re_initialize_replication_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" # Construct URL url = self._re_initialize_replication_initial.metadata['url'] # type: ignore @@ -1446,7 +1446,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1475,7 +1475,7 @@ def _pool_change_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -1580,7 +1580,7 @@ def get_long_running_output(pipeline_response): '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}$'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: