From e6e2023a43d8dc50ae514da4668ff7e89b37f7a9 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 25 May 2020 01:44:17 +0000 Subject: [PATCH] Generated from 5ea0864622ac9158c3426a4457abef55a5238051 Add New ApiVersion 2020-03-01 --- sdk/storage/azure-mgmt-storagesync/README.md | 28 +- .../_storage_sync_management_client.py | 12 +- .../azure/mgmt/storagesync/models/__init__.py | 61 ++ .../azure/mgmt/storagesync/models/_models.py | 559 ++++++++++++++++- .../mgmt/storagesync/models/_models_py3.py | 573 ++++++++++++++++-- .../mgmt/storagesync/models/_paged_models.py | 13 + .../_storage_sync_management_client_enums.py | 95 +++ .../mgmt/storagesync/operations/__init__.py | 4 + .../operations/_cloud_endpoints_operations.py | 4 +- .../_operation_status_operations.py | 4 +- .../storagesync/operations/_operations.py | 4 +- ...private_endpoint_connections_operations.py | 408 +++++++++++++ .../_private_link_resources_operations.py | 105 ++++ .../_registered_servers_operations.py | 4 +- .../_server_endpoints_operations.py | 4 +- .../_storage_sync_services_operations.py | 272 ++++++--- .../operations/_sync_groups_operations.py | 4 +- .../operations/_workflows_operations.py | 4 +- sdk/storage/azure-mgmt-storagesync/setup.py | 4 +- 19 files changed, 1999 insertions(+), 163 deletions(-) create mode 100644 sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_private_link_resources_operations.py diff --git a/sdk/storage/azure-mgmt-storagesync/README.md b/sdk/storage/azure-mgmt-storagesync/README.md index d166b740b08f..0092b0a6dfab 100644 --- a/sdk/storage/azure-mgmt-storagesync/README.md +++ b/sdk/storage/azure-mgmt-storagesync/README.md @@ -1,29 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure Storage Sync Client Library. - -Azure Resource Manager (ARM) is the next generation of management APIs -that replace the old Azure Service Management (ASM). - This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. +# Usage -## Usage +For code examples, see [Storage Sync](https://docs.microsoft.com/python/api/overview/azure/) +on docs.microsoft.com. -For code examples, see [Storage -Sync](https://docs.microsoft.com/python/api/overview/azure/) on -docs.microsoft.com. -## Provide Feedback +# Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-storagesync%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-storagesync%2FREADME.png) diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/_storage_sync_management_client.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/_storage_sync_management_client.py index f5713284dc7c..71887f4d26ec 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/_storage_sync_management_client.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/_storage_sync_management_client.py @@ -15,6 +15,8 @@ from ._configuration import StorageSyncManagementClientConfiguration from .operations import Operations from .operations import StorageSyncServicesOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionsOperations from .operations import SyncGroupsOperations from .operations import CloudEndpointsOperations from .operations import ServerEndpointsOperations @@ -34,6 +36,10 @@ class StorageSyncManagementClient(SDKClient): :vartype operations: azure.mgmt.storagesync.operations.Operations :ivar storage_sync_services: StorageSyncServices operations :vartype storage_sync_services: azure.mgmt.storagesync.operations.StorageSyncServicesOperations + :ivar private_link_resources: PrivateLinkResources operations + :vartype private_link_resources: azure.mgmt.storagesync.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnections operations + :vartype private_endpoint_connections: azure.mgmt.storagesync.operations.PrivateEndpointConnectionsOperations :ivar sync_groups: SyncGroups operations :vartype sync_groups: azure.mgmt.storagesync.operations.SyncGroupsOperations :ivar cloud_endpoints: CloudEndpoints operations @@ -62,7 +68,7 @@ def __init__( super(StorageSyncManagementClient, 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-06-01' + self.api_version = '2020-03-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -70,6 +76,10 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.storage_sync_services = StorageSyncServicesOperations( self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) self.sync_groups = SyncGroupsOperations( self._client, self.config, self._serialize, self._deserialize) self.cloud_endpoints = CloudEndpointsOperations( diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/__init__.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/__init__.py index 60a4df781d88..420a90bafd5b 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/__init__.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/__init__.py @@ -16,6 +16,12 @@ from ._models_py3 import CheckNameAvailabilityResult from ._models_py3 import CloudEndpoint from ._models_py3 import CloudEndpointCreateParameters + from ._models_py3 import CloudTieringCachePerformance + from ._models_py3 import CloudTieringDatePolicyStatus + from ._models_py3 import CloudTieringFilesNotTiering + from ._models_py3 import CloudTieringSpaceSavings + from ._models_py3 import CloudTieringVolumeFreeSpacePolicyStatus + from ._models_py3 import FilesNotTieringError from ._models_py3 import OperationDisplayInfo from ._models_py3 import OperationDisplayResource from ._models_py3 import OperationEntity @@ -23,6 +29,11 @@ from ._models_py3 import PostBackupResponse from ._models_py3 import PostRestoreRequest from ._models_py3 import PreRestoreRequest + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import ProxyResource from ._models_py3 import RecallActionParameters from ._models_py3 import RegisteredServer @@ -60,6 +71,12 @@ from ._models import CheckNameAvailabilityResult from ._models import CloudEndpoint from ._models import CloudEndpointCreateParameters + from ._models import CloudTieringCachePerformance + from ._models import CloudTieringDatePolicyStatus + from ._models import CloudTieringFilesNotTiering + from ._models import CloudTieringSpaceSavings + from ._models import CloudTieringVolumeFreeSpacePolicyStatus + from ._models import FilesNotTieringError from ._models import OperationDisplayInfo from ._models import OperationDisplayResource from ._models import OperationEntity @@ -67,6 +84,11 @@ from ._models import PostBackupResponse from ._models import PostRestoreRequest from ._models import PreRestoreRequest + from ._models import PrivateEndpoint + from ._models import PrivateEndpointConnection + from ._models import PrivateLinkResource + from ._models import PrivateLinkResourceListResult + from ._models import PrivateLinkServiceConnectionState from ._models import ProxyResource from ._models import RecallActionParameters from ._models import RegisteredServer @@ -99,6 +121,7 @@ from ._models import Workflow from ._paged_models import CloudEndpointPaged from ._paged_models import OperationEntityPaged +from ._paged_models import PrivateEndpointConnectionPaged from ._paged_models import RegisteredServerPaged from ._paged_models import ServerEndpointPaged from ._paged_models import StorageSyncServicePaged @@ -106,8 +129,21 @@ from ._paged_models import WorkflowPaged from ._storage_sync_management_client_enums import ( Reason, + IncomingTrafficPolicy, + PrivateEndpointServiceConnectionStatus, + PrivateEndpointConnectionProvisioningState, ChangeDetectionMode, + FeatureStatus, + InitialDownloadPolicy, + LocalCacheMode, + ServerEndpointSyncHealthState, + ServerEndpointSyncActivityState, + ServerEndpointOfflineDataTransferState, + ServerEndpointCloudTieringHealthState, + WorkflowStatus, + OperationDirection, NameAvailabilityReason, + ProgressType, ) __all__ = [ @@ -117,6 +153,12 @@ 'CheckNameAvailabilityResult', 'CloudEndpoint', 'CloudEndpointCreateParameters', + 'CloudTieringCachePerformance', + 'CloudTieringDatePolicyStatus', + 'CloudTieringFilesNotTiering', + 'CloudTieringSpaceSavings', + 'CloudTieringVolumeFreeSpacePolicyStatus', + 'FilesNotTieringError', 'OperationDisplayInfo', 'OperationDisplayResource', 'OperationEntity', @@ -124,6 +166,11 @@ 'PostBackupResponse', 'PostRestoreRequest', 'PreRestoreRequest', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', 'ProxyResource', 'RecallActionParameters', 'RegisteredServer', @@ -156,12 +203,26 @@ 'Workflow', 'OperationEntityPaged', 'StorageSyncServicePaged', + 'PrivateEndpointConnectionPaged', 'SyncGroupPaged', 'CloudEndpointPaged', 'ServerEndpointPaged', 'RegisteredServerPaged', 'WorkflowPaged', 'Reason', + 'IncomingTrafficPolicy', + 'PrivateEndpointServiceConnectionStatus', + 'PrivateEndpointConnectionProvisioningState', 'ChangeDetectionMode', + 'FeatureStatus', + 'InitialDownloadPolicy', + 'LocalCacheMode', + 'ServerEndpointSyncHealthState', + 'ServerEndpointSyncActivityState', + 'ServerEndpointOfflineDataTransferState', + 'ServerEndpointCloudTieringHealthState', + 'WorkflowStatus', + 'OperationDirection', 'NameAvailabilityReason', + 'ProgressType', ] diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_models.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_models.py index 0f10576b514f..6a2cb2ce2a88 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_models.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_models.py @@ -332,6 +332,221 @@ class CloudError(Model): } +class CloudTieringCachePerformance(Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_updated_timestamp: Last updated timestamp + :vartype last_updated_timestamp: datetime + :ivar cache_hit_bytes: Count of bytes that were served from the local + server + :vartype cache_hit_bytes: long + :ivar cache_miss_bytes: Count of bytes that were served from the cloud + :vartype cache_miss_bytes: long + :ivar cache_hit_bytes_percent: Percentage of total bytes (hit + miss) that + were served from the local server + :vartype cache_hit_bytes_percent: int + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'cache_hit_bytes': {'readonly': True, 'minimum': 0}, + 'cache_miss_bytes': {'readonly': True, 'minimum': 0}, + 'cache_hit_bytes_percent': {'readonly': True, 'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'cache_hit_bytes': {'key': 'cacheHitBytes', 'type': 'long'}, + 'cache_miss_bytes': {'key': 'cacheMissBytes', 'type': 'long'}, + 'cache_hit_bytes_percent': {'key': 'cacheHitBytesPercent', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(CloudTieringCachePerformance, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.cache_hit_bytes = None + self.cache_miss_bytes = None + self.cache_hit_bytes_percent = None + + +class CloudTieringDatePolicyStatus(Model): + """Status of the date policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_updated_timestamp: Last updated timestamp + :vartype last_updated_timestamp: datetime + :ivar tiered_files_most_recent_access_timestamp: Most recent access time + of tiered files + :vartype tiered_files_most_recent_access_timestamp: datetime + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'tiered_files_most_recent_access_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'tiered_files_most_recent_access_timestamp': {'key': 'tieredFilesMostRecentAccessTimestamp', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(CloudTieringDatePolicyStatus, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.tiered_files_most_recent_access_timestamp = None + + +class CloudTieringFilesNotTiering(Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_updated_timestamp: Last updated timestamp + :vartype last_updated_timestamp: datetime + :ivar total_file_count: Last cloud tiering result (HResult) + :vartype total_file_count: long + :ivar errors: Array of tiering errors + :vartype errors: list[~azure.mgmt.storagesync.models.FilesNotTieringError] + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'total_file_count': {'readonly': True, 'minimum': 0}, + 'errors': {'readonly': True}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'total_file_count': {'key': 'totalFileCount', 'type': 'long'}, + 'errors': {'key': 'errors', 'type': '[FilesNotTieringError]'}, + } + + def __init__(self, **kwargs): + super(CloudTieringFilesNotTiering, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.total_file_count = None + self.errors = None + + +class CloudTieringSpaceSavings(Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_updated_timestamp: Last updated timestamp + :vartype last_updated_timestamp: datetime + :ivar volume_size_bytes: Volume size + :vartype volume_size_bytes: long + :ivar total_size_cloud_bytes: Total size of content in the azure file + share + :vartype total_size_cloud_bytes: long + :ivar cached_size_bytes: Cached content size on the server + :vartype cached_size_bytes: long + :ivar space_savings_percent: Percentage of cached size over total size + :vartype space_savings_percent: int + :ivar space_savings_bytes: Count of bytes saved on the server + :vartype space_savings_bytes: long + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'volume_size_bytes': {'readonly': True, 'minimum': 0}, + 'total_size_cloud_bytes': {'readonly': True, 'minimum': 0}, + 'cached_size_bytes': {'readonly': True, 'minimum': 0}, + 'space_savings_percent': {'readonly': True, 'maximum': 100, 'minimum': 0}, + 'space_savings_bytes': {'readonly': True, 'minimum': 0}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'volume_size_bytes': {'key': 'volumeSizeBytes', 'type': 'long'}, + 'total_size_cloud_bytes': {'key': 'totalSizeCloudBytes', 'type': 'long'}, + 'cached_size_bytes': {'key': 'cachedSizeBytes', 'type': 'long'}, + 'space_savings_percent': {'key': 'spaceSavingsPercent', 'type': 'int'}, + 'space_savings_bytes': {'key': 'spaceSavingsBytes', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(CloudTieringSpaceSavings, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.volume_size_bytes = None + self.total_size_cloud_bytes = None + self.cached_size_bytes = None + self.space_savings_percent = None + self.space_savings_bytes = None + + +class CloudTieringVolumeFreeSpacePolicyStatus(Model): + """Status of the volume free space policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_updated_timestamp: Last updated timestamp + :vartype last_updated_timestamp: datetime + :ivar effective_volume_free_space_policy: In the case where multiple + server endpoints are present in a volume, an effective free space policy + is applied. + :vartype effective_volume_free_space_policy: int + :ivar current_volume_free_space_percent: Current volume free space + percentage. + :vartype current_volume_free_space_percent: int + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'effective_volume_free_space_policy': {'readonly': True, 'maximum': 100, 'minimum': 0}, + 'current_volume_free_space_percent': {'readonly': True, 'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'effective_volume_free_space_policy': {'key': 'effectiveVolumeFreeSpacePolicy', 'type': 'int'}, + 'current_volume_free_space_percent': {'key': 'currentVolumeFreeSpacePercent', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(CloudTieringVolumeFreeSpacePolicyStatus, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.effective_volume_free_space_policy = None + self.current_volume_free_space_percent = None + + +class FilesNotTieringError(Model): + """Files not tiering error object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error_code: Error code (HResult) + :vartype error_code: int + :ivar file_count: Count of files with this error + :vartype file_count: long + """ + + _validation = { + 'error_code': {'readonly': True}, + 'file_count': {'readonly': True, 'minimum': 0}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'file_count': {'key': 'fileCount', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(FilesNotTieringError, self).__init__(**kwargs) + self.error_code = None + self.file_count = None + + class OperationDisplayInfo(Model): """The operation supported by storage sync. @@ -577,6 +792,174 @@ def __init__(self, **kwargs): self.pause_wait_for_sync_drain_time_period_in_seconds = kwargs.get('pause_wait_for_sync_drain_time_period_in_seconds', None) +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.storagesync.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.storagesync.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.storagesync.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS + zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class PrivateLinkResourceListResult(Model): + """A list of private link resources. + + :param value: Array of private link resources + :type value: list[~azure.mgmt.storagesync.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.storagesync.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param action_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type action_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.action_required = kwargs.get('action_required', None) + + class RecallActionParameters(Model): """The parameters used when calling recall action on server endpoint. @@ -648,6 +1031,8 @@ class RegisteredServer(ProxyResource): :type friendly_name: str :param management_endpoint_uri: Management Endpoint Uri :type management_endpoint_uri: str + :param monitoring_endpoint_uri: Telemetry Endpoint Uri + :type monitoring_endpoint_uri: str :param monitoring_configuration: Monitoring Configuration :type monitoring_configuration: str """ @@ -680,6 +1065,7 @@ class RegisteredServer(ProxyResource): 'service_location': {'key': 'properties.serviceLocation', 'type': 'str'}, 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, 'management_endpoint_uri': {'key': 'properties.managementEndpointUri', 'type': 'str'}, + 'monitoring_endpoint_uri': {'key': 'properties.monitoringEndpointUri', 'type': 'str'}, 'monitoring_configuration': {'key': 'properties.monitoringConfiguration', 'type': 'str'}, } @@ -703,6 +1089,7 @@ def __init__(self, **kwargs): self.service_location = kwargs.get('service_location', None) self.friendly_name = kwargs.get('friendly_name', None) self.management_endpoint_uri = kwargs.get('management_endpoint_uri', None) + self.monitoring_endpoint_uri = kwargs.get('monitoring_endpoint_uri', None) self.monitoring_configuration = kwargs.get('monitoring_configuration', None) @@ -831,7 +1218,7 @@ class ServerEndpoint(ProxyResource): :param server_local_path: Server Local path. :type server_local_path: str :param cloud_tiering: Cloud Tiering. Possible values include: 'on', 'off' - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.enum + :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it is enabled. :type volume_free_space_percent: int @@ -852,7 +1239,8 @@ class ServerEndpoint(ProxyResource): ~azure.mgmt.storagesync.models.ServerEndpointSyncStatus :param offline_data_transfer: Offline data transfer. Possible values include: 'on', 'off' - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum + :type offline_data_transfer: str or + ~azure.mgmt.storagesync.models.FeatureStatus :ivar offline_data_transfer_storage_account_resource_id: Offline data transfer storage account resource ID :vartype offline_data_transfer_storage_account_resource_id: str @@ -869,6 +1257,17 @@ class ServerEndpoint(ProxyResource): enabled. :vartype recall_status: ~azure.mgmt.storagesync.models.ServerEndpointRecallStatus + :param initial_download_policy: Policy for how namespace and files are + recalled during FastDr. Possible values include: 'NamespaceOnly', + 'NamespaceThenModifiedFiles', 'AvoidTieredFiles' + :type initial_download_policy: str or + ~azure.mgmt.storagesync.models.InitialDownloadPolicy + :param local_cache_mode: Policy for enabling follow-the-sun business + models: link local cache to cloud behavior to pre-populate before local + access. Possible values include: 'DownloadNewAndModifiedFiles', + 'UpdateLocallyCachedFiles' + :type local_cache_mode: str or + ~azure.mgmt.storagesync.models.LocalCacheMode """ _validation = { @@ -907,6 +1306,8 @@ class ServerEndpoint(ProxyResource): 'offline_data_transfer_share_name': {'key': 'properties.offlineDataTransferShareName', 'type': 'str'}, 'cloud_tiering_status': {'key': 'properties.cloudTieringStatus', 'type': 'ServerEndpointCloudTieringStatus'}, 'recall_status': {'key': 'properties.recallStatus', 'type': 'ServerEndpointRecallStatus'}, + 'initial_download_policy': {'key': 'properties.initialDownloadPolicy', 'type': 'InitialDownloadPolicy'}, + 'local_cache_mode': {'key': 'properties.localCacheMode', 'type': 'LocalCacheMode'}, } def __init__(self, **kwargs): @@ -927,6 +1328,8 @@ def __init__(self, **kwargs): self.offline_data_transfer_share_name = kwargs.get('offline_data_transfer_share_name', None) self.cloud_tiering_status = None self.recall_status = None + self.initial_download_policy = kwargs.get('initial_download_policy', None) + self.local_cache_mode = kwargs.get('local_cache_mode', None) class ServerEndpointCloudTieringStatus(Model): @@ -935,37 +1338,78 @@ class ServerEndpointCloudTieringStatus(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar health: Cloud tiering health state. Possible values include: - 'Healthy', 'Error' - :vartype health: str or ~azure.mgmt.storagesync.models.enum :ivar last_updated_timestamp: Last updated timestamp :vartype last_updated_timestamp: datetime + :ivar health: Cloud tiering health state. Possible values include: + 'Healthy', 'Error' + :vartype health: str or + ~azure.mgmt.storagesync.models.ServerEndpointCloudTieringHealthState + :ivar health_last_updated_timestamp: The last updated timestamp of health + state + :vartype health_last_updated_timestamp: datetime :ivar last_cloud_tiering_result: Last cloud tiering result (HResult) :vartype last_cloud_tiering_result: int :ivar last_success_timestamp: Last cloud tiering success timestamp :vartype last_success_timestamp: datetime + :ivar space_savings: Information regarding how much local space cloud + tiering is saving. + :vartype space_savings: + ~azure.mgmt.storagesync.models.CloudTieringSpaceSavings + :ivar cache_performance: Information regarding how well the local cache on + the server is performing. + :vartype cache_performance: + ~azure.mgmt.storagesync.models.CloudTieringCachePerformance + :ivar files_not_tiering: Information regarding files that failed to be + tiered + :vartype files_not_tiering: + ~azure.mgmt.storagesync.models.CloudTieringFilesNotTiering + :ivar volume_free_space_policy_status: Status of the volume free space + policy + :vartype volume_free_space_policy_status: + ~azure.mgmt.storagesync.models.CloudTieringVolumeFreeSpacePolicyStatus + :ivar date_policy_status: Status of the date policy + :vartype date_policy_status: + ~azure.mgmt.storagesync.models.CloudTieringDatePolicyStatus """ _validation = { - 'health': {'readonly': True}, 'last_updated_timestamp': {'readonly': True}, + 'health': {'readonly': True}, + 'health_last_updated_timestamp': {'readonly': True}, 'last_cloud_tiering_result': {'readonly': True}, 'last_success_timestamp': {'readonly': True}, + 'space_savings': {'readonly': True}, + 'cache_performance': {'readonly': True}, + 'files_not_tiering': {'readonly': True}, + 'volume_free_space_policy_status': {'readonly': True}, + 'date_policy_status': {'readonly': True}, } _attribute_map = { - 'health': {'key': 'health', 'type': 'str'}, 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'health': {'key': 'health', 'type': 'str'}, + 'health_last_updated_timestamp': {'key': 'healthLastUpdatedTimestamp', 'type': 'iso-8601'}, 'last_cloud_tiering_result': {'key': 'lastCloudTieringResult', 'type': 'int'}, 'last_success_timestamp': {'key': 'lastSuccessTimestamp', 'type': 'iso-8601'}, + 'space_savings': {'key': 'spaceSavings', 'type': 'CloudTieringSpaceSavings'}, + 'cache_performance': {'key': 'cachePerformance', 'type': 'CloudTieringCachePerformance'}, + 'files_not_tiering': {'key': 'filesNotTiering', 'type': 'CloudTieringFilesNotTiering'}, + 'volume_free_space_policy_status': {'key': 'volumeFreeSpacePolicyStatus', 'type': 'CloudTieringVolumeFreeSpacePolicyStatus'}, + 'date_policy_status': {'key': 'datePolicyStatus', 'type': 'CloudTieringDatePolicyStatus'}, } def __init__(self, **kwargs): super(ServerEndpointCloudTieringStatus, self).__init__(**kwargs) - self.health = None self.last_updated_timestamp = None + self.health = None + self.health_last_updated_timestamp = None self.last_cloud_tiering_result = None self.last_success_timestamp = None + self.space_savings = None + self.cache_performance = None + self.files_not_tiering = None + self.volume_free_space_policy_status = None + self.date_policy_status = None class ServerEndpointCreateParameters(ProxyResource): @@ -985,7 +1429,7 @@ class ServerEndpointCreateParameters(ProxyResource): :param server_local_path: Server Local path. :type server_local_path: str :param cloud_tiering: Cloud Tiering. Possible values include: 'on', 'off' - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.enum + :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it is enabled. :type volume_free_space_percent: int @@ -997,9 +1441,21 @@ class ServerEndpointCreateParameters(ProxyResource): :type server_resource_id: str :param offline_data_transfer: Offline data transfer. Possible values include: 'on', 'off' - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum + :type offline_data_transfer: str or + ~azure.mgmt.storagesync.models.FeatureStatus :param offline_data_transfer_share_name: Offline data transfer share name :type offline_data_transfer_share_name: str + :param initial_download_policy: Policy for how namespace and files are + recalled during FastDr. Possible values include: 'NamespaceOnly', + 'NamespaceThenModifiedFiles', 'AvoidTieredFiles' + :type initial_download_policy: str or + ~azure.mgmt.storagesync.models.InitialDownloadPolicy + :param local_cache_mode: Policy for enabling follow-the-sun business + models: link local cache to cloud behavior to pre-populate before local + access. Possible values include: 'DownloadNewAndModifiedFiles', + 'UpdateLocallyCachedFiles' + :type local_cache_mode: str or + ~azure.mgmt.storagesync.models.LocalCacheMode """ _validation = { @@ -1022,6 +1478,8 @@ class ServerEndpointCreateParameters(ProxyResource): 'server_resource_id': {'key': 'properties.serverResourceId', 'type': 'str'}, 'offline_data_transfer': {'key': 'properties.offlineDataTransfer', 'type': 'str'}, 'offline_data_transfer_share_name': {'key': 'properties.offlineDataTransferShareName', 'type': 'str'}, + 'initial_download_policy': {'key': 'properties.initialDownloadPolicy', 'type': 'InitialDownloadPolicy'}, + 'local_cache_mode': {'key': 'properties.localCacheMode', 'type': 'LocalCacheMode'}, } def __init__(self, **kwargs): @@ -1034,6 +1492,8 @@ def __init__(self, **kwargs): self.server_resource_id = kwargs.get('server_resource_id', None) self.offline_data_transfer = kwargs.get('offline_data_transfer', None) self.offline_data_transfer_share_name = kwargs.get('offline_data_transfer_share_name', None) + self.initial_download_policy = kwargs.get('initial_download_policy', None) + self.local_cache_mode = kwargs.get('local_cache_mode', None) class ServerEndpointFilesNotSyncingError(Model): @@ -1247,18 +1707,22 @@ class ServerEndpointSyncStatus(Model): :ivar download_health: Download Health Status. Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' - :vartype download_health: str or ~azure.mgmt.storagesync.models.enum + :vartype download_health: str or + ~azure.mgmt.storagesync.models.ServerEndpointSyncHealthState :ivar upload_health: Upload Health Status. Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' - :vartype upload_health: str or ~azure.mgmt.storagesync.models.enum + :vartype upload_health: str or + ~azure.mgmt.storagesync.models.ServerEndpointSyncHealthState :ivar combined_health: Combined Health Status. Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' - :vartype combined_health: str or ~azure.mgmt.storagesync.models.enum + :vartype combined_health: str or + ~azure.mgmt.storagesync.models.ServerEndpointSyncHealthState :ivar sync_activity: Sync activity. Possible values include: 'Upload', 'Download', 'UploadAndDownload' - :vartype sync_activity: str or ~azure.mgmt.storagesync.models.enum + :vartype sync_activity: str or + ~azure.mgmt.storagesync.models.ServerEndpointSyncActivityState :ivar total_persistent_files_not_syncing_count: Total count of persistent files not syncing (combined upload + download). :vartype total_persistent_files_not_syncing_count: long @@ -1279,7 +1743,7 @@ class ServerEndpointSyncStatus(Model): :ivar offline_data_transfer_status: Offline Data Transfer State. Possible values include: 'InProgress', 'Stopping', 'NotRunning', 'Complete' :vartype offline_data_transfer_status: str or - ~azure.mgmt.storagesync.models.enum + ~azure.mgmt.storagesync.models.ServerEndpointOfflineDataTransferState """ _validation = { @@ -1329,7 +1793,7 @@ class ServerEndpointUpdateParameters(Model): """Parameters for updating an Server Endpoint. :param cloud_tiering: Cloud Tiering. Possible values include: 'on', 'off' - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.enum + :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it is enabled. :type volume_free_space_percent: int @@ -1337,9 +1801,16 @@ class ServerEndpointUpdateParameters(Model): :type tier_files_older_than_days: int :param offline_data_transfer: Offline data transfer. Possible values include: 'on', 'off' - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum + :type offline_data_transfer: str or + ~azure.mgmt.storagesync.models.FeatureStatus :param offline_data_transfer_share_name: Offline data transfer share name :type offline_data_transfer_share_name: str + :param local_cache_mode: Policy for enabling follow-the-sun business + models: link local cache to cloud behavior to pre-populate before local + access. Possible values include: 'DownloadNewAndModifiedFiles', + 'UpdateLocallyCachedFiles' + :type local_cache_mode: str or + ~azure.mgmt.storagesync.models.LocalCacheMode """ _validation = { @@ -1353,6 +1824,7 @@ class ServerEndpointUpdateParameters(Model): 'tier_files_older_than_days': {'key': 'properties.tierFilesOlderThanDays', 'type': 'int'}, 'offline_data_transfer': {'key': 'properties.offlineDataTransfer', 'type': 'str'}, 'offline_data_transfer_share_name': {'key': 'properties.offlineDataTransferShareName', 'type': 'str'}, + 'local_cache_mode': {'key': 'properties.localCacheMode', 'type': 'LocalCacheMode'}, } def __init__(self, **kwargs): @@ -1362,6 +1834,7 @@ def __init__(self, **kwargs): self.tier_files_older_than_days = kwargs.get('tier_files_older_than_days', None) self.offline_data_transfer = kwargs.get('offline_data_transfer', None) self.offline_data_transfer_share_name = kwargs.get('offline_data_transfer_share_name', None) + self.local_cache_mode = kwargs.get('local_cache_mode', None) class StorageSyncApiError(Model): @@ -1511,10 +1984,24 @@ class StorageSyncService(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives :type location: str + :param incoming_traffic_policy: Incoming Traffic Policy. Possible values + include: 'AllowAllTraffic', 'AllowVirtualNetworksOnly' + :type incoming_traffic_policy: str or + ~azure.mgmt.storagesync.models.IncomingTrafficPolicy :ivar storage_sync_service_status: Storage Sync service status. :vartype storage_sync_service_status: int :ivar storage_sync_service_uid: Storage Sync service Uid :vartype storage_sync_service_uid: str + :ivar provisioning_state: StorageSyncService Provisioning State + :vartype provisioning_state: str + :ivar last_workflow_id: StorageSyncService lastWorkflowId + :vartype last_workflow_id: str + :ivar last_operation_name: Resource Last Operation Name + :vartype last_operation_name: str + :ivar private_endpoint_connections: List of private endpoint connection + associated with the specified storage sync service + :vartype private_endpoint_connections: + list[~azure.mgmt.storagesync.models.PrivateEndpointConnection] """ _validation = { @@ -1524,6 +2011,10 @@ class StorageSyncService(TrackedResource): 'location': {'required': True}, 'storage_sync_service_status': {'readonly': True}, 'storage_sync_service_uid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'last_workflow_id': {'readonly': True}, + 'last_operation_name': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1532,14 +2023,24 @@ class StorageSyncService(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, + 'incoming_traffic_policy': {'key': 'properties.incomingTrafficPolicy', 'type': 'str'}, 'storage_sync_service_status': {'key': 'properties.storageSyncServiceStatus', 'type': 'int'}, 'storage_sync_service_uid': {'key': 'properties.storageSyncServiceUid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'last_workflow_id': {'key': 'properties.lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'properties.lastOperationName', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__(self, **kwargs): super(StorageSyncService, self).__init__(**kwargs) + self.incoming_traffic_policy = kwargs.get('incoming_traffic_policy', None) self.storage_sync_service_status = None self.storage_sync_service_uid = None + self.provisioning_state = None + self.last_workflow_id = None + self.last_operation_name = None + self.private_endpoint_connections = None class StorageSyncServiceCreateParameters(Model): @@ -1559,8 +2060,10 @@ class StorageSyncServiceCreateParameters(Model): resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. :type tags: dict[str, str] - :param properties: - :type properties: object + :param incoming_traffic_policy: Incoming Traffic Policy. Possible values + include: 'AllowAllTraffic', 'AllowVirtualNetworksOnly' + :type incoming_traffic_policy: str or + ~azure.mgmt.storagesync.models.IncomingTrafficPolicy """ _validation = { @@ -1570,14 +2073,14 @@ class StorageSyncServiceCreateParameters(Model): _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'incoming_traffic_policy': {'key': 'properties.incomingTrafficPolicy', 'type': 'str'}, } def __init__(self, **kwargs): super(StorageSyncServiceCreateParameters, self).__init__(**kwargs) self.location = kwargs.get('location', None) self.tags = kwargs.get('tags', None) - self.properties = kwargs.get('properties', None) + self.incoming_traffic_policy = kwargs.get('incoming_traffic_policy', None) class StorageSyncServiceUpdateParameters(Model): @@ -1586,19 +2089,21 @@ class StorageSyncServiceUpdateParameters(Model): :param tags: The user-specified tags associated with the storage sync service. :type tags: dict[str, str] - :param properties: The properties of the storage sync service. - :type properties: object + :param incoming_traffic_policy: Incoming Traffic Policy. Possible values + include: 'AllowAllTraffic', 'AllowVirtualNetworksOnly' + :type incoming_traffic_policy: str or + ~azure.mgmt.storagesync.models.IncomingTrafficPolicy """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'incoming_traffic_policy': {'key': 'properties.incomingTrafficPolicy', 'type': 'str'}, } def __init__(self, **kwargs): super(StorageSyncServiceUpdateParameters, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) - self.properties = kwargs.get('properties', None) + self.incoming_traffic_policy = kwargs.get('incoming_traffic_policy', None) class SubscriptionState(Model): @@ -1775,10 +2280,10 @@ class Workflow(ProxyResource): :type last_step_name: str :param status: workflow status. Possible values include: 'active', 'expired', 'succeeded', 'aborted', 'failed' - :type status: str or ~azure.mgmt.storagesync.models.enum + :type status: str or ~azure.mgmt.storagesync.models.WorkflowStatus :param operation: operation direction. Possible values include: 'do', 'undo', 'cancel' - :type operation: str or ~azure.mgmt.storagesync.models.enum + :type operation: str or ~azure.mgmt.storagesync.models.OperationDirection :param steps: workflow steps :type steps: str :param last_operation_id: workflow last operation identifier. diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_models_py3.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_models_py3.py index 46c1bca387b7..e06bd3617669 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_models_py3.py @@ -332,6 +332,221 @@ class CloudError(Model): } +class CloudTieringCachePerformance(Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_updated_timestamp: Last updated timestamp + :vartype last_updated_timestamp: datetime + :ivar cache_hit_bytes: Count of bytes that were served from the local + server + :vartype cache_hit_bytes: long + :ivar cache_miss_bytes: Count of bytes that were served from the cloud + :vartype cache_miss_bytes: long + :ivar cache_hit_bytes_percent: Percentage of total bytes (hit + miss) that + were served from the local server + :vartype cache_hit_bytes_percent: int + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'cache_hit_bytes': {'readonly': True, 'minimum': 0}, + 'cache_miss_bytes': {'readonly': True, 'minimum': 0}, + 'cache_hit_bytes_percent': {'readonly': True, 'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'cache_hit_bytes': {'key': 'cacheHitBytes', 'type': 'long'}, + 'cache_miss_bytes': {'key': 'cacheMissBytes', 'type': 'long'}, + 'cache_hit_bytes_percent': {'key': 'cacheHitBytesPercent', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(CloudTieringCachePerformance, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.cache_hit_bytes = None + self.cache_miss_bytes = None + self.cache_hit_bytes_percent = None + + +class CloudTieringDatePolicyStatus(Model): + """Status of the date policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_updated_timestamp: Last updated timestamp + :vartype last_updated_timestamp: datetime + :ivar tiered_files_most_recent_access_timestamp: Most recent access time + of tiered files + :vartype tiered_files_most_recent_access_timestamp: datetime + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'tiered_files_most_recent_access_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'tiered_files_most_recent_access_timestamp': {'key': 'tieredFilesMostRecentAccessTimestamp', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(CloudTieringDatePolicyStatus, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.tiered_files_most_recent_access_timestamp = None + + +class CloudTieringFilesNotTiering(Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_updated_timestamp: Last updated timestamp + :vartype last_updated_timestamp: datetime + :ivar total_file_count: Last cloud tiering result (HResult) + :vartype total_file_count: long + :ivar errors: Array of tiering errors + :vartype errors: list[~azure.mgmt.storagesync.models.FilesNotTieringError] + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'total_file_count': {'readonly': True, 'minimum': 0}, + 'errors': {'readonly': True}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'total_file_count': {'key': 'totalFileCount', 'type': 'long'}, + 'errors': {'key': 'errors', 'type': '[FilesNotTieringError]'}, + } + + def __init__(self, **kwargs) -> None: + super(CloudTieringFilesNotTiering, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.total_file_count = None + self.errors = None + + +class CloudTieringSpaceSavings(Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_updated_timestamp: Last updated timestamp + :vartype last_updated_timestamp: datetime + :ivar volume_size_bytes: Volume size + :vartype volume_size_bytes: long + :ivar total_size_cloud_bytes: Total size of content in the azure file + share + :vartype total_size_cloud_bytes: long + :ivar cached_size_bytes: Cached content size on the server + :vartype cached_size_bytes: long + :ivar space_savings_percent: Percentage of cached size over total size + :vartype space_savings_percent: int + :ivar space_savings_bytes: Count of bytes saved on the server + :vartype space_savings_bytes: long + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'volume_size_bytes': {'readonly': True, 'minimum': 0}, + 'total_size_cloud_bytes': {'readonly': True, 'minimum': 0}, + 'cached_size_bytes': {'readonly': True, 'minimum': 0}, + 'space_savings_percent': {'readonly': True, 'maximum': 100, 'minimum': 0}, + 'space_savings_bytes': {'readonly': True, 'minimum': 0}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'volume_size_bytes': {'key': 'volumeSizeBytes', 'type': 'long'}, + 'total_size_cloud_bytes': {'key': 'totalSizeCloudBytes', 'type': 'long'}, + 'cached_size_bytes': {'key': 'cachedSizeBytes', 'type': 'long'}, + 'space_savings_percent': {'key': 'spaceSavingsPercent', 'type': 'int'}, + 'space_savings_bytes': {'key': 'spaceSavingsBytes', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(CloudTieringSpaceSavings, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.volume_size_bytes = None + self.total_size_cloud_bytes = None + self.cached_size_bytes = None + self.space_savings_percent = None + self.space_savings_bytes = None + + +class CloudTieringVolumeFreeSpacePolicyStatus(Model): + """Status of the volume free space policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_updated_timestamp: Last updated timestamp + :vartype last_updated_timestamp: datetime + :ivar effective_volume_free_space_policy: In the case where multiple + server endpoints are present in a volume, an effective free space policy + is applied. + :vartype effective_volume_free_space_policy: int + :ivar current_volume_free_space_percent: Current volume free space + percentage. + :vartype current_volume_free_space_percent: int + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'effective_volume_free_space_policy': {'readonly': True, 'maximum': 100, 'minimum': 0}, + 'current_volume_free_space_percent': {'readonly': True, 'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'effective_volume_free_space_policy': {'key': 'effectiveVolumeFreeSpacePolicy', 'type': 'int'}, + 'current_volume_free_space_percent': {'key': 'currentVolumeFreeSpacePercent', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(CloudTieringVolumeFreeSpacePolicyStatus, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.effective_volume_free_space_policy = None + self.current_volume_free_space_percent = None + + +class FilesNotTieringError(Model): + """Files not tiering error object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error_code: Error code (HResult) + :vartype error_code: int + :ivar file_count: Count of files with this error + :vartype file_count: long + """ + + _validation = { + 'error_code': {'readonly': True}, + 'file_count': {'readonly': True, 'minimum': 0}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'file_count': {'key': 'fileCount', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(FilesNotTieringError, self).__init__(**kwargs) + self.error_code = None + self.file_count = None + + class OperationDisplayInfo(Model): """The operation supported by storage sync. @@ -577,6 +792,174 @@ def __init__(self, *, partition: str=None, replica_group: str=None, request_id: self.pause_wait_for_sync_drain_time_period_in_seconds = pause_wait_for_sync_drain_time_period_in_seconds +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.storagesync.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.storagesync.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.storagesync.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, private_link_service_connection_state, private_endpoint=None, provisioning_state=None, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = provisioning_state + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS + zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, *, required_zone_names=None, **kwargs) -> None: + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class PrivateLinkResourceListResult(Model): + """A list of private link resources. + + :param value: Array of private link resources + :type value: list[~azure.mgmt.storagesync.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.storagesync.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param action_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type action_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__(self, *, status=None, description: str=None, action_required: str=None, **kwargs) -> None: + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.action_required = action_required + + class RecallActionParameters(Model): """The parameters used when calling recall action on server endpoint. @@ -648,6 +1031,8 @@ class RegisteredServer(ProxyResource): :type friendly_name: str :param management_endpoint_uri: Management Endpoint Uri :type management_endpoint_uri: str + :param monitoring_endpoint_uri: Telemetry Endpoint Uri + :type monitoring_endpoint_uri: str :param monitoring_configuration: Monitoring Configuration :type monitoring_configuration: str """ @@ -680,10 +1065,11 @@ class RegisteredServer(ProxyResource): 'service_location': {'key': 'properties.serviceLocation', 'type': 'str'}, 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, 'management_endpoint_uri': {'key': 'properties.managementEndpointUri', 'type': 'str'}, + 'monitoring_endpoint_uri': {'key': 'properties.monitoringEndpointUri', 'type': 'str'}, 'monitoring_configuration': {'key': 'properties.monitoringConfiguration', 'type': 'str'}, } - def __init__(self, *, server_certificate: str=None, agent_version: str=None, server_os_version: str=None, server_management_error_code: int=None, last_heart_beat: str=None, provisioning_state: str=None, server_role: str=None, cluster_id: str=None, cluster_name: str=None, server_id: str=None, storage_sync_service_uid: str=None, last_workflow_id: str=None, last_operation_name: str=None, discovery_endpoint_uri: str=None, resource_location: str=None, service_location: str=None, friendly_name: str=None, management_endpoint_uri: str=None, monitoring_configuration: str=None, **kwargs) -> None: + def __init__(self, *, server_certificate: str=None, agent_version: str=None, server_os_version: str=None, server_management_error_code: int=None, last_heart_beat: str=None, provisioning_state: str=None, server_role: str=None, cluster_id: str=None, cluster_name: str=None, server_id: str=None, storage_sync_service_uid: str=None, last_workflow_id: str=None, last_operation_name: str=None, discovery_endpoint_uri: str=None, resource_location: str=None, service_location: str=None, friendly_name: str=None, management_endpoint_uri: str=None, monitoring_endpoint_uri: str=None, monitoring_configuration: str=None, **kwargs) -> None: super(RegisteredServer, self).__init__(**kwargs) self.server_certificate = server_certificate self.agent_version = agent_version @@ -703,6 +1089,7 @@ def __init__(self, *, server_certificate: str=None, agent_version: str=None, ser self.service_location = service_location self.friendly_name = friendly_name self.management_endpoint_uri = management_endpoint_uri + self.monitoring_endpoint_uri = monitoring_endpoint_uri self.monitoring_configuration = monitoring_configuration @@ -831,7 +1218,7 @@ class ServerEndpoint(ProxyResource): :param server_local_path: Server Local path. :type server_local_path: str :param cloud_tiering: Cloud Tiering. Possible values include: 'on', 'off' - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.enum + :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it is enabled. :type volume_free_space_percent: int @@ -852,7 +1239,8 @@ class ServerEndpoint(ProxyResource): ~azure.mgmt.storagesync.models.ServerEndpointSyncStatus :param offline_data_transfer: Offline data transfer. Possible values include: 'on', 'off' - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum + :type offline_data_transfer: str or + ~azure.mgmt.storagesync.models.FeatureStatus :ivar offline_data_transfer_storage_account_resource_id: Offline data transfer storage account resource ID :vartype offline_data_transfer_storage_account_resource_id: str @@ -869,6 +1257,17 @@ class ServerEndpoint(ProxyResource): enabled. :vartype recall_status: ~azure.mgmt.storagesync.models.ServerEndpointRecallStatus + :param initial_download_policy: Policy for how namespace and files are + recalled during FastDr. Possible values include: 'NamespaceOnly', + 'NamespaceThenModifiedFiles', 'AvoidTieredFiles' + :type initial_download_policy: str or + ~azure.mgmt.storagesync.models.InitialDownloadPolicy + :param local_cache_mode: Policy for enabling follow-the-sun business + models: link local cache to cloud behavior to pre-populate before local + access. Possible values include: 'DownloadNewAndModifiedFiles', + 'UpdateLocallyCachedFiles' + :type local_cache_mode: str or + ~azure.mgmt.storagesync.models.LocalCacheMode """ _validation = { @@ -907,9 +1306,11 @@ class ServerEndpoint(ProxyResource): 'offline_data_transfer_share_name': {'key': 'properties.offlineDataTransferShareName', 'type': 'str'}, 'cloud_tiering_status': {'key': 'properties.cloudTieringStatus', 'type': 'ServerEndpointCloudTieringStatus'}, 'recall_status': {'key': 'properties.recallStatus', 'type': 'ServerEndpointRecallStatus'}, + 'initial_download_policy': {'key': 'properties.initialDownloadPolicy', 'type': 'InitialDownloadPolicy'}, + 'local_cache_mode': {'key': 'properties.localCacheMode', 'type': 'LocalCacheMode'}, } - def __init__(self, *, server_local_path: str=None, cloud_tiering=None, volume_free_space_percent: int=None, tier_files_older_than_days: int=None, friendly_name: str=None, server_resource_id: str=None, offline_data_transfer=None, offline_data_transfer_share_name: str=None, **kwargs) -> None: + def __init__(self, *, server_local_path: str=None, cloud_tiering=None, volume_free_space_percent: int=None, tier_files_older_than_days: int=None, friendly_name: str=None, server_resource_id: str=None, offline_data_transfer=None, offline_data_transfer_share_name: str=None, initial_download_policy=None, local_cache_mode=None, **kwargs) -> None: super(ServerEndpoint, self).__init__(**kwargs) self.server_local_path = server_local_path self.cloud_tiering = cloud_tiering @@ -927,6 +1328,8 @@ def __init__(self, *, server_local_path: str=None, cloud_tiering=None, volume_fr self.offline_data_transfer_share_name = offline_data_transfer_share_name self.cloud_tiering_status = None self.recall_status = None + self.initial_download_policy = initial_download_policy + self.local_cache_mode = local_cache_mode class ServerEndpointCloudTieringStatus(Model): @@ -935,37 +1338,78 @@ class ServerEndpointCloudTieringStatus(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar health: Cloud tiering health state. Possible values include: - 'Healthy', 'Error' - :vartype health: str or ~azure.mgmt.storagesync.models.enum :ivar last_updated_timestamp: Last updated timestamp :vartype last_updated_timestamp: datetime + :ivar health: Cloud tiering health state. Possible values include: + 'Healthy', 'Error' + :vartype health: str or + ~azure.mgmt.storagesync.models.ServerEndpointCloudTieringHealthState + :ivar health_last_updated_timestamp: The last updated timestamp of health + state + :vartype health_last_updated_timestamp: datetime :ivar last_cloud_tiering_result: Last cloud tiering result (HResult) :vartype last_cloud_tiering_result: int :ivar last_success_timestamp: Last cloud tiering success timestamp :vartype last_success_timestamp: datetime + :ivar space_savings: Information regarding how much local space cloud + tiering is saving. + :vartype space_savings: + ~azure.mgmt.storagesync.models.CloudTieringSpaceSavings + :ivar cache_performance: Information regarding how well the local cache on + the server is performing. + :vartype cache_performance: + ~azure.mgmt.storagesync.models.CloudTieringCachePerformance + :ivar files_not_tiering: Information regarding files that failed to be + tiered + :vartype files_not_tiering: + ~azure.mgmt.storagesync.models.CloudTieringFilesNotTiering + :ivar volume_free_space_policy_status: Status of the volume free space + policy + :vartype volume_free_space_policy_status: + ~azure.mgmt.storagesync.models.CloudTieringVolumeFreeSpacePolicyStatus + :ivar date_policy_status: Status of the date policy + :vartype date_policy_status: + ~azure.mgmt.storagesync.models.CloudTieringDatePolicyStatus """ _validation = { - 'health': {'readonly': True}, 'last_updated_timestamp': {'readonly': True}, + 'health': {'readonly': True}, + 'health_last_updated_timestamp': {'readonly': True}, 'last_cloud_tiering_result': {'readonly': True}, 'last_success_timestamp': {'readonly': True}, + 'space_savings': {'readonly': True}, + 'cache_performance': {'readonly': True}, + 'files_not_tiering': {'readonly': True}, + 'volume_free_space_policy_status': {'readonly': True}, + 'date_policy_status': {'readonly': True}, } _attribute_map = { - 'health': {'key': 'health', 'type': 'str'}, 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'health': {'key': 'health', 'type': 'str'}, + 'health_last_updated_timestamp': {'key': 'healthLastUpdatedTimestamp', 'type': 'iso-8601'}, 'last_cloud_tiering_result': {'key': 'lastCloudTieringResult', 'type': 'int'}, 'last_success_timestamp': {'key': 'lastSuccessTimestamp', 'type': 'iso-8601'}, + 'space_savings': {'key': 'spaceSavings', 'type': 'CloudTieringSpaceSavings'}, + 'cache_performance': {'key': 'cachePerformance', 'type': 'CloudTieringCachePerformance'}, + 'files_not_tiering': {'key': 'filesNotTiering', 'type': 'CloudTieringFilesNotTiering'}, + 'volume_free_space_policy_status': {'key': 'volumeFreeSpacePolicyStatus', 'type': 'CloudTieringVolumeFreeSpacePolicyStatus'}, + 'date_policy_status': {'key': 'datePolicyStatus', 'type': 'CloudTieringDatePolicyStatus'}, } def __init__(self, **kwargs) -> None: super(ServerEndpointCloudTieringStatus, self).__init__(**kwargs) - self.health = None self.last_updated_timestamp = None + self.health = None + self.health_last_updated_timestamp = None self.last_cloud_tiering_result = None self.last_success_timestamp = None + self.space_savings = None + self.cache_performance = None + self.files_not_tiering = None + self.volume_free_space_policy_status = None + self.date_policy_status = None class ServerEndpointCreateParameters(ProxyResource): @@ -985,7 +1429,7 @@ class ServerEndpointCreateParameters(ProxyResource): :param server_local_path: Server Local path. :type server_local_path: str :param cloud_tiering: Cloud Tiering. Possible values include: 'on', 'off' - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.enum + :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it is enabled. :type volume_free_space_percent: int @@ -997,9 +1441,21 @@ class ServerEndpointCreateParameters(ProxyResource): :type server_resource_id: str :param offline_data_transfer: Offline data transfer. Possible values include: 'on', 'off' - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum + :type offline_data_transfer: str or + ~azure.mgmt.storagesync.models.FeatureStatus :param offline_data_transfer_share_name: Offline data transfer share name :type offline_data_transfer_share_name: str + :param initial_download_policy: Policy for how namespace and files are + recalled during FastDr. Possible values include: 'NamespaceOnly', + 'NamespaceThenModifiedFiles', 'AvoidTieredFiles' + :type initial_download_policy: str or + ~azure.mgmt.storagesync.models.InitialDownloadPolicy + :param local_cache_mode: Policy for enabling follow-the-sun business + models: link local cache to cloud behavior to pre-populate before local + access. Possible values include: 'DownloadNewAndModifiedFiles', + 'UpdateLocallyCachedFiles' + :type local_cache_mode: str or + ~azure.mgmt.storagesync.models.LocalCacheMode """ _validation = { @@ -1022,9 +1478,11 @@ class ServerEndpointCreateParameters(ProxyResource): 'server_resource_id': {'key': 'properties.serverResourceId', 'type': 'str'}, 'offline_data_transfer': {'key': 'properties.offlineDataTransfer', 'type': 'str'}, 'offline_data_transfer_share_name': {'key': 'properties.offlineDataTransferShareName', 'type': 'str'}, + 'initial_download_policy': {'key': 'properties.initialDownloadPolicy', 'type': 'InitialDownloadPolicy'}, + 'local_cache_mode': {'key': 'properties.localCacheMode', 'type': 'LocalCacheMode'}, } - def __init__(self, *, server_local_path: str=None, cloud_tiering=None, volume_free_space_percent: int=None, tier_files_older_than_days: int=None, friendly_name: str=None, server_resource_id: str=None, offline_data_transfer=None, offline_data_transfer_share_name: str=None, **kwargs) -> None: + def __init__(self, *, server_local_path: str=None, cloud_tiering=None, volume_free_space_percent: int=None, tier_files_older_than_days: int=None, friendly_name: str=None, server_resource_id: str=None, offline_data_transfer=None, offline_data_transfer_share_name: str=None, initial_download_policy=None, local_cache_mode=None, **kwargs) -> None: super(ServerEndpointCreateParameters, self).__init__(**kwargs) self.server_local_path = server_local_path self.cloud_tiering = cloud_tiering @@ -1034,6 +1492,8 @@ def __init__(self, *, server_local_path: str=None, cloud_tiering=None, volume_fr self.server_resource_id = server_resource_id self.offline_data_transfer = offline_data_transfer self.offline_data_transfer_share_name = offline_data_transfer_share_name + self.initial_download_policy = initial_download_policy + self.local_cache_mode = local_cache_mode class ServerEndpointFilesNotSyncingError(Model): @@ -1247,18 +1707,22 @@ class ServerEndpointSyncStatus(Model): :ivar download_health: Download Health Status. Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' - :vartype download_health: str or ~azure.mgmt.storagesync.models.enum + :vartype download_health: str or + ~azure.mgmt.storagesync.models.ServerEndpointSyncHealthState :ivar upload_health: Upload Health Status. Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' - :vartype upload_health: str or ~azure.mgmt.storagesync.models.enum + :vartype upload_health: str or + ~azure.mgmt.storagesync.models.ServerEndpointSyncHealthState :ivar combined_health: Combined Health Status. Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' - :vartype combined_health: str or ~azure.mgmt.storagesync.models.enum + :vartype combined_health: str or + ~azure.mgmt.storagesync.models.ServerEndpointSyncHealthState :ivar sync_activity: Sync activity. Possible values include: 'Upload', 'Download', 'UploadAndDownload' - :vartype sync_activity: str or ~azure.mgmt.storagesync.models.enum + :vartype sync_activity: str or + ~azure.mgmt.storagesync.models.ServerEndpointSyncActivityState :ivar total_persistent_files_not_syncing_count: Total count of persistent files not syncing (combined upload + download). :vartype total_persistent_files_not_syncing_count: long @@ -1279,7 +1743,7 @@ class ServerEndpointSyncStatus(Model): :ivar offline_data_transfer_status: Offline Data Transfer State. Possible values include: 'InProgress', 'Stopping', 'NotRunning', 'Complete' :vartype offline_data_transfer_status: str or - ~azure.mgmt.storagesync.models.enum + ~azure.mgmt.storagesync.models.ServerEndpointOfflineDataTransferState """ _validation = { @@ -1329,7 +1793,7 @@ class ServerEndpointUpdateParameters(Model): """Parameters for updating an Server Endpoint. :param cloud_tiering: Cloud Tiering. Possible values include: 'on', 'off' - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.enum + :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it is enabled. :type volume_free_space_percent: int @@ -1337,9 +1801,16 @@ class ServerEndpointUpdateParameters(Model): :type tier_files_older_than_days: int :param offline_data_transfer: Offline data transfer. Possible values include: 'on', 'off' - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum + :type offline_data_transfer: str or + ~azure.mgmt.storagesync.models.FeatureStatus :param offline_data_transfer_share_name: Offline data transfer share name :type offline_data_transfer_share_name: str + :param local_cache_mode: Policy for enabling follow-the-sun business + models: link local cache to cloud behavior to pre-populate before local + access. Possible values include: 'DownloadNewAndModifiedFiles', + 'UpdateLocallyCachedFiles' + :type local_cache_mode: str or + ~azure.mgmt.storagesync.models.LocalCacheMode """ _validation = { @@ -1353,15 +1824,17 @@ class ServerEndpointUpdateParameters(Model): 'tier_files_older_than_days': {'key': 'properties.tierFilesOlderThanDays', 'type': 'int'}, 'offline_data_transfer': {'key': 'properties.offlineDataTransfer', 'type': 'str'}, 'offline_data_transfer_share_name': {'key': 'properties.offlineDataTransferShareName', 'type': 'str'}, + 'local_cache_mode': {'key': 'properties.localCacheMode', 'type': 'LocalCacheMode'}, } - def __init__(self, *, cloud_tiering=None, volume_free_space_percent: int=None, tier_files_older_than_days: int=None, offline_data_transfer=None, offline_data_transfer_share_name: str=None, **kwargs) -> None: + def __init__(self, *, cloud_tiering=None, volume_free_space_percent: int=None, tier_files_older_than_days: int=None, offline_data_transfer=None, offline_data_transfer_share_name: str=None, local_cache_mode=None, **kwargs) -> None: super(ServerEndpointUpdateParameters, self).__init__(**kwargs) self.cloud_tiering = cloud_tiering self.volume_free_space_percent = volume_free_space_percent self.tier_files_older_than_days = tier_files_older_than_days self.offline_data_transfer = offline_data_transfer self.offline_data_transfer_share_name = offline_data_transfer_share_name + self.local_cache_mode = local_cache_mode class StorageSyncApiError(Model): @@ -1511,10 +1984,24 @@ class StorageSyncService(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives :type location: str + :param incoming_traffic_policy: Incoming Traffic Policy. Possible values + include: 'AllowAllTraffic', 'AllowVirtualNetworksOnly' + :type incoming_traffic_policy: str or + ~azure.mgmt.storagesync.models.IncomingTrafficPolicy :ivar storage_sync_service_status: Storage Sync service status. :vartype storage_sync_service_status: int :ivar storage_sync_service_uid: Storage Sync service Uid :vartype storage_sync_service_uid: str + :ivar provisioning_state: StorageSyncService Provisioning State + :vartype provisioning_state: str + :ivar last_workflow_id: StorageSyncService lastWorkflowId + :vartype last_workflow_id: str + :ivar last_operation_name: Resource Last Operation Name + :vartype last_operation_name: str + :ivar private_endpoint_connections: List of private endpoint connection + associated with the specified storage sync service + :vartype private_endpoint_connections: + list[~azure.mgmt.storagesync.models.PrivateEndpointConnection] """ _validation = { @@ -1524,6 +2011,10 @@ class StorageSyncService(TrackedResource): 'location': {'required': True}, 'storage_sync_service_status': {'readonly': True}, 'storage_sync_service_uid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'last_workflow_id': {'readonly': True}, + 'last_operation_name': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1532,14 +2023,24 @@ class StorageSyncService(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, + 'incoming_traffic_policy': {'key': 'properties.incomingTrafficPolicy', 'type': 'str'}, 'storage_sync_service_status': {'key': 'properties.storageSyncServiceStatus', 'type': 'int'}, 'storage_sync_service_uid': {'key': 'properties.storageSyncServiceUid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'last_workflow_id': {'key': 'properties.lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'properties.lastOperationName', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, incoming_traffic_policy=None, **kwargs) -> None: super(StorageSyncService, self).__init__(tags=tags, location=location, **kwargs) + self.incoming_traffic_policy = incoming_traffic_policy self.storage_sync_service_status = None self.storage_sync_service_uid = None + self.provisioning_state = None + self.last_workflow_id = None + self.last_operation_name = None + self.private_endpoint_connections = None class StorageSyncServiceCreateParameters(Model): @@ -1559,8 +2060,10 @@ class StorageSyncServiceCreateParameters(Model): resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. :type tags: dict[str, str] - :param properties: - :type properties: object + :param incoming_traffic_policy: Incoming Traffic Policy. Possible values + include: 'AllowAllTraffic', 'AllowVirtualNetworksOnly' + :type incoming_traffic_policy: str or + ~azure.mgmt.storagesync.models.IncomingTrafficPolicy """ _validation = { @@ -1570,14 +2073,14 @@ class StorageSyncServiceCreateParameters(Model): _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'incoming_traffic_policy': {'key': 'properties.incomingTrafficPolicy', 'type': 'str'}, } - def __init__(self, *, location: str, tags=None, properties=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, incoming_traffic_policy=None, **kwargs) -> None: super(StorageSyncServiceCreateParameters, self).__init__(**kwargs) self.location = location self.tags = tags - self.properties = properties + self.incoming_traffic_policy = incoming_traffic_policy class StorageSyncServiceUpdateParameters(Model): @@ -1586,19 +2089,21 @@ class StorageSyncServiceUpdateParameters(Model): :param tags: The user-specified tags associated with the storage sync service. :type tags: dict[str, str] - :param properties: The properties of the storage sync service. - :type properties: object + :param incoming_traffic_policy: Incoming Traffic Policy. Possible values + include: 'AllowAllTraffic', 'AllowVirtualNetworksOnly' + :type incoming_traffic_policy: str or + ~azure.mgmt.storagesync.models.IncomingTrafficPolicy """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'incoming_traffic_policy': {'key': 'properties.incomingTrafficPolicy', 'type': 'str'}, } - def __init__(self, *, tags=None, properties=None, **kwargs) -> None: + def __init__(self, *, tags=None, incoming_traffic_policy=None, **kwargs) -> None: super(StorageSyncServiceUpdateParameters, self).__init__(**kwargs) self.tags = tags - self.properties = properties + self.incoming_traffic_policy = incoming_traffic_policy class SubscriptionState(Model): @@ -1775,10 +2280,10 @@ class Workflow(ProxyResource): :type last_step_name: str :param status: workflow status. Possible values include: 'active', 'expired', 'succeeded', 'aborted', 'failed' - :type status: str or ~azure.mgmt.storagesync.models.enum + :type status: str or ~azure.mgmt.storagesync.models.WorkflowStatus :param operation: operation direction. Possible values include: 'do', 'undo', 'cancel' - :type operation: str or ~azure.mgmt.storagesync.models.enum + :type operation: str or ~azure.mgmt.storagesync.models.OperationDirection :param steps: workflow steps :type steps: str :param last_operation_id: workflow last operation identifier. diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_paged_models.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_paged_models.py index 375104a5730b..9ec666f259eb 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_paged_models.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_paged_models.py @@ -38,6 +38,19 @@ class StorageSyncServicePaged(Paged): def __init__(self, *args, **kwargs): super(StorageSyncServicePaged, self).__init__(*args, **kwargs) +class PrivateEndpointConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateEndpointConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateEndpointConnection]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateEndpointConnectionPaged, self).__init__(*args, **kwargs) class SyncGroupPaged(Paged): """ A paging container for iterating over a list of :class:`SyncGroup ` object diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_storage_sync_management_client_enums.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_storage_sync_management_client_enums.py index 769a68bf9202..25d749a3e5d6 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_storage_sync_management_client_enums.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/models/_storage_sync_management_client_enums.py @@ -21,13 +21,108 @@ class Reason(str, Enum): deleted = "Deleted" +class IncomingTrafficPolicy(str, Enum): + + allow_all_traffic = "AllowAllTraffic" + allow_virtual_networks_only = "AllowVirtualNetworksOnly" + + +class PrivateEndpointServiceConnectionStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + + +class PrivateEndpointConnectionProvisioningState(str, Enum): + + succeeded = "Succeeded" + creating = "Creating" + deleting = "Deleting" + failed = "Failed" + + class ChangeDetectionMode(str, Enum): default = "Default" recursive = "Recursive" +class FeatureStatus(str, Enum): + + on = "on" + off = "off" + + +class InitialDownloadPolicy(str, Enum): + + namespace_only = "NamespaceOnly" + namespace_then_modified_files = "NamespaceThenModifiedFiles" + avoid_tiered_files = "AvoidTieredFiles" + + +class LocalCacheMode(str, Enum): + + download_new_and_modified_files = "DownloadNewAndModifiedFiles" + update_locally_cached_files = "UpdateLocallyCachedFiles" + + +class ServerEndpointSyncHealthState(str, Enum): + + healthy = "Healthy" + error = "Error" + sync_blocked_for_restore = "SyncBlockedForRestore" + sync_blocked_for_change_detection_post_restore = "SyncBlockedForChangeDetectionPostRestore" + no_activity = "NoActivity" + + +class ServerEndpointSyncActivityState(str, Enum): + + upload = "Upload" + download = "Download" + upload_and_download = "UploadAndDownload" + + +class ServerEndpointOfflineDataTransferState(str, Enum): + + in_progress = "InProgress" + stopping = "Stopping" + not_running = "NotRunning" + complete = "Complete" + + +class ServerEndpointCloudTieringHealthState(str, Enum): + + healthy = "Healthy" + error = "Error" + + +class WorkflowStatus(str, Enum): + + active = "active" + expired = "expired" + succeeded = "succeeded" + aborted = "aborted" + failed = "failed" + + +class OperationDirection(str, Enum): + + do = "do" + undo = "undo" + cancel = "cancel" + + class NameAvailabilityReason(str, Enum): invalid = "Invalid" already_exists = "AlreadyExists" + + +class ProgressType(str, Enum): + + none = "none" + initialize = "initialize" + download = "download" + upload = "upload" + recall = "recall" diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/__init__.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/__init__.py index 8d799c110446..da737f0d7213 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/__init__.py @@ -11,6 +11,8 @@ from ._operations import Operations from ._storage_sync_services_operations import StorageSyncServicesOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._sync_groups_operations import SyncGroupsOperations from ._cloud_endpoints_operations import CloudEndpointsOperations from ._server_endpoints_operations import ServerEndpointsOperations @@ -21,6 +23,8 @@ __all__ = [ 'Operations', 'StorageSyncServicesOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionsOperations', 'SyncGroupsOperations', 'CloudEndpointsOperations', 'ServerEndpointsOperations', diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_cloud_endpoints_operations.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_cloud_endpoints_operations.py index 36cb6869a698..23eb8d2f1cd8 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_cloud_endpoints_operations.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_cloud_endpoints_operations.py @@ -26,7 +26,7 @@ class CloudEndpointsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2019-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01" + self.api_version = "2020-03-01" self.config = config diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_operation_status_operations.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_operation_status_operations.py index 2e16f651314c..698c3f8f3532 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_operation_status_operations.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_operation_status_operations.py @@ -24,7 +24,7 @@ class OperationStatusOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2019-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01" + self.api_version = "2020-03-01" self.config = config diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_operations.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_operations.py index 5c5e1cda7788..470f68e51d23 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_operations.py @@ -24,7 +24,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: The API version to use for this operation. Constant value: "2019-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01" + self.api_version = "2020-03-01" self.config = config diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_private_endpoint_connections_operations.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..a934e1b112b7 --- /dev/null +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,408 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations 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: The API version to use for this operation. Constant value: "2020-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01" + + self.config = config + + def get( + self, resource_group_name, storage_sync_service_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified private endpoint connection associated with the + storage sync service. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storage_sync_service_name: The name of the storage sync service + name within the specified resource group. + :type storage_sync_service_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storagesync.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`StorageSyncErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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', min_length=1) + + # 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) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.StorageSyncErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _create_initial( + self, resource_group_name, storage_sync_service_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(properties, 'PrivateEndpointConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.StorageSyncErrorException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, storage_sync_service_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the state of specified private endpoint connection associated + with the storage sync service. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storage_sync_service_name: The name of the storage sync service + name within the specified resource group. + :type storage_sync_service_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.storagesync.models.PrivateEndpointConnection + :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 + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storagesync.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storagesync.models.PrivateEndpointConnection]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + private_endpoint_connection_name=private_endpoint_connection_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + 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) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _delete_initial( + self, resource_group_name, storage_sync_service_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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', min_length=1) + + # 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.StorageSyncErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def delete( + self, resource_group_name, storage_sync_service_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified private endpoint connection associated with the + storage sync service. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storage_sync_service_name: The name of the storage sync service + name within the specified resource group. + :type storage_sync_service_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_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:`StorageSyncErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + private_endpoint_connection_name=private_endpoint_connection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + }) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def list_by_storage_sync_service( + self, resource_group_name, storage_sync_service_name, custom_headers=None, raw=False, **operation_config): + """Get a PrivateEndpointConnection List. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storage_sync_service_name: Name of Storage Sync Service + resource. + :type storage_sync_service_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 PrivateEndpointConnection + :rtype: + ~azure.mgmt.storagesync.models.PrivateEndpointConnectionPaged[~azure.mgmt.storagesync.models.PrivateEndpointConnection] + :raises: + :class:`StorageSyncErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_storage_sync_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_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', min_length=1) + + 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]: + raise models.StorageSyncErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections'} diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_private_link_resources_operations.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..efbee299a704 --- /dev/null +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_private_link_resources_operations.py @@ -0,0 +1,105 @@ +# 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 PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations 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: The API version to use for this operation. Constant value: "2020-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01" + + self.config = config + + def list_by_storage_sync_service( + self, resource_group_name, storage_sync_service_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a storage + sync service. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storage_sync_service_name: The name of the storage sync service + name within the specified resource group. + :type storage_sync_service_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: PrivateLinkResourceListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.storagesync.models.PrivateLinkResourceListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_storage_sync_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # 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) + 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('PrivateLinkResourceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateLinkResources'} diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_registered_servers_operations.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_registered_servers_operations.py index ded9d05e5e1f..7c642ecf7be0 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_registered_servers_operations.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_registered_servers_operations.py @@ -26,7 +26,7 @@ class RegisteredServersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2019-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01" + self.api_version = "2020-03-01" self.config = config diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_server_endpoints_operations.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_server_endpoints_operations.py index 37c6a91f22e6..7ab033cc8559 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_server_endpoints_operations.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_server_endpoints_operations.py @@ -26,7 +26,7 @@ class ServerEndpointsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2019-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01" + self.api_version = "2020-03-01" self.config = config diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_storage_sync_services_operations.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_storage_sync_services_operations.py index ad424d78f42d..a152ba585d69 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_storage_sync_services_operations.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_storage_sync_services_operations.py @@ -12,6 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -25,7 +27,7 @@ class StorageSyncServicesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2019-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01". """ models = models @@ -35,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01" + self.api_version = "2020-03-01" self.config = config @@ -105,30 +107,9 @@ def check_name_availability( return deserialized check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/checkNameAvailability'} - def create( - self, resource_group_name, storage_sync_service_name, parameters, custom_headers=None, raw=False, **operation_config): - """Create a new StorageSyncService. - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param storage_sync_service_name: Name of Storage Sync Service - resource. - :type storage_sync_service_name: str - :param parameters: Storage Sync Service resource name. - :type parameters: - ~azure.mgmt.storagesync.models.StorageSyncServiceCreateParameters - :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: StorageSyncService or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storagesync.models.StorageSyncService or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`StorageSyncErrorException` - """ + def _create_initial( + self, resource_group_name, storage_sync_service_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create.metadata['url'] path_format_arguments = { @@ -160,18 +141,89 @@ def create( request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: raise models.StorageSyncErrorException(self._deserialize, response) deserialized = None + header_dict = {} + if response.status_code == 200: deserialized = self._deserialize('StorageSyncService', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } if raw: client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response return deserialized + + def create( + self, resource_group_name, storage_sync_service_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a new StorageSyncService. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storage_sync_service_name: Name of Storage Sync Service + resource. + :type storage_sync_service_name: str + :param parameters: Storage Sync Service resource name. + :type parameters: + ~azure.mgmt.storagesync.models.StorageSyncServiceCreateParameters + :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 StorageSyncService or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storagesync.models.StorageSyncService] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storagesync.models.StorageSyncService]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + deserialized = self._deserialize('StorageSyncService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + 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) create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} def get( @@ -242,35 +294,12 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} - def update( - self, resource_group_name, storage_sync_service_name, tags=None, properties=None, custom_headers=None, raw=False, **operation_config): - """Patch a given StorageSyncService. - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param storage_sync_service_name: Name of Storage Sync Service - resource. - :type storage_sync_service_name: str - :param tags: The user-specified tags associated with the storage sync - service. - :type tags: dict[str, str] - :param properties: The properties of the storage sync service. - :type properties: object - :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: StorageSyncService or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storagesync.models.StorageSyncService or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`StorageSyncErrorException` - """ + def _update_initial( + self, resource_group_name, storage_sync_service_name, tags=None, incoming_traffic_policy=None, custom_headers=None, raw=False, **operation_config): parameters = None - if tags is not None or properties is not None: - parameters = models.StorageSyncServiceUpdateParameters(tags=tags, properties=properties) + if tags is not None or incoming_traffic_policy is not None: + parameters = models.StorageSyncServiceUpdateParameters(tags=tags, incoming_traffic_policy=incoming_traffic_policy) # Construct URL url = self.update.metadata['url'] @@ -306,16 +335,20 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: raise models.StorageSyncErrorException(self._deserialize, response) - header_dict = {} deserialized = None + header_dict = {} + if response.status_code == 200: deserialized = self._deserialize('StorageSyncService', response) header_dict = { 'x-ms-request-id': 'str', 'x-ms-correlation-request-id': 'str', + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', } if raw: @@ -324,11 +357,10 @@ def update( return client_raw_response return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} - def delete( - self, resource_group_name, storage_sync_service_name, custom_headers=None, raw=False, **operation_config): - """Delete a given StorageSyncService. + def update( + self, resource_group_name, storage_sync_service_name, tags=None, incoming_traffic_policy=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Patch a given StorageSyncService. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -336,16 +368,66 @@ def delete( :param storage_sync_service_name: Name of Storage Sync Service resource. :type storage_sync_service_name: str + :param tags: The user-specified tags associated with the storage sync + service. + :type tags: dict[str, str] + :param incoming_traffic_policy: Incoming Traffic Policy. Possible + values include: 'AllowAllTraffic', 'AllowVirtualNetworksOnly' + :type incoming_traffic_policy: str or + ~azure.mgmt.storagesync.models.IncomingTrafficPolicy :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 StorageSyncService or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storagesync.models.StorageSyncService] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storagesync.models.StorageSyncService]] :raises: :class:`StorageSyncErrorException` """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + tags=tags, + incoming_traffic_policy=incoming_traffic_policy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('StorageSyncService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + 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.StorageSync/storageSyncServices/{storageSyncServiceName}'} + + + def _delete_initial( + self, resource_group_name, storage_sync_service_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -372,16 +454,70 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: raise models.StorageSyncErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) - client_raw_response.add_headers({ + header_dict = { 'x-ms-request-id': 'str', 'x-ms-correlation-request-id': 'str', - }) + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', + } + client_raw_response.add_headers(header_dict) return client_raw_response + + def delete( + self, resource_group_name, storage_sync_service_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a given StorageSyncService. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storage_sync_service_name: Name of Storage Sync Service + resource. + :type storage_sync_service_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:`StorageSyncErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', + }) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} def list_by_resource_group( diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_sync_groups_operations.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_sync_groups_operations.py index 124202bd880c..56e7e9bf7914 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_sync_groups_operations.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_sync_groups_operations.py @@ -24,7 +24,7 @@ class SyncGroupsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2019-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01" + self.api_version = "2020-03-01" self.config = config diff --git a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_workflows_operations.py b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_workflows_operations.py index 990cc989b8b1..996ad3fb8cf2 100644 --- a/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_workflows_operations.py +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_workflows_operations.py @@ -24,7 +24,7 @@ class WorkflowsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2019-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01" + self.api_version = "2020-03-01" self.config = config diff --git a/sdk/storage/azure-mgmt-storagesync/setup.py b/sdk/storage/azure-mgmt-storagesync/setup.py index 475bf6e6a2dc..6e33341ad8de 100644 --- a/sdk/storage/azure-mgmt-storagesync/setup.py +++ b/sdk/storage/azure-mgmt-storagesync/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)