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 b8bfda44cc72..5bd1017fb270 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 @@ -61,7 +61,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-08-01' + self.api_version = '2019-10-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) 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 d1b2b67d8a4d..888023309310 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 @@ -11,6 +11,7 @@ try: from ._models_py3 import ActiveDirectory + from ._models_py3 import AuthorizeRequest from ._models_py3 import CapacityPool from ._models_py3 import CapacityPoolPatch from ._models_py3 import Dimension @@ -22,6 +23,7 @@ from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import ReplicationObject + from ._models_py3 import ReplicationStatus from ._models_py3 import ResourceNameAvailability from ._models_py3 import ResourceNameAvailabilityRequest from ._models_py3 import ServiceSpecification @@ -34,6 +36,7 @@ from ._models_py3 import VolumePropertiesExportPolicy except (SyntaxError, ImportError): from ._models import ActiveDirectory + from ._models import AuthorizeRequest from ._models import CapacityPool from ._models import CapacityPoolPatch from ._models import Dimension @@ -45,6 +48,7 @@ from ._models import Operation from ._models import OperationDisplay from ._models import ReplicationObject + from ._models import ReplicationStatus from ._models import ResourceNameAvailability from ._models import ResourceNameAvailabilityRequest from ._models import ServiceSpecification @@ -69,6 +73,7 @@ __all__ = [ 'ActiveDirectory', + 'AuthorizeRequest', 'CapacityPool', 'CapacityPoolPatch', 'Dimension', @@ -80,6 +85,7 @@ 'Operation', 'OperationDisplay', 'ReplicationObject', + 'ReplicationStatus', 'ResourceNameAvailability', 'ResourceNameAvailabilityRequest', 'ServiceSpecification', 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 9edd349d23c2..a4c9823d14e6 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 @@ -60,6 +60,22 @@ def __init__(self, **kwargs): self.organizational_unit = kwargs.get('organizational_unit', None) +class AuthorizeRequest(Model): + """Authorize request. + + :param remote_volume_resource_id: Resource id + :type remote_volume_resource_id: str + """ + + _attribute_map = { + 'remote_volume_resource_id': {'key': 'remoteVolumeResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AuthorizeRequest, self).__init__(**kwargs) + self.remote_volume_resource_id = kwargs.get('remote_volume_resource_id', None) + + class CapacityPool(Model): """Capacity pool resource. @@ -563,20 +579,24 @@ class ReplicationObject(Model): All required parameters must be populated in order to send to Azure. - :param replication_id: replicationId. Id + :param replication_id: Id :type replication_id: str - :param endpoint_type: Required. endpointType. Indicates whether the local - volume is the source or destination for the Volume Replication + :param endpoint_type: Indicates whether the local volume is the source or + destination for the Volume Replication :type endpoint_type: str - :param replication_schedule: Required. replicationSchedule. Schedule + :param replication_schedule: Required. Schedule :type replication_schedule: str - :param remote_volume_resource_id: Required. remoteVolumeResourceId. The - resource ID of the remote volume. + :param owner_id: Id used to identify the owner of the resource + :type owner_id: str + :param remote_volume_resource_id: Required. The resource ID of the remote + volume. :type remote_volume_resource_id: str + :param remote_volume_region: The remote region for the other end of the + Volume Replication. + :type remote_volume_region: str """ _validation = { - 'endpoint_type': {'required': True}, 'replication_schedule': {'required': True}, 'remote_volume_resource_id': {'required': True}, } @@ -585,7 +605,9 @@ class ReplicationObject(Model): 'replication_id': {'key': 'replicationId', 'type': 'str'}, 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, 'replication_schedule': {'key': 'replicationSchedule', 'type': 'str'}, + 'owner_id': {'key': 'ownerId', 'type': 'str'}, 'remote_volume_resource_id': {'key': 'remoteVolumeResourceId', 'type': 'str'}, + 'remote_volume_region': {'key': 'remoteVolumeRegion', 'type': 'str'}, } def __init__(self, **kwargs): @@ -593,7 +615,42 @@ def __init__(self, **kwargs): self.replication_id = kwargs.get('replication_id', None) self.endpoint_type = kwargs.get('endpoint_type', None) self.replication_schedule = kwargs.get('replication_schedule', None) + self.owner_id = kwargs.get('owner_id', None) self.remote_volume_resource_id = kwargs.get('remote_volume_resource_id', None) + self.remote_volume_region = kwargs.get('remote_volume_region', None) + + +class ReplicationStatus(Model): + """Replication status. + + :param healthy: Replication health check + :type healthy: bool + :param relationship_status: Status of the mirror relationship + :type relationship_status: str + :param mirror_state: The status of the replication + :type mirror_state: str + :param total_progress: The progress of the replication + :type total_progress: str + :param error_message: Displays error message if the replication is in an + error state + :type error_message: str + """ + + _attribute_map = { + 'healthy': {'key': 'healthy', 'type': 'bool'}, + 'relationship_status': {'key': 'relationshipStatus', 'type': 'str'}, + 'mirror_state': {'key': 'mirrorState', 'type': 'str'}, + 'total_progress': {'key': 'totalProgress', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReplicationStatus, self).__init__(**kwargs) + self.healthy = kwargs.get('healthy', None) + self.relationship_status = kwargs.get('relationship_status', None) + self.mirror_state = kwargs.get('mirror_state', None) + self.total_progress = kwargs.get('total_progress', None) + self.error_message = kwargs.get('error_message', None) class ResourceNameAvailability(Model): @@ -819,6 +876,8 @@ class Volume(Model): replication object :type data_protection: ~azure.mgmt.netapp.models.VolumePropertiesDataProtection + :param is_restoring: Restoring + :type is_restoring: bool """ _validation = { @@ -854,6 +913,7 @@ class Volume(Model): 'mount_targets': {'key': 'properties.mountTargets', 'type': 'object'}, 'volume_type': {'key': 'properties.volumeType', 'type': 'str'}, 'data_protection': {'key': 'properties.dataProtection', 'type': 'VolumePropertiesDataProtection'}, + 'is_restoring': {'key': 'properties.isRestoring', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -876,6 +936,7 @@ def __init__(self, **kwargs): self.mount_targets = kwargs.get('mount_targets', None) self.volume_type = kwargs.get('volume_type', None) self.data_protection = kwargs.get('data_protection', None) + self.is_restoring = kwargs.get('is_restoring', None) class VolumePatch(Model): @@ -962,11 +1023,11 @@ class VolumePropertiesDataProtection(Model): DataProtection volume, can have a replication object. :param replication: Replication. Replication properties - :type replication: ~azure.mgmt.netapp.models.ReplicationObject + :type replication: object """ _attribute_map = { - 'replication': {'key': 'replication', 'type': 'ReplicationObject'}, + 'replication': {'key': 'replication', 'type': 'object'}, } def __init__(self, **kwargs): 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 dfd40377645d..a0aa6b1a9d4d 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 @@ -60,6 +60,22 @@ def __init__(self, *, active_directory_id: str=None, username: str=None, passwor self.organizational_unit = organizational_unit +class AuthorizeRequest(Model): + """Authorize request. + + :param remote_volume_resource_id: Resource id + :type remote_volume_resource_id: str + """ + + _attribute_map = { + 'remote_volume_resource_id': {'key': 'remoteVolumeResourceId', 'type': 'str'}, + } + + def __init__(self, *, remote_volume_resource_id: str=None, **kwargs) -> None: + super(AuthorizeRequest, self).__init__(**kwargs) + self.remote_volume_resource_id = remote_volume_resource_id + + class CapacityPool(Model): """Capacity pool resource. @@ -563,20 +579,24 @@ class ReplicationObject(Model): All required parameters must be populated in order to send to Azure. - :param replication_id: replicationId. Id + :param replication_id: Id :type replication_id: str - :param endpoint_type: Required. endpointType. Indicates whether the local - volume is the source or destination for the Volume Replication + :param endpoint_type: Indicates whether the local volume is the source or + destination for the Volume Replication :type endpoint_type: str - :param replication_schedule: Required. replicationSchedule. Schedule + :param replication_schedule: Required. Schedule :type replication_schedule: str - :param remote_volume_resource_id: Required. remoteVolumeResourceId. The - resource ID of the remote volume. + :param owner_id: Id used to identify the owner of the resource + :type owner_id: str + :param remote_volume_resource_id: Required. The resource ID of the remote + volume. :type remote_volume_resource_id: str + :param remote_volume_region: The remote region for the other end of the + Volume Replication. + :type remote_volume_region: str """ _validation = { - 'endpoint_type': {'required': True}, 'replication_schedule': {'required': True}, 'remote_volume_resource_id': {'required': True}, } @@ -585,15 +605,52 @@ class ReplicationObject(Model): 'replication_id': {'key': 'replicationId', 'type': 'str'}, 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, 'replication_schedule': {'key': 'replicationSchedule', 'type': 'str'}, + 'owner_id': {'key': 'ownerId', 'type': 'str'}, 'remote_volume_resource_id': {'key': 'remoteVolumeResourceId', 'type': 'str'}, + 'remote_volume_region': {'key': 'remoteVolumeRegion', 'type': 'str'}, } - def __init__(self, *, endpoint_type: str, replication_schedule: str, remote_volume_resource_id: str, replication_id: str=None, **kwargs) -> None: + def __init__(self, *, replication_schedule: str, remote_volume_resource_id: str, replication_id: str=None, endpoint_type: str=None, owner_id: str=None, remote_volume_region: str=None, **kwargs) -> None: super(ReplicationObject, self).__init__(**kwargs) self.replication_id = replication_id self.endpoint_type = endpoint_type self.replication_schedule = replication_schedule + self.owner_id = owner_id self.remote_volume_resource_id = remote_volume_resource_id + self.remote_volume_region = remote_volume_region + + +class ReplicationStatus(Model): + """Replication status. + + :param healthy: Replication health check + :type healthy: bool + :param relationship_status: Status of the mirror relationship + :type relationship_status: str + :param mirror_state: The status of the replication + :type mirror_state: str + :param total_progress: The progress of the replication + :type total_progress: str + :param error_message: Displays error message if the replication is in an + error state + :type error_message: str + """ + + _attribute_map = { + 'healthy': {'key': 'healthy', 'type': 'bool'}, + 'relationship_status': {'key': 'relationshipStatus', 'type': 'str'}, + 'mirror_state': {'key': 'mirrorState', 'type': 'str'}, + 'total_progress': {'key': 'totalProgress', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, *, healthy: bool=None, relationship_status: str=None, mirror_state: str=None, total_progress: str=None, error_message: str=None, **kwargs) -> None: + super(ReplicationStatus, self).__init__(**kwargs) + self.healthy = healthy + self.relationship_status = relationship_status + self.mirror_state = mirror_state + self.total_progress = total_progress + self.error_message = error_message class ResourceNameAvailability(Model): @@ -819,6 +876,8 @@ class Volume(Model): replication object :type data_protection: ~azure.mgmt.netapp.models.VolumePropertiesDataProtection + :param is_restoring: Restoring + :type is_restoring: bool """ _validation = { @@ -854,9 +913,10 @@ class Volume(Model): 'mount_targets': {'key': 'properties.mountTargets', 'type': 'object'}, 'volume_type': {'key': 'properties.volumeType', 'type': 'str'}, 'data_protection': {'key': 'properties.dataProtection', 'type': 'VolumePropertiesDataProtection'}, + 'is_restoring': {'key': 'properties.isRestoring', 'type': 'bool'}, } - def __init__(self, *, location: str, creation_token: str, subnet_id: str, tags=None, service_level="Premium", usage_threshold: int=107374182400, export_policy=None, protocol_types=None, snapshot_id: str=None, mount_targets=None, volume_type: str=None, data_protection=None, **kwargs) -> None: + def __init__(self, *, location: str, creation_token: str, subnet_id: str, tags=None, service_level="Premium", usage_threshold: int=107374182400, export_policy=None, protocol_types=None, snapshot_id: str=None, mount_targets=None, volume_type: str=None, data_protection=None, is_restoring: bool=None, **kwargs) -> None: super(Volume, self).__init__(**kwargs) self.location = location self.id = None @@ -876,6 +936,7 @@ def __init__(self, *, location: str, creation_token: str, subnet_id: str, tags=N self.mount_targets = mount_targets self.volume_type = volume_type self.data_protection = data_protection + self.is_restoring = is_restoring class VolumePatch(Model): @@ -962,11 +1023,11 @@ class VolumePropertiesDataProtection(Model): DataProtection volume, can have a replication object. :param replication: Replication. Replication properties - :type replication: ~azure.mgmt.netapp.models.ReplicationObject + :type replication: object """ _attribute_map = { - 'replication': {'key': 'replication', 'type': 'ReplicationObject'}, + 'replication': {'key': 'replication', 'type': 'object'}, } def __init__(self, *, replication=None, **kwargs) -> None: 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 cab47303dddd..c832c8d2505a 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-08-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-10-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-08-01" + self.api_version = "2019-10-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 index 0f9d301cdc03..35f21a41509e 100644 --- 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 @@ -25,7 +25,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: "2019-08-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-10-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-08-01" + self.api_version = "2019-10-01" self.config = config 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 1fb54afe37cd..de7406785240 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-08-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-10-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-08-01" + self.api_version = "2019-10-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 a931726c178e..677211e01a69 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-08-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-10-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-08-01" + self.api_version = "2019-10-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 19b47e8b45d1..c457e2e6c0bc 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-08-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-10-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-08-01" + self.api_version = "2019-10-01" self.config = config 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 482d61b49ebd..a87fb27a7e7c 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-08-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-10-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-08-01" + self.api_version = "2019-10-01" self.config = config 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 cffd7df22b37..0d11376aeb8f 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-08-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-10-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-08-01" + self.api_version = "2019-10-01" self.config = config @@ -462,3 +462,361 @@ def get_long_running_output(response): else: polling_method = polling 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. + + :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` + """ + # 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') + } + 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 = {} + 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 [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 + break_replication.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication'} + + + def _replication_status_method_initial( + self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.replication_status_method.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') + + # 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('ReplicationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def replication_status_method( + self, resource_group_name, account_name, pool_name, volume_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Get volume replication status. + + Get the status of the replication. + + :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 ReplicationStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.netapp.models.ReplicationStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.netapp.models.ReplicationStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._replication_status_method_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): + deserialized = self._deserialize('ReplicationStatus', 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) + 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` + """ + # 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') + } + 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 = {} + 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 [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 + 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. + + 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 + :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` + """ + # 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') + } + 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 = {} + 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 [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 + 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. + + 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 + :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 + :raises: :class:`CloudError` + """ + body = models.AuthorizeRequest(remote_volume_resource_id=remote_volume_resource_id) + + # Construct URL + url = self.authorize_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') + } + 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, 'AuthorizeRequest') + + # 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 [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 + authorize_replication.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication'}