diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/azure_net_app_files_management_client.py b/azure-mgmt-netapp/azure/mgmt/netapp/azure_net_app_files_management_client.py index f455ceed3ee2..23f5fb8c5312 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/azure_net_app_files_management_client.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/azure_net_app_files_management_client.py @@ -13,6 +13,11 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling +import uuid from .operations.operations import Operations from .operations.accounts_operations import AccountsOperations from .operations.pools_operations import PoolsOperations @@ -92,7 +97,7 @@ def __init__( super(AzureNetAppFilesManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2017-08-15' + self.api_version = '2019-05-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -108,3 +113,125 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.snapshots = SnapshotsOperations( self._client, self.config, self._serialize, self._deserialize) + + def check_name_availability( + self, location, custom_headers=None, raw=False, **operation_config): + """Check resource name availability. + + Check if a resource name is available. + + :param location: The location + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ResourceNameAvailability or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.ResourceNameAvailability or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ResourceNameAvailability', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability'} + + def check_file_path_availability( + self, location, custom_headers=None, raw=False, **operation_config): + """Check file path availability. + + Check if a file path is available. + + :param location: The location + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ResourceNameAvailability or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.netapp.models.ResourceNameAvailability or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_file_path_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ResourceNameAvailability', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_file_path_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability'} diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py index 68d7454c57bc..3806d141348a 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py @@ -15,6 +15,8 @@ from .metric_specification_py3 import MetricSpecification from .service_specification_py3 import ServiceSpecification from .operation_py3 import Operation + from .resource_name_availability_py3 import ResourceNameAvailability + from .resource_name_availability_request_py3 import ResourceNameAvailabilityRequest from .active_directory_py3 import ActiveDirectory from .net_app_account_py3 import NetAppAccount from .net_app_account_patch_py3 import NetAppAccountPatch @@ -28,13 +30,14 @@ from .mount_target_py3 import MountTarget from .snapshot_py3 import Snapshot from .snapshot_patch_py3 import SnapshotPatch - from .error_py3 import Error, ErrorException except (SyntaxError, ImportError): from .operation_display import OperationDisplay from .dimension import Dimension from .metric_specification import MetricSpecification from .service_specification import ServiceSpecification from .operation import Operation + from .resource_name_availability import ResourceNameAvailability + from .resource_name_availability_request import ResourceNameAvailabilityRequest from .active_directory import ActiveDirectory from .net_app_account import NetAppAccount from .net_app_account_patch import NetAppAccountPatch @@ -48,7 +51,6 @@ from .mount_target import MountTarget from .snapshot import Snapshot from .snapshot_patch import SnapshotPatch - from .error import Error, ErrorException from .operation_paged import OperationPaged from .net_app_account_paged import NetAppAccountPaged from .capacity_pool_paged import CapacityPoolPaged @@ -56,6 +58,8 @@ from .mount_target_paged import MountTargetPaged from .snapshot_paged import SnapshotPaged from .azure_net_app_files_management_client_enums import ( + InAvailabilityReasonType, + CheckNameResourceTypes, ServiceLevel, ) @@ -65,6 +69,8 @@ 'MetricSpecification', 'ServiceSpecification', 'Operation', + 'ResourceNameAvailability', + 'ResourceNameAvailabilityRequest', 'ActiveDirectory', 'NetAppAccount', 'NetAppAccountPatch', @@ -78,12 +84,13 @@ 'MountTarget', 'Snapshot', 'SnapshotPatch', - 'Error', 'ErrorException', 'OperationPaged', 'NetAppAccountPaged', 'CapacityPoolPaged', 'VolumePaged', 'MountTargetPaged', 'SnapshotPaged', + 'InAvailabilityReasonType', + 'CheckNameResourceTypes', 'ServiceLevel', ] diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory.py index 42659ca6f112..4e89541ee7ab 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory.py @@ -24,14 +24,14 @@ class ActiveDirectory(Model): :type password: str :param domain: Name of the Active Directory domain :type domain: str - :param d_ns: Comma separated list of DNS server IP addresses for the - Active Directory domain - :type d_ns: str + :param dns: Comma separated list of DNS server IP addresses for the Active + Directory domain + :type dns: str :param status: Status of the Active Directory :type status: str - :param s_mb_server_name: NetBIOS name of the SMB server. This name will be + :param smb_server_name: NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes - :type s_mb_server_name: str + :type smb_server_name: str :param organizational_unit: The Organizational Unit (OU) within the Windows Active Directory :type organizational_unit: str @@ -42,9 +42,9 @@ class ActiveDirectory(Model): 'username': {'key': 'username', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, 'domain': {'key': 'domain', 'type': 'str'}, - 'd_ns': {'key': 'dNS', 'type': 'str'}, + 'dns': {'key': 'dns', 'type': 'str'}, 'status': {'key': 'status', 'type': 'str'}, - 's_mb_server_name': {'key': 'sMBServerName', 'type': 'str'}, + 'smb_server_name': {'key': 'smbServerName', 'type': 'str'}, 'organizational_unit': {'key': 'organizationalUnit', 'type': 'str'}, } @@ -54,7 +54,7 @@ def __init__(self, **kwargs): self.username = kwargs.get('username', None) self.password = kwargs.get('password', None) self.domain = kwargs.get('domain', None) - self.d_ns = kwargs.get('d_ns', None) + self.dns = kwargs.get('dns', None) self.status = kwargs.get('status', None) - self.s_mb_server_name = kwargs.get('s_mb_server_name', None) + self.smb_server_name = kwargs.get('smb_server_name', None) self.organizational_unit = kwargs.get('organizational_unit', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory_py3.py index 7eec5dc63985..89fd28eb2a22 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/active_directory_py3.py @@ -24,14 +24,14 @@ class ActiveDirectory(Model): :type password: str :param domain: Name of the Active Directory domain :type domain: str - :param d_ns: Comma separated list of DNS server IP addresses for the - Active Directory domain - :type d_ns: str + :param dns: Comma separated list of DNS server IP addresses for the Active + Directory domain + :type dns: str :param status: Status of the Active Directory :type status: str - :param s_mb_server_name: NetBIOS name of the SMB server. This name will be + :param smb_server_name: NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes - :type s_mb_server_name: str + :type smb_server_name: str :param organizational_unit: The Organizational Unit (OU) within the Windows Active Directory :type organizational_unit: str @@ -42,19 +42,19 @@ class ActiveDirectory(Model): 'username': {'key': 'username', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, 'domain': {'key': 'domain', 'type': 'str'}, - 'd_ns': {'key': 'dNS', 'type': 'str'}, + 'dns': {'key': 'dns', 'type': 'str'}, 'status': {'key': 'status', 'type': 'str'}, - 's_mb_server_name': {'key': 'sMBServerName', 'type': 'str'}, + 'smb_server_name': {'key': 'smbServerName', 'type': 'str'}, 'organizational_unit': {'key': 'organizationalUnit', 'type': 'str'}, } - def __init__(self, *, active_directory_id: str=None, username: str=None, password: str=None, domain: str=None, d_ns: str=None, status: str=None, s_mb_server_name: str=None, organizational_unit: str=None, **kwargs) -> None: + def __init__(self, *, active_directory_id: str=None, username: str=None, password: str=None, domain: str=None, dns: str=None, status: str=None, smb_server_name: str=None, organizational_unit: str=None, **kwargs) -> None: super(ActiveDirectory, self).__init__(**kwargs) self.active_directory_id = active_directory_id self.username = username self.password = password self.domain = domain - self.d_ns = d_ns + self.dns = dns self.status = status - self.s_mb_server_name = s_mb_server_name + self.smb_server_name = smb_server_name self.organizational_unit = organizational_unit diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py index f810f336b84a..ef1bc0dda8e7 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/azure_net_app_files_management_client_enums.py @@ -12,6 +12,20 @@ from enum import Enum +class InAvailabilityReasonType(str, Enum): + + invalid = "Invalid" + already_exists = "AlreadyExists" + + +class CheckNameResourceTypes(str, Enum): + + microsoft_net_appnet_app_account = "Microsoft.NetApp/netAppAccount" + microsoft_net_appnet_app_accountcapacity_pools = "Microsoft.NetApp/netAppAccount/capacityPools" + microsoft_net_appnet_app_accountcapacity_poolsvolumes = "Microsoft.NetApp/netAppAccount/capacityPools/volumes" + microsoft_net_appnet_app_accountcapacity_poolsvolumessnapshots = "Microsoft.NetApp/netAppAccount/capacityPools/volumes/snapshots" + + class ServiceLevel(str, Enum): standard = "Standard" #: Standard service level diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/error.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/error.py deleted file mode 100644 index 941e7ebc820f..000000000000 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/error.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class Error(Model): - """Error response describing why the operation failed. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. Error code - :type code: str - :param message: Required. Detailed error message - :type message: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Error, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - - -class ErrorException(HttpOperationError): - """Server responsed with exception of type: 'Error'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/error_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/error_py3.py deleted file mode 100644 index 1c5b66b42758..000000000000 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/error_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class Error(Model): - """Error response describing why the operation failed. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. Error code - :type code: str - :param message: Required. Detailed error message - :type message: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, *, code: str, message: str, **kwargs) -> None: - super(Error, self).__init__(**kwargs) - self.code = code - self.message = message - - -class ErrorException(HttpOperationError): - """Server responsed with exception of type: 'Error'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/resource_name_availability.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/resource_name_availability.py new file mode 100644 index 000000000000..397cda55eb33 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/resource_name_availability.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class ResourceNameAvailability(Model): + """Information regarding availability of a resource name. + + :param is_available: true indicates name is valid and + available. false indicates the name is invalid, unavailable, + or both. + :type is_available: bool + :param reason: Invalid indicates the name provided does not + match Azure App Service naming requirements. AlreadyExists + indicates that the name is already in use and is therefore unavailable. + Possible values include: 'Invalid', 'AlreadyExists' + :type reason: str or ~azure.mgmt.netapp.models.InAvailabilityReasonType + :param message: If reason == invalid, provide the user with the reason why + the given name is invalid, and provide the resource naming requirements so + that the user can select a valid name. If reason == AlreadyExists, explain + that resource name is already in use, and direct them to select a + different name. + :type message: str + """ + + _attribute_map = { + 'is_available': {'key': 'isAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceNameAvailability, self).__init__(**kwargs) + self.is_available = kwargs.get('is_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/resource_name_availability_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/resource_name_availability_py3.py new file mode 100644 index 000000000000..f88d9f403fe0 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/resource_name_availability_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class ResourceNameAvailability(Model): + """Information regarding availability of a resource name. + + :param is_available: true indicates name is valid and + available. false indicates the name is invalid, unavailable, + or both. + :type is_available: bool + :param reason: Invalid indicates the name provided does not + match Azure App Service naming requirements. AlreadyExists + indicates that the name is already in use and is therefore unavailable. + Possible values include: 'Invalid', 'AlreadyExists' + :type reason: str or ~azure.mgmt.netapp.models.InAvailabilityReasonType + :param message: If reason == invalid, provide the user with the reason why + the given name is invalid, and provide the resource naming requirements so + that the user can select a valid name. If reason == AlreadyExists, explain + that resource name is already in use, and direct them to select a + different name. + :type message: str + """ + + _attribute_map = { + 'is_available': {'key': 'isAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, is_available: bool=None, reason=None, message: str=None, **kwargs) -> None: + super(ResourceNameAvailability, self).__init__(**kwargs) + self.is_available = is_available + self.reason = reason + self.message = message diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/resource_name_availability_request.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/resource_name_availability_request.py new file mode 100644 index 000000000000..e214c816e98b --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/resource_name_availability_request.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class ResourceNameAvailabilityRequest(Model): + """Resource name availability request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible + values include: 'Microsoft.NetApp/netAppAccount', + 'Microsoft.NetApp/netAppAccount/capacityPools', + 'Microsoft.NetApp/netAppAccount/capacityPools/volumes', + 'Microsoft.NetApp/netAppAccount/capacityPools/volumes/snapshots' + :type type: str or ~azure.mgmt.netapp.models.CheckNameResourceTypes + :param resource_group: Required. Resource group name. + :type resource_group: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'resource_group': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceNameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.resource_group = kwargs.get('resource_group', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/resource_name_availability_request_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/resource_name_availability_request_py3.py new file mode 100644 index 000000000000..9220a2b71899 --- /dev/null +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/resource_name_availability_request_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class ResourceNameAvailabilityRequest(Model): + """Resource name availability request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible + values include: 'Microsoft.NetApp/netAppAccount', + 'Microsoft.NetApp/netAppAccount/capacityPools', + 'Microsoft.NetApp/netAppAccount/capacityPools/volumes', + 'Microsoft.NetApp/netAppAccount/capacityPools/volumes/snapshots' + :type type: str or ~azure.mgmt.netapp.models.CheckNameResourceTypes + :param resource_group: Required. Resource group name. + :type resource_group: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'resource_group': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__(self, *, name: str, type, resource_group: str, **kwargs) -> None: + super(ResourceNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type + self.resource_group = resource_group diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py index cb9b70ef4d1a..2b9c7fa475f9 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot.py @@ -32,8 +32,8 @@ class Snapshot(Model): :type tags: object :ivar snapshot_id: snapshotId. UUID v4 used to identify the Snapshot :vartype snapshot_id: str - :param file_system_id: Required. fileSystemId. UUID v4 used to identify - the FileSystem + :param file_system_id: fileSystemId. UUID v4 used to identify the + FileSystem :type file_system_id: str :ivar creation_date: name. The creation date of the snapshot :vartype creation_date: datetime @@ -47,7 +47,7 @@ class Snapshot(Model): 'name': {'readonly': True}, 'type': {'readonly': True}, 'snapshot_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}$'}, - 'file_system_id': {'required': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'file_system_id': {'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, 'creation_date': {'readonly': True}, 'provisioning_state': {'readonly': True}, } diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py index ac94c966980f..fb9362306139 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/snapshot_py3.py @@ -32,8 +32,8 @@ class Snapshot(Model): :type tags: object :ivar snapshot_id: snapshotId. UUID v4 used to identify the Snapshot :vartype snapshot_id: str - :param file_system_id: Required. fileSystemId. UUID v4 used to identify - the FileSystem + :param file_system_id: fileSystemId. UUID v4 used to identify the + FileSystem :type file_system_id: str :ivar creation_date: name. The creation date of the snapshot :vartype creation_date: datetime @@ -47,7 +47,7 @@ class Snapshot(Model): 'name': {'readonly': True}, 'type': {'readonly': True}, 'snapshot_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}$'}, - 'file_system_id': {'required': True, 'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'file_system_id': {'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, 'creation_date': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -64,7 +64,7 @@ class Snapshot(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, location: str, file_system_id: str, tags=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, file_system_id: str=None, **kwargs) -> None: super(Snapshot, self).__init__(**kwargs) self.location = location self.id = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py index 5279982691c2..9c362fe0c5c8 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py @@ -44,11 +44,16 @@ class Volume(Model): Minimum size is 100 GiB. Upper limit is 100TiB. Default value: 107374182400 . :type usage_threshold: long - :param export_policy: Export policy rule + :param export_policy: exportPolicy. Set of export policy rules :type export_policy: ~azure.mgmt.netapp.models.VolumePropertiesExportPolicy :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str + :param snapshot_id: Snapshot ID. UUID v4 used to identify the Snapshot + :type snapshot_id: str + :ivar baremetal_tenant_id: Baremetal Tenant ID. Unique Baremetal Tenant + Identifier. + :vartype baremetal_tenant_id: str :param subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes :type subnet_id: str @@ -64,6 +69,8 @@ class Volume(Model): 'service_level': {'required': True}, 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, 'provisioning_state': {'readonly': True}, + 'snapshot_id': {'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'baremetal_tenant_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}$'}, } _attribute_map = { @@ -78,6 +85,8 @@ class Volume(Model): 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, 'export_policy': {'key': 'properties.exportPolicy', 'type': 'VolumePropertiesExportPolicy'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'str'}, + 'baremetal_tenant_id': {'key': 'properties.baremetalTenantId', 'type': 'str'}, 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, } @@ -94,4 +103,6 @@ def __init__(self, **kwargs): self.usage_threshold = kwargs.get('usage_threshold', 107374182400) self.export_policy = kwargs.get('export_policy', None) self.provisioning_state = None + self.snapshot_id = kwargs.get('snapshot_id', None) + self.baremetal_tenant_id = None self.subnet_id = kwargs.get('subnet_id', None) diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py index 0e9123a7ff17..9429143dcb19 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py @@ -37,7 +37,7 @@ class VolumePatch(Model): Minimum size is 100 GiB. Upper limit is 100TiB. Default value: 107374182400 . :type usage_threshold: long - :param export_policy: Export policy rule + :param export_policy: exportPolicy. Set of export policy rules :type export_policy: ~azure.mgmt.netapp.models.VolumePatchPropertiesExportPolicy """ diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy.py index f516e7bcb974..5b40edccf383 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy.py @@ -13,9 +13,11 @@ class VolumePatchPropertiesExportPolicy(Model): - """Export policy rule. + """exportPolicy. - :param rules: + Set of export policy rules. + + :param rules: Export policy rule. Export policy rule :type rules: list[~azure.mgmt.netapp.models.ExportPolicyRule] """ diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy_py3.py index 86dfd5a9d289..2f399bf38cb3 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_properties_export_policy_py3.py @@ -13,9 +13,11 @@ class VolumePatchPropertiesExportPolicy(Model): - """Export policy rule. + """exportPolicy. - :param rules: + Set of export policy rules. + + :param rules: Export policy rule. Export policy rule :type rules: list[~azure.mgmt.netapp.models.ExportPolicyRule] """ diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py index 8cfb155329aa..bff342fe79b0 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch_py3.py @@ -37,7 +37,7 @@ class VolumePatch(Model): Minimum size is 100 GiB. Upper limit is 100TiB. Default value: 107374182400 . :type usage_threshold: long - :param export_policy: Export policy rule + :param export_policy: exportPolicy. Set of export policy rules :type export_policy: ~azure.mgmt.netapp.models.VolumePatchPropertiesExportPolicy """ diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy.py index 836f7dd0fd6b..2c35eeca48ea 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy.py @@ -13,9 +13,11 @@ class VolumePropertiesExportPolicy(Model): - """Export policy rule. + """exportPolicy. - :param rules: + Set of export policy rules. + + :param rules: Export policy rule. Export policy rule :type rules: list[~azure.mgmt.netapp.models.ExportPolicyRule] """ diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy_py3.py index ae2dfcd88d26..f99f654f26ae 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_properties_export_policy_py3.py @@ -13,9 +13,11 @@ class VolumePropertiesExportPolicy(Model): - """Export policy rule. + """exportPolicy. - :param rules: + Set of export policy rules. + + :param rules: Export policy rule. Export policy rule :type rules: list[~azure.mgmt.netapp.models.ExportPolicyRule] """ diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py index 2691ac8b6e01..5459458c6dd8 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py @@ -44,11 +44,16 @@ class Volume(Model): Minimum size is 100 GiB. Upper limit is 100TiB. Default value: 107374182400 . :type usage_threshold: long - :param export_policy: Export policy rule + :param export_policy: exportPolicy. Set of export policy rules :type export_policy: ~azure.mgmt.netapp.models.VolumePropertiesExportPolicy :ivar provisioning_state: Azure lifecycle management :vartype provisioning_state: str + :param snapshot_id: Snapshot ID. UUID v4 used to identify the Snapshot + :type snapshot_id: str + :ivar baremetal_tenant_id: Baremetal Tenant ID. Unique Baremetal Tenant + Identifier. + :vartype baremetal_tenant_id: str :param subnet_id: The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes :type subnet_id: str @@ -64,6 +69,8 @@ class Volume(Model): 'service_level': {'required': True}, 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, 'provisioning_state': {'readonly': True}, + 'snapshot_id': {'max_length': 36, 'min_length': 36, 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'}, + 'baremetal_tenant_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}$'}, } _attribute_map = { @@ -78,10 +85,12 @@ class Volume(Model): 'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'}, 'export_policy': {'key': 'properties.exportPolicy', 'type': 'VolumePropertiesExportPolicy'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'str'}, + 'baremetal_tenant_id': {'key': 'properties.baremetalTenantId', 'type': 'str'}, 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, } - def __init__(self, *, location: str, creation_token: str, tags=None, service_level="Premium", usage_threshold: int=107374182400, export_policy=None, subnet_id: str=None, **kwargs) -> None: + def __init__(self, *, location: str, creation_token: str, tags=None, service_level="Premium", usage_threshold: int=107374182400, export_policy=None, snapshot_id: str=None, subnet_id: str=None, **kwargs) -> None: super(Volume, self).__init__(**kwargs) self.location = location self.id = None @@ -94,4 +103,6 @@ def __init__(self, *, location: str, creation_token: str, tags=None, service_lev self.usage_threshold = usage_threshold self.export_policy = export_policy self.provisioning_state = None + self.snapshot_id = snapshot_id + self.baremetal_tenant_id = None self.subnet_id = subnet_id diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py index 29e4bc756c29..6fb3c0b9a73e 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/accounts_operations.py @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -24,7 +25,7 @@ class AccountsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2017-08-15". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-05-01". """ models = models @@ -34,13 +35,15 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-08-15" + self.api_version = "2019-05-01" self.config = config def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all NetApp accounts in the resource group. + """Describe all NetApp Accounts in a resource group. + + List and describe all NetApp accounts in the resource group. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -52,8 +55,7 @@ def list( :return: An iterator like instance of NetAppAccount :rtype: ~azure.mgmt.netapp.models.NetAppAccountPaged[~azure.mgmt.netapp.models.NetAppAccount] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): @@ -89,7 +91,9 @@ def internal_paging(next_link=None, raw=False): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response @@ -106,7 +110,9 @@ def internal_paging(next_link=None, raw=False): def get( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Get the NetApp account. + """Describe a NetApp Account. + + Get the NetApp account. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -120,8 +126,7 @@ def get( :return: NetAppAccount or ClientRawResponse if raw=true :rtype: ~azure.mgmt.netapp.models.NetAppAccount or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ # Construct URL url = self.get.metadata['url'] @@ -151,7 +156,9 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -200,7 +207,9 @@ def _create_or_update_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -219,6 +228,9 @@ def create_or_update( self, body, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a NetApp account. + Create or update the specified NetApp account within the resource + group. + :param body: NetApp Account object supplied in the body of the operation. :type body: ~azure.mgmt.netapp.models.NetAppAccount @@ -237,8 +249,7 @@ def create_or_update( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.NetAppAccount] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.NetAppAccount]] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( body=body, @@ -297,7 +308,9 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: client_raw_response = ClientRawResponse(None, response) @@ -307,6 +320,8 @@ def delete( self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): """Delete a NetApp account. + Delete the specified NetApp account. + :param resource_group_name: The name of the resource group. :type resource_group_name: str :param account_name: The name of the NetApp account @@ -320,8 +335,7 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -347,7 +361,9 @@ def get_long_running_output(response): def update( self, body, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Patch a NetApp account. + """Update a NetApp account. + + Patch the specified NetApp account. :param body: NetApp Account object supplied in the body of the operation. @@ -364,8 +380,7 @@ def update( :return: NetAppAccount or ClientRawResponse if raw=true :rtype: ~azure.mgmt.netapp.models.NetAppAccount or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ # Construct URL url = self.update.metadata['url'] @@ -399,7 +414,9 @@ def update( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py index c0d1b4c86f2f..4f3f72cf991c 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/mount_targets_operations.py @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError from .. import models @@ -22,7 +23,7 @@ class MountTargetsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2017-08-15". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-05-01". """ models = models @@ -32,13 +33,15 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-08-15" + self.api_version = "2019-05-01" self.config = config def list( self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): - """List mount targets. + """Describe all mount targets. + + List all mount targets associated with the volume. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -56,8 +59,7 @@ def list( :return: An iterator like instance of MountTarget :rtype: ~azure.mgmt.netapp.models.MountTargetPaged[~azure.mgmt.netapp.models.MountTarget] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): @@ -96,7 +98,9 @@ def internal_paging(next_link=None, raw=False): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/operations.py index 45d58bfbb766..29b9e525cd9e 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/operations.py @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError from .. import models @@ -22,7 +23,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2017-08-15". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-05-01". """ models = models @@ -32,13 +33,15 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-08-15" + self.api_version = "2019-05-01" self.config = config def list( self, custom_headers=None, raw=False, **operation_config): - """Lists all of the available Microsoft.NetApp Rest API operations. + """Describes the Resource Provider. + + Lists all of the available Microsoft.NetApp Rest API operations. :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -48,8 +51,7 @@ def list( :return: An iterator like instance of Operation :rtype: ~azure.mgmt.netapp.models.OperationPaged[~azure.mgmt.netapp.models.Operation] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): @@ -80,7 +82,9 @@ def internal_paging(next_link=None, raw=False): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py index d59181bddf03..cdd96e103f58 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/pools_operations.py @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -24,7 +25,7 @@ class PoolsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2017-08-15". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-05-01". """ models = models @@ -34,13 +35,15 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-08-15" + self.api_version = "2019-05-01" self.config = config def list( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists all capacity pools in the NetApp Account. + """Describe all Capacity Pools. + + List all capacity pools in the NetApp Account. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -54,8 +57,7 @@ def list( :return: An iterator like instance of CapacityPool :rtype: ~azure.mgmt.netapp.models.CapacityPoolPaged[~azure.mgmt.netapp.models.CapacityPool] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): @@ -92,7 +94,9 @@ def internal_paging(next_link=None, raw=False): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response @@ -109,7 +113,9 @@ def internal_paging(next_link=None, raw=False): def get( self, resource_group_name, account_name, pool_name, custom_headers=None, raw=False, **operation_config): - """Get a capacity pool. + """Describe a Capacity Pool. + + Get details of the specified capacity pool. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -125,8 +131,7 @@ def get( :return: CapacityPool or ClientRawResponse if raw=true :rtype: ~azure.mgmt.netapp.models.CapacityPool or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ # Construct URL url = self.get.metadata['url'] @@ -157,7 +162,9 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -207,7 +214,9 @@ def _create_or_update_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -224,7 +233,9 @@ def _create_or_update_initial( def create_or_update( self, body, resource_group_name, account_name, pool_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or Update a capacity pool. + """Create or Update the specified capacity pool within the resource group. + + Create or Update a capacity pool. :param body: Capacity pool object supplied in the body of the operation. @@ -246,8 +257,7 @@ def create_or_update( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.CapacityPool] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.CapacityPool]] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( body=body, @@ -279,7 +289,9 @@ def get_long_running_output(response): def update( self, body, resource_group_name, account_name, pool_name, custom_headers=None, raw=False, **operation_config): - """Patch a capacity pool. + """Update a capacity pool. + + Patch the specified capacity pool. :param body: Capacity pool object supplied in the body of the operation. @@ -298,8 +310,7 @@ def update( :return: CapacityPool or ClientRawResponse if raw=true :rtype: ~azure.mgmt.netapp.models.CapacityPool or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ # Construct URL url = self.update.metadata['url'] @@ -334,7 +345,9 @@ def update( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -379,7 +392,9 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: client_raw_response = ClientRawResponse(None, response) @@ -389,6 +404,8 @@ def delete( self, resource_group_name, account_name, pool_name, custom_headers=None, raw=False, polling=True, **operation_config): """Delete a capacity pool. + Delete the specified capacity pool. + :param resource_group_name: The name of the resource group. :type resource_group_name: str :param account_name: The name of the NetApp account @@ -404,8 +421,7 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py index 9a05eba64e60..323a9b2de0b5 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/snapshots_operations.py @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -24,7 +25,7 @@ class SnapshotsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2017-08-15". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-05-01". """ models = models @@ -34,13 +35,15 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-08-15" + self.api_version = "2019-05-01" self.config = config def list( self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): - """List snapshots. + """Describe all snapshots. + + List all snapshots associated with the volume. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -58,8 +61,7 @@ def list( :return: An iterator like instance of Snapshot :rtype: ~azure.mgmt.netapp.models.SnapshotPaged[~azure.mgmt.netapp.models.Snapshot] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): @@ -98,7 +100,9 @@ def internal_paging(next_link=None, raw=False): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response @@ -115,7 +119,9 @@ def internal_paging(next_link=None, raw=False): def get( self, resource_group_name, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, **operation_config): - """Get a snapshot. + """Describe a snapshot. + + Get details of the specified snapshot. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -135,8 +141,7 @@ def get( :return: Snapshot or ClientRawResponse if raw=true :rtype: ~azure.mgmt.netapp.models.Snapshot or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ # Construct URL url = self.get.metadata['url'] @@ -169,7 +174,9 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -221,7 +228,9 @@ def _create_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201, 202]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -238,6 +247,8 @@ def create( self, body, resource_group_name, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): """Create a snapshot. + Create the specified snapshot within the given volume. + :param body: Snapshot object supplied in the body of the operation. :type body: ~azure.mgmt.netapp.models.Snapshot :param resource_group_name: The name of the resource group. @@ -261,8 +272,7 @@ def create( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.Snapshot] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.Snapshot]] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ raw_result = self._create_initial( body=body, @@ -296,7 +306,9 @@ def get_long_running_output(response): def update( self, resource_group_name, account_name, pool_name, volume_name, snapshot_name, tags=None, custom_headers=None, raw=False, **operation_config): - """Patch a snapshot. + """Update a snapshot. + + Patch a snapshot. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -318,8 +330,7 @@ def update( :return: Snapshot or ClientRawResponse if raw=true :rtype: ~azure.mgmt.netapp.models.Snapshot or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ body = models.SnapshotPatch(tags=tags) @@ -358,7 +369,9 @@ def update( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -405,7 +418,9 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: client_raw_response = ClientRawResponse(None, response) @@ -413,7 +428,9 @@ def _delete_initial( def delete( self, resource_group_name, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Delete snapshot. + """Delete a snapshot. + + Delete snapshot. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -434,8 +451,7 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py b/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py index 663aa86b58d4..c7eca12f4170 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/operations/volumes_operations.py @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -24,7 +25,7 @@ class VolumesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2017-08-15". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-05-01". """ models = models @@ -34,13 +35,15 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-08-15" + self.api_version = "2019-05-01" self.config = config def list( self, resource_group_name, account_name, pool_name, custom_headers=None, raw=False, **operation_config): - """List volumes. + """Describe all volumes. + + List all volumes within the capacity pool. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -56,8 +59,7 @@ def list( :return: An iterator like instance of Volume :rtype: ~azure.mgmt.netapp.models.VolumePaged[~azure.mgmt.netapp.models.Volume] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): @@ -95,7 +97,9 @@ def internal_paging(next_link=None, raw=False): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response @@ -112,7 +116,9 @@ def internal_paging(next_link=None, raw=False): def get( self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): - """Get a volume. + """Describe a volume. + + Get the details of the specified volume. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -130,8 +136,7 @@ def get( :return: Volume or ClientRawResponse if raw=true :rtype: ~azure.mgmt.netapp.models.Volume or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ # Construct URL url = self.get.metadata['url'] @@ -163,7 +168,9 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -214,7 +221,9 @@ def _create_or_update_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -231,7 +240,9 @@ def _create_or_update_initial( def create_or_update( self, body, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or update a volume. + """Create or Update a volume. + + Create or update the specified volume within the capacity pool. :param body: Volume object supplied in the body of the operation. :type body: ~azure.mgmt.netapp.models.Volume @@ -254,8 +265,7 @@ def create_or_update( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.Volume] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.Volume]] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( body=body, @@ -288,7 +298,9 @@ def get_long_running_output(response): def update( self, body, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): - """Patch a volume. + """Update a volume. + + Patch the specified volume. :param body: Volume object supplied in the body of the operation. :type body: ~azure.mgmt.netapp.models.VolumePatch @@ -308,8 +320,7 @@ def update( :return: Volume or ClientRawResponse if raw=true :rtype: ~azure.mgmt.netapp.models.Volume or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ # Construct URL url = self.update.metadata['url'] @@ -345,7 +356,9 @@ def update( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -391,7 +404,9 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: - raise models.ErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: client_raw_response = ClientRawResponse(None, response) @@ -401,6 +416,8 @@ def delete( self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, polling=True, **operation_config): """Delete a volume. + Delete the specified 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 @@ -418,8 +435,7 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorException` + :raises: :class:`CloudError` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, diff --git a/azure-mgmt-netapp/azure/mgmt/netapp/version.py b/azure-mgmt-netapp/azure/mgmt/netapp/version.py index fcb88654af0a..a39916c162ce 100644 --- a/azure-mgmt-netapp/azure/mgmt/netapp/version.py +++ b/azure-mgmt-netapp/azure/mgmt/netapp/version.py @@ -9,4 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.3.0" +VERSION = "1.0.0" + diff --git a/azure-mgmt-netapp/setup.py b/azure-mgmt-netapp/setup.py index 0f9b8f0b81fe..11cb5c9e5587 100644 --- a/azure-mgmt-netapp/setup.py +++ b/azure-mgmt-netapp/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com',