diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_azure_net_app_files_management_client.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_azure_net_app_files_management_client.py index 5bd1017fb270..0433ff9942b3 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_azure_net_app_files_management_client.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_azure_net_app_files_management_client.py @@ -18,7 +18,6 @@ from .operations import AccountsOperations from .operations import PoolsOperations from .operations import VolumesOperations -from .operations import MountTargetsOperations from .operations import SnapshotsOperations from . import models @@ -39,8 +38,6 @@ class AzureNetAppFilesManagementClient(SDKClient): :vartype pools: azure.mgmt.netapp.operations.PoolsOperations :ivar volumes: Volumes operations :vartype volumes: azure.mgmt.netapp.operations.VolumesOperations - :ivar mount_targets: MountTargets operations - :vartype mount_targets: azure.mgmt.netapp.operations.MountTargetsOperations :ivar snapshots: Snapshots operations :vartype snapshots: azure.mgmt.netapp.operations.SnapshotsOperations @@ -61,7 +58,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 = '2019-10-01' + self.api_version = '2019-11-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -75,7 +72,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.volumes = VolumesOperations( self._client, self.config, self._serialize, self._deserialize) - self.mount_targets = MountTargetsOperations( - self._client, self.config, self._serialize, self._deserialize) self.snapshots = SnapshotsOperations( self._client, self.config, self._serialize, self._deserialize) 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 2d8750a79e65..d1445901f9c0 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 @@ -18,6 +18,7 @@ from ._models_py3 import ExportPolicyRule from ._models_py3 import MetricSpecification from ._models_py3 import MountTarget + from ._models_py3 import MountTargetList from ._models_py3 import NetAppAccount from ._models_py3 import NetAppAccountPatch from ._models_py3 import Operation @@ -28,12 +29,12 @@ from ._models_py3 import ResourceNameAvailabilityRequest from ._models_py3 import ServiceSpecification from ._models_py3 import Snapshot - from ._models_py3 import SnapshotPatch from ._models_py3 import Volume from ._models_py3 import VolumePatch from ._models_py3 import VolumePatchPropertiesExportPolicy from ._models_py3 import VolumePropertiesDataProtection from ._models_py3 import VolumePropertiesExportPolicy + from ._models_py3 import VolumeRevert except (SyntaxError, ImportError): from ._models import ActiveDirectory from ._models import AuthorizeRequest @@ -43,6 +44,7 @@ from ._models import ExportPolicyRule from ._models import MetricSpecification from ._models import MountTarget + from ._models import MountTargetList from ._models import NetAppAccount from ._models import NetAppAccountPatch from ._models import Operation @@ -53,14 +55,13 @@ from ._models import ResourceNameAvailabilityRequest from ._models import ServiceSpecification from ._models import Snapshot - from ._models import SnapshotPatch from ._models import Volume from ._models import VolumePatch from ._models import VolumePatchPropertiesExportPolicy from ._models import VolumePropertiesDataProtection from ._models import VolumePropertiesExportPolicy + from ._models import VolumeRevert from ._paged_models import CapacityPoolPaged -from ._paged_models import MountTargetPaged from ._paged_models import NetAppAccountPaged from ._paged_models import OperationPaged from ._paged_models import SnapshotPaged @@ -84,6 +85,7 @@ 'ExportPolicyRule', 'MetricSpecification', 'MountTarget', + 'MountTargetList', 'NetAppAccount', 'NetAppAccountPatch', 'Operation', @@ -94,17 +96,16 @@ 'ResourceNameAvailabilityRequest', 'ServiceSpecification', 'Snapshot', - 'SnapshotPatch', 'Volume', 'VolumePatch', 'VolumePatchPropertiesExportPolicy', 'VolumePropertiesDataProtection', 'VolumePropertiesExportPolicy', + 'VolumeRevert', 'OperationPaged', 'NetAppAccountPaged', 'CapacityPoolPaged', 'VolumePaged', - 'MountTargetPaged', 'SnapshotPaged', 'InAvailabilityReasonType', 'CheckNameResourceTypes', 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 87676c4ab501..defcf6cdf4da 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 @@ -35,6 +35,9 @@ class ActiveDirectory(Model): :param organizational_unit: The Organizational Unit (OU) within the Windows Active Directory :type organizational_unit: str + :param site: The Active Directory site the service will limit Domain + Controller discovery to + :type site: str """ _attribute_map = { @@ -46,6 +49,7 @@ class ActiveDirectory(Model): 'status': {'key': 'status', 'type': 'str'}, 'smb_server_name': {'key': 'smbServerName', 'type': 'str'}, 'organizational_unit': {'key': 'organizationalUnit', 'type': 'str'}, + 'site': {'key': 'site', 'type': 'str'}, } def __init__(self, **kwargs): @@ -58,12 +62,13 @@ def __init__(self, **kwargs): self.status = kwargs.get('status', None) self.smb_server_name = kwargs.get('smb_server_name', None) self.organizational_unit = kwargs.get('organizational_unit', None) + self.site = kwargs.get('site', None) class AuthorizeRequest(Model): """Authorize request. - :param remote_volume_resource_id: Resource id + :param remote_volume_resource_id: Resource id of the remote volume :type remote_volume_resource_id: str """ @@ -344,25 +349,9 @@ class MountTarget(Model): :type file_system_id: str :ivar ip_address: ipAddress. The mount target's IPv4 address :vartype ip_address: str - :param subnet: subnet. The subnet - :type subnet: str - :param start_ip: startIp. The start of IPv4 address range to use when - creating a new mount target - :type start_ip: str - :param end_ip: endIp. The end of IPv4 address range to use when creating a - new mount target - :type end_ip: str - :param gateway: gateway. The gateway of the IPv4 address range to use when - creating a new mount target - :type gateway: str - :param netmask: netmask. The netmask of the IPv4 address range to use when - creating a new mount target - :type netmask: str :param smb_server_fqdn: smbServerFQDN. The SMB server's Fully Qualified Domain Name, FQDN :type smb_server_fqdn: str - :ivar provisioning_state: Azure lifecycle management - :vartype provisioning_state: str """ _validation = { @@ -373,7 +362,6 @@ class MountTarget(Model): 'mount_target_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}$'}, 'ip_address': {'readonly': True}, - 'provisioning_state': {'readonly': True}, } _attribute_map = { @@ -385,13 +373,7 @@ class MountTarget(Model): 'mount_target_id': {'key': 'properties.mountTargetId', 'type': 'str'}, 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'str'}, - 'start_ip': {'key': 'properties.startIp', 'type': 'str'}, - 'end_ip': {'key': 'properties.endIp', 'type': 'str'}, - 'gateway': {'key': 'properties.gateway', 'type': 'str'}, - 'netmask': {'key': 'properties.netmask', 'type': 'str'}, 'smb_server_fqdn': {'key': 'properties.smbServerFqdn', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } def __init__(self, **kwargs): @@ -404,13 +386,23 @@ def __init__(self, **kwargs): self.mount_target_id = None self.file_system_id = kwargs.get('file_system_id', None) self.ip_address = None - self.subnet = kwargs.get('subnet', None) - self.start_ip = kwargs.get('start_ip', None) - self.end_ip = kwargs.get('end_ip', None) - self.gateway = kwargs.get('gateway', None) - self.netmask = kwargs.get('netmask', None) self.smb_server_fqdn = kwargs.get('smb_server_fqdn', None) - self.provisioning_state = None + + +class MountTargetList(Model): + """List of Mount Targets. + + :param value: A list of Mount targets + :type value: list[~azure.mgmt.netapp.models.MountTarget] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MountTarget]'}, + } + + def __init__(self, **kwargs): + super(MountTargetList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) class NetAppAccount(Model): @@ -757,8 +749,6 @@ class Snapshot(Model): :vartype name: str :ivar type: Resource type :vartype type: str - :param tags: Resource tags - :type tags: dict[str, str] :ivar snapshot_id: snapshotId. UUID v4 used to identify the Snapshot :vartype snapshot_id: str :param file_system_id: fileSystemId. UUID v4 used to identify the @@ -786,7 +776,6 @@ class Snapshot(Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'str'}, 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, 'created': {'key': 'properties.created', 'type': 'iso-8601'}, @@ -799,29 +788,12 @@ def __init__(self, **kwargs): self.id = None self.name = None self.type = None - self.tags = kwargs.get('tags', None) self.snapshot_id = None self.file_system_id = kwargs.get('file_system_id', None) self.created = None self.provisioning_state = None -class SnapshotPatch(Model): - """Snapshot patch. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(SnapshotPatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - class Volume(Model): """Volume resource. @@ -888,7 +860,7 @@ class Volume(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}$'}, - 'creation_token': {'required': 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}, '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}|(\\?([^\/]*[\/])*)([^\/]+)$'}, @@ -1054,3 +1026,19 @@ class VolumePropertiesExportPolicy(Model): def __init__(self, **kwargs): super(VolumePropertiesExportPolicy, self).__init__(**kwargs) self.rules = kwargs.get('rules', None) + + +class VolumeRevert(Model): + """revert a volume to the snapshot. + + :param snapshot_id: Resource id of the snapshot + :type snapshot_id: str + """ + + _attribute_map = { + 'snapshot_id': {'key': 'snapshotId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VolumeRevert, self).__init__(**kwargs) + self.snapshot_id = kwargs.get('snapshot_id', None) 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 42d1ca3cb655..126b5022bc13 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 @@ -35,6 +35,9 @@ class ActiveDirectory(Model): :param organizational_unit: The Organizational Unit (OU) within the Windows Active Directory :type organizational_unit: str + :param site: The Active Directory site the service will limit Domain + Controller discovery to + :type site: str """ _attribute_map = { @@ -46,9 +49,10 @@ class ActiveDirectory(Model): 'status': {'key': 'status', 'type': 'str'}, 'smb_server_name': {'key': 'smbServerName', 'type': 'str'}, 'organizational_unit': {'key': 'organizationalUnit', 'type': 'str'}, + 'site': {'key': 'site', 'type': 'str'}, } - 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: + 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, site: str=None, **kwargs) -> None: super(ActiveDirectory, self).__init__(**kwargs) self.active_directory_id = active_directory_id self.username = username @@ -58,12 +62,13 @@ def __init__(self, *, active_directory_id: str=None, username: str=None, passwor self.status = status self.smb_server_name = smb_server_name self.organizational_unit = organizational_unit + self.site = site class AuthorizeRequest(Model): """Authorize request. - :param remote_volume_resource_id: Resource id + :param remote_volume_resource_id: Resource id of the remote volume :type remote_volume_resource_id: str """ @@ -344,25 +349,9 @@ class MountTarget(Model): :type file_system_id: str :ivar ip_address: ipAddress. The mount target's IPv4 address :vartype ip_address: str - :param subnet: subnet. The subnet - :type subnet: str - :param start_ip: startIp. The start of IPv4 address range to use when - creating a new mount target - :type start_ip: str - :param end_ip: endIp. The end of IPv4 address range to use when creating a - new mount target - :type end_ip: str - :param gateway: gateway. The gateway of the IPv4 address range to use when - creating a new mount target - :type gateway: str - :param netmask: netmask. The netmask of the IPv4 address range to use when - creating a new mount target - :type netmask: str :param smb_server_fqdn: smbServerFQDN. The SMB server's Fully Qualified Domain Name, FQDN :type smb_server_fqdn: str - :ivar provisioning_state: Azure lifecycle management - :vartype provisioning_state: str """ _validation = { @@ -373,7 +362,6 @@ class MountTarget(Model): 'mount_target_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}$'}, 'ip_address': {'readonly': True}, - 'provisioning_state': {'readonly': True}, } _attribute_map = { @@ -385,16 +373,10 @@ class MountTarget(Model): 'mount_target_id': {'key': 'properties.mountTargetId', 'type': 'str'}, 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'str'}, - 'start_ip': {'key': 'properties.startIp', 'type': 'str'}, - 'end_ip': {'key': 'properties.endIp', 'type': 'str'}, - 'gateway': {'key': 'properties.gateway', 'type': 'str'}, - 'netmask': {'key': 'properties.netmask', 'type': 'str'}, 'smb_server_fqdn': {'key': 'properties.smbServerFqdn', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, location: str, file_system_id: str, tags=None, subnet: str=None, start_ip: str=None, end_ip: str=None, gateway: str=None, netmask: str=None, smb_server_fqdn: str=None, **kwargs) -> None: + def __init__(self, *, location: str, file_system_id: str, tags=None, smb_server_fqdn: str=None, **kwargs) -> None: super(MountTarget, self).__init__(**kwargs) self.location = location self.id = None @@ -404,13 +386,23 @@ def __init__(self, *, location: str, file_system_id: str, tags=None, subnet: str self.mount_target_id = None self.file_system_id = file_system_id self.ip_address = None - self.subnet = subnet - self.start_ip = start_ip - self.end_ip = end_ip - self.gateway = gateway - self.netmask = netmask self.smb_server_fqdn = smb_server_fqdn - self.provisioning_state = None + + +class MountTargetList(Model): + """List of Mount Targets. + + :param value: A list of Mount targets + :type value: list[~azure.mgmt.netapp.models.MountTarget] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MountTarget]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(MountTargetList, self).__init__(**kwargs) + self.value = value class NetAppAccount(Model): @@ -757,8 +749,6 @@ class Snapshot(Model): :vartype name: str :ivar type: Resource type :vartype type: str - :param tags: Resource tags - :type tags: dict[str, str] :ivar snapshot_id: snapshotId. UUID v4 used to identify the Snapshot :vartype snapshot_id: str :param file_system_id: fileSystemId. UUID v4 used to identify the @@ -786,42 +776,24 @@ class Snapshot(Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'str'}, 'file_system_id': {'key': 'properties.fileSystemId', 'type': 'str'}, 'created': {'key': 'properties.created', 'type': 'iso-8601'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, location: str, tags=None, file_system_id: str=None, **kwargs) -> None: + def __init__(self, *, location: str, file_system_id: str=None, **kwargs) -> None: super(Snapshot, self).__init__(**kwargs) self.location = location self.id = None self.name = None self.type = None - self.tags = tags self.snapshot_id = None self.file_system_id = file_system_id self.created = None self.provisioning_state = None -class SnapshotPatch(Model): - """Snapshot patch. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(SnapshotPatch, self).__init__(**kwargs) - self.tags = tags - - class Volume(Model): """Volume resource. @@ -888,7 +860,7 @@ class Volume(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}$'}, - 'creation_token': {'required': 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}, '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}|(\\?([^\/]*[\/])*)([^\/]+)$'}, @@ -1054,3 +1026,19 @@ class VolumePropertiesExportPolicy(Model): def __init__(self, *, rules=None, **kwargs) -> None: super(VolumePropertiesExportPolicy, self).__init__(**kwargs) self.rules = rules + + +class VolumeRevert(Model): + """revert a volume to the snapshot. + + :param snapshot_id: Resource id of the snapshot + :type snapshot_id: str + """ + + _attribute_map = { + 'snapshot_id': {'key': 'snapshotId', 'type': 'str'}, + } + + def __init__(self, *, snapshot_id: str=None, **kwargs) -> None: + super(VolumeRevert, self).__init__(**kwargs) + self.snapshot_id = snapshot_id diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_paged_models.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_paged_models.py index 2aeed420d513..f56ae0307cf9 100644 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_paged_models.py +++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_paged_models.py @@ -64,19 +64,6 @@ class VolumePaged(Paged): def __init__(self, *args, **kwargs): super(VolumePaged, self).__init__(*args, **kwargs) -class MountTargetPaged(Paged): - """ - A paging container for iterating over a list of :class:`MountTarget ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[MountTarget]'} - } - - def __init__(self, *args, **kwargs): - - super(MountTargetPaged, self).__init__(*args, **kwargs) class SnapshotPaged(Paged): """ A paging container for iterating over a list of :class:`Snapshot ` object 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 4c58026e23eb..4658666d5793 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 @@ -14,7 +14,6 @@ from ._accounts_operations import AccountsOperations from ._pools_operations import PoolsOperations from ._volumes_operations import VolumesOperations -from ._mount_targets_operations import MountTargetsOperations from ._snapshots_operations import SnapshotsOperations __all__ = [ @@ -23,6 +22,5 @@ 'AccountsOperations', 'PoolsOperations', 'VolumesOperations', - 'MountTargetsOperations', 'SnapshotsOperations', ] 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 c832c8d2505a..d57e9a40dac7 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 @@ -27,7 +27,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: "2019-10-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-11-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-10-01" + self.api_version = "2019-11-01" self.config = config diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_mount_targets_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_mount_targets_operations.py deleted file mode 100644 index 35f21a41509e..000000000000 --- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_mount_targets_operations.py +++ /dev/null @@ -1,120 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class MountTargetsOperations(object): - """MountTargetsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :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: "2019-10-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-10-01" - - self.config = config - - def list( - self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): - """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 - :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 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: An iterator like instance of MountTarget - :rtype: - ~azure.mgmt.netapp.models.MountTargetPaged[~azure.mgmt.netapp.models.MountTarget] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - 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'), - 'volumeName': self._serialize.url("volume_name", volume_name, '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') - - else: - url = next_link - query_parameters = {} - - # 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.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - 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 - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.MountTargetPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/mountTargets'} 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 de7406785240..60c631c8ee61 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 @@ -25,7 +25,7 @@ class NetAppResourceOperations(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: "2019-10-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-11-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-10-01" + self.api_version = "2019-11-01" self.config = config 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 677211e01a69..1ef1c6b5e8c2 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 @@ -25,7 +25,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: "2019-10-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-11-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-10-01" + self.api_version = "2019-11-01" self.config = config 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 c457e2e6c0bc..8361d8f7e982 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 @@ -27,7 +27,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: "2019-10-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-11-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-10-01" + self.api_version = "2019-11-01" self.config = config @@ -143,7 +143,7 @@ def get( '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') + '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}$') } url = self._client.format_url(url, **path_format_arguments) @@ -190,7 +190,7 @@ def _create_or_update_initial( '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') + '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}$') } url = self._client.format_url(url, **path_format_arguments) @@ -290,38 +290,16 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'} - def update( - self, body, resource_group_name, account_name, pool_name, custom_headers=None, raw=False, **operation_config): - """Update a capacity pool. - - Patch the specified capacity pool. - :param body: Capacity pool object supplied in the body of the - operation. - :type body: ~azure.mgmt.netapp.models.CapacityPoolPatch - :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 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: CapacityPool or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.netapp.models.CapacityPool or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _update_initial( + self, body, resource_group_name, account_name, pool_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.update.metadata['url'] 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') + '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}$') } url = self._client.format_url(url, **path_format_arguments) @@ -353,6 +331,7 @@ def update( raise exp deserialized = None + if response.status_code == 200: deserialized = self._deserialize('CapacityPool', response) @@ -361,6 +340,61 @@ def update( return client_raw_response return deserialized + + def update( + self, body, resource_group_name, account_name, pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Update a capacity pool. + + Patch the specified capacity pool. + + :param body: Capacity pool object supplied in the body of the + operation. + :type body: ~azure.mgmt.netapp.models.CapacityPoolPatch + :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 dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns CapacityPool or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.CapacityPool] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.CapacityPool]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + body=body, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CapacityPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'} @@ -372,7 +406,7 @@ def _delete_initial( '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') + '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}$') } url = self._client.format_url(url, **path_format_arguments) 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 a87fb27a7e7c..8701e992605e 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 @@ -27,7 +27,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: "2019-10-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-11-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-10-01" + self.api_version = "2019-11-01" self.config = config @@ -73,8 +73,8 @@ def prepare_request(next_link=None): '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'), - 'volumeName': self._serialize.url("volume_name", volume_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) @@ -153,8 +153,8 @@ def get( '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'), - 'volumeName': self._serialize.url("volume_name", volume_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}$'), 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -195,15 +195,17 @@ def get( def _create_initial( - self, body, resource_group_name, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, pool_name, volume_name, snapshot_name, location, file_system_id=None, custom_headers=None, raw=False, **operation_config): + body = models.Snapshot(location=location, file_system_id=file_system_id) + # Construct URL url = self.create.metadata['url'] 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'), - 'volumeName': self._serialize.url("volume_name", volume_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}$'), 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -247,13 +249,11 @@ def _create_initial( return deserialized def create( - self, body, resource_group_name, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, account_name, pool_name, volume_name, snapshot_name, location, file_system_id=None, 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. :type resource_group_name: str :param account_name: The name of the NetApp account @@ -264,6 +264,11 @@ def create( :type volume_name: str :param snapshot_name: The name of the mount target :type snapshot_name: str + :param location: Resource location + :type location: str + :param file_system_id: fileSystemId UUID v4 used to identify the + FileSystem + :type file_system_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -278,12 +283,13 @@ def create( :raises: :class:`CloudError` """ raw_result = self._create_initial( - body=body, resource_group_name=resource_group_name, account_name=account_name, pool_name=pool_name, volume_name=volume_name, snapshot_name=snapshot_name, + location=location, + file_system_id=file_system_id, custom_headers=custom_headers, raw=True, **operation_config @@ -307,44 +313,17 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} - def update( - self, resource_group_name, account_name, pool_name, volume_name, snapshot_name, tags=None, custom_headers=None, raw=False, **operation_config): - """Update a snapshot. - - Patch a snapshot. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param account_name: The name of the NetApp account - :type account_name: str - :param pool_name: The name of the capacity pool - :type pool_name: str - :param volume_name: The name of the volume - :type volume_name: str - :param snapshot_name: The name of the mount target - :type snapshot_name: str - :param tags: Resource tags - :type tags: dict[str, 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: Snapshot or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.netapp.models.Snapshot or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - body = models.SnapshotPatch(tags=tags) + def _update_initial( + self, body, resource_group_name, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.update.metadata['url'] 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'), - 'volumeName': self._serialize.url("volume_name", volume_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}$'), 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -365,7 +344,7 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(body, 'SnapshotPatch') + body_content = self._serialize.body(body, 'object') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) @@ -377,6 +356,7 @@ def update( raise exp deserialized = None + if response.status_code == 200: deserialized = self._deserialize('Snapshot', response) @@ -385,6 +365,66 @@ def update( return client_raw_response return deserialized + + def update( + self, body, resource_group_name, account_name, pool_name, volume_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Update a snapshot. + + Patch a snapshot. + + :param body: Snapshot object supplied in the body of the operation. + :type body: object + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param account_name: The name of the NetApp account + :type account_name: str + :param pool_name: The name of the capacity pool + :type pool_name: str + :param volume_name: The name of the volume + :type volume_name: str + :param snapshot_name: The name of the mount target + :type snapshot_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Snapshot or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.Snapshot] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.Snapshot]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + body=body, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_name=snapshot_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}'} @@ -396,8 +436,8 @@ def _delete_initial( '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'), - 'volumeName': self._serialize.url("volume_name", volume_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}$'), 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py index fcbfd8eb24d0..6f5991c7e478 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 @@ -27,7 +27,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: "2019-10-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-11-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-10-01" + self.api_version = "2019-11-01" self.config = config @@ -71,7 +71,7 @@ def prepare_request(next_link=None): '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') + '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}$') } url = self._client.format_url(url, **path_format_arguments) @@ -148,8 +148,8 @@ def get( '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'), - 'volumeName': self._serialize.url("volume_name", volume_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) @@ -196,8 +196,8 @@ def _create_or_update_initial( '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'), - 'volumeName': self._serialize.url("volume_name", volume_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) @@ -299,40 +299,17 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'} - def update( - self, body, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): - """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 - :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 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: Volume or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.netapp.models.Volume or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _update_initial( + self, body, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.update.metadata['url'] 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'), - 'volumeName': self._serialize.url("volume_name", volume_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) @@ -364,6 +341,7 @@ def update( raise exp deserialized = None + if response.status_code == 200: deserialized = self._deserialize('Volume', response) @@ -372,6 +350,63 @@ def update( return client_raw_response return deserialized + + def update( + self, body, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, polling=True, **operation_config): + """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 + :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 dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Volume or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.Volume] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.Volume]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + body=body, + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Volume', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'} @@ -383,8 +418,8 @@ def _delete_initial( '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'), - 'volumeName': self._serialize.url("volume_name", volume_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) @@ -463,11 +498,57 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'} - def break_replication( - self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): - """Break volume replication. - Break the replication connection on the destination volume. + def _revert_initial( + self, resource_group_name, account_name, pool_name, volume_name, snapshot_id=None, custom_headers=None, raw=False, **operation_config): + body = models.VolumeRevert(snapshot_id=snapshot_id) + + # Construct URL + url = self.revert.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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 body + body_content = self._serialize.body(body, 'VolumeRevert') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def revert( + self, resource_group_name, account_name, pool_name, volume_name, snapshot_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Revert a volume to one of its snapshots. + + Revert a volume to the snapshot specified in the body. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -477,23 +558,55 @@ def break_replication( :type pool_name: str :param volume_name: The name of the volume :type volume_name: str + :param snapshot_id: Resource id of the snapshot + :type snapshot_id: 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ + raw_result = self._revert_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + snapshot_id=snapshot_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + revert.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert'} + + + def _break_replication_initial( + self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.break_replication.metadata['url'] 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'), - 'volumeName': self._serialize.url("volume_name", volume_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) @@ -514,7 +627,7 @@ def break_replication( request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [202]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -522,6 +635,54 @@ def break_replication( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + + def break_replication( + self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Break volume replication. + + Break the replication connection on the destination 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 dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._break_replication_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) break_replication.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication'} def replication_status_method( @@ -554,8 +715,8 @@ def replication_status_method( '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'), - 'volumeName': self._serialize.url("volume_name", volume_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) @@ -593,39 +754,17 @@ def replication_status_method( return deserialized replication_status_method.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus'} - def resync_replication( - self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): - """Resync volume replication. - - Resync the connection on the destination volume. If the operation is - ran on the source volume it will reverse-resync the connection and sync - from source to destination. - :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 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _resync_replication_initial( + self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.resync_replication.metadata['url'] 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'), - 'volumeName': self._serialize.url("volume_name", volume_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) @@ -646,7 +785,7 @@ def resync_replication( request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [202]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -654,14 +793,14 @@ def resync_replication( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - resync_replication.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication'} - def delete_replication( - self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): - """Delete volume replication. + def resync_replication( + self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Resync volume replication. - Delete the replication connection on the destination volume, and send - release to the source replication. + Resync the connection on the destination volume. If the operation is + ran on the source volume it will reverse-resync the connection and sync + from source to destination. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -672,22 +811,51 @@ def delete_replication( :param volume_name: The name of the volume :type volume_name: 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ + raw_result = self._resync_replication_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + resync_replication.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication'} + + + def _delete_replication_initial( + self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete_replication.metadata['url'] 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'), - 'volumeName': self._serialize.url("volume_name", volume_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) @@ -708,7 +876,7 @@ def delete_replication( request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [202]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -716,13 +884,13 @@ def delete_replication( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_replication.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication'} - def authorize_replication( - self, resource_group_name, account_name, pool_name, volume_name, remote_volume_resource_id=None, custom_headers=None, raw=False, **operation_config): - """Authorize source volume replication. + def delete_replication( + self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete volume replication. - Authorize the replication connection on the source volume. + Delete the replication connection on the destination volume, and send + release to the source replication. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -732,17 +900,44 @@ def authorize_replication( :type pool_name: str :param volume_name: The name of the volume :type volume_name: str - :param remote_volume_resource_id: Resource id - :type remote_volume_resource_id: 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ + raw_result = self._delete_replication_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_replication.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication'} + + + def _authorize_replication_initial( + self, resource_group_name, account_name, pool_name, volume_name, remote_volume_resource_id=None, custom_headers=None, raw=False, **operation_config): body = models.AuthorizeRequest(remote_volume_resource_id=remote_volume_resource_id) # Construct URL @@ -751,8 +946,8 @@ def authorize_replication( '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'), - 'volumeName': self._serialize.url("volume_name", volume_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) @@ -777,7 +972,7 @@ def authorize_replication( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [202]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -785,4 +980,55 @@ def authorize_replication( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + + def authorize_replication( + self, resource_group_name, account_name, pool_name, volume_name, remote_volume_resource_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Authorize source volume replication. + + Authorize the replication connection on the source 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 remote_volume_resource_id: Resource id of the remote volume + :type remote_volume_resource_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._authorize_replication_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pool_name=pool_name, + volume_name=volume_name, + remote_volume_resource_id=remote_volume_resource_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) authorize_replication.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication'}