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..b2c9732c086e 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,12 @@ 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 PrivateEndpointConnectionItem + 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 +72,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 +85,12 @@ from ._models import PostBackupResponse from ._models import PostRestoreRequest from ._models import PreRestoreRequest + from ._models import PrivateEndpoint + from ._models import PrivateEndpointConnection + from ._models import PrivateEndpointConnectionItem + 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 +123,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,7 +131,11 @@ from ._paged_models import WorkflowPaged from ._storage_sync_management_client_enums import ( Reason, + PrivateEndpointServiceConnectionStatus, + PrivateEndpointConnectionProvisioningState, ChangeDetectionMode, + InitialDownloadPolicy, + LocalCacheMode, NameAvailabilityReason, ) @@ -117,6 +146,12 @@ 'CheckNameAvailabilityResult', 'CloudEndpoint', 'CloudEndpointCreateParameters', + 'CloudTieringCachePerformance', + 'CloudTieringDatePolicyStatus', + 'CloudTieringFilesNotTiering', + 'CloudTieringSpaceSavings', + 'CloudTieringVolumeFreeSpacePolicyStatus', + 'FilesNotTieringError', 'OperationDisplayInfo', 'OperationDisplayResource', 'OperationEntity', @@ -124,6 +159,12 @@ 'PostBackupResponse', 'PostRestoreRequest', 'PreRestoreRequest', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionItem', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', 'ProxyResource', 'RecallActionParameters', 'RegisteredServer', @@ -156,12 +197,17 @@ 'Workflow', 'OperationEntityPaged', 'StorageSyncServicePaged', + 'PrivateEndpointConnectionPaged', 'SyncGroupPaged', 'CloudEndpointPaged', 'ServerEndpointPaged', 'RegisteredServerPaged', 'WorkflowPaged', 'Reason', + 'PrivateEndpointServiceConnectionStatus', + 'PrivateEndpointConnectionProvisioningState', 'ChangeDetectionMode', + 'InitialDownloadPolicy', + 'LocalCacheMode', 'NameAvailabilityReason', ] 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..795f316c137e 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,210 @@ 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): + """Private endpoint object properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Full identifier of the private endpoint resource. + :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): + """Private endpoint connection 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 + :param private_endpoint: Properties of the private endpoint object. + :type private_endpoint: ~azure.mgmt.storagesync.models.PrivateEndpoint + :param private_link_service_connection_state: Approval state of the + private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.storagesync.models.PrivateLinkServiceConnectionState + :param provisioning_state: Provisioning state of the private endpoint + connection. Possible values include: 'Succeeded', 'Creating', 'Updating', + 'Deleting', 'Failed', 'Disconnected' + :type provisioning_state: str or + ~azure.mgmt.storagesync.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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 PrivateEndpointConnectionItem(Model): + """Private endpoint connection item. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Full identifier of the private endpoint connection. + :vartype id: str + :param private_endpoint: Properties of the private endpoint object. + :type private_endpoint: ~azure.mgmt.storagesync.models.PrivateEndpoint + :param private_link_service_connection_state: Approval state of the + private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.storagesync.models.PrivateLinkServiceConnectionState + :param provisioning_state: Provisioning state of the private endpoint + connection. Possible values include: 'Succeeded', 'Creating', 'Updating', + 'Deleting', 'Failed', 'Disconnected' + :type provisioning_state: str or + ~azure.mgmt.storagesync.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', '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(PrivateEndpointConnectionItem, self).__init__(**kwargs) + self.id = None + 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: Group identifier of private link resource. + :vartype group_id: str + :ivar required_members: Required member names of private link resource. + :vartype required_members: list[str] + :param required_zone_names: Required DNS zone names of the the private + link resource. + :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): + """An object that represents the approval state of the private link + connection. + + :param status: Indicates whether the connection has been approved, + rejected or removed by the key vault owner. Possible values include: + 'Pending', 'Approved', 'Rejected', 'Disconnected' + :type status: str or + ~azure.mgmt.storagesync.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval or rejection. + :type description: str + :param actions_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + class RecallActionParameters(Model): """The parameters used when calling recall action on server endpoint. @@ -869,6 +1288,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 +1337,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 +1359,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 +1369,77 @@ class ServerEndpointCloudTieringStatus(Model): 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 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_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): @@ -1000,6 +1474,17 @@ class ServerEndpointCreateParameters(ProxyResource): :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum :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 +1507,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 +1521,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): @@ -1340,6 +1829,12 @@ class ServerEndpointUpdateParameters(Model): :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum :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 +1848,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 +1858,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): @@ -1515,6 +2012,10 @@ class StorageSyncService(TrackedResource): :vartype storage_sync_service_status: int :ivar storage_sync_service_uid: Storage Sync service Uid :vartype storage_sync_service_uid: str + :ivar private_endpoint_connections: List of private endpoint connections + associated with the storage sync service. + :vartype private_endpoint_connections: + list[~azure.mgmt.storagesync.models.PrivateEndpointConnectionItem] """ _validation = { @@ -1524,6 +2025,7 @@ class StorageSyncService(TrackedResource): 'location': {'required': True}, 'storage_sync_service_status': {'readonly': True}, 'storage_sync_service_uid': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1534,12 +2036,14 @@ class StorageSyncService(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'storage_sync_service_status': {'key': 'properties.storageSyncServiceStatus', 'type': 'int'}, 'storage_sync_service_uid': {'key': 'properties.storageSyncServiceUid', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionItem]'}, } def __init__(self, **kwargs): super(StorageSyncService, self).__init__(**kwargs) self.storage_sync_service_status = None self.storage_sync_service_uid = None + self.private_endpoint_connections = None class StorageSyncServiceCreateParameters(Model): @@ -1559,7 +2063,7 @@ 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: + :param properties: StorageSyncService Body Properties object. :type properties: object """ 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..a1d43f7fef48 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,210 @@ 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): + """Private endpoint object properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Full identifier of the private endpoint resource. + :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): + """Private endpoint connection 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 + :param private_endpoint: Properties of the private endpoint object. + :type private_endpoint: ~azure.mgmt.storagesync.models.PrivateEndpoint + :param private_link_service_connection_state: Approval state of the + private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.storagesync.models.PrivateLinkServiceConnectionState + :param provisioning_state: Provisioning state of the private endpoint + connection. Possible values include: 'Succeeded', 'Creating', 'Updating', + 'Deleting', 'Failed', 'Disconnected' + :type provisioning_state: str or + ~azure.mgmt.storagesync.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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_endpoint=None, private_link_service_connection_state=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 PrivateEndpointConnectionItem(Model): + """Private endpoint connection item. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Full identifier of the private endpoint connection. + :vartype id: str + :param private_endpoint: Properties of the private endpoint object. + :type private_endpoint: ~azure.mgmt.storagesync.models.PrivateEndpoint + :param private_link_service_connection_state: Approval state of the + private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.storagesync.models.PrivateLinkServiceConnectionState + :param provisioning_state: Provisioning state of the private endpoint + connection. Possible values include: 'Succeeded', 'Creating', 'Updating', + 'Deleting', 'Failed', 'Disconnected' + :type provisioning_state: str or + ~azure.mgmt.storagesync.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', '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_endpoint=None, private_link_service_connection_state=None, provisioning_state=None, **kwargs) -> None: + super(PrivateEndpointConnectionItem, self).__init__(**kwargs) + self.id = None + 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: Group identifier of private link resource. + :vartype group_id: str + :ivar required_members: Required member names of private link resource. + :vartype required_members: list[str] + :param required_zone_names: Required DNS zone names of the the private + link resource. + :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): + """An object that represents the approval state of the private link + connection. + + :param status: Indicates whether the connection has been approved, + rejected or removed by the key vault owner. Possible values include: + 'Pending', 'Approved', 'Rejected', 'Disconnected' + :type status: str or + ~azure.mgmt.storagesync.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval or rejection. + :type description: str + :param actions_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, *, status=None, description: str=None, actions_required: str=None, **kwargs) -> None: + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + class RecallActionParameters(Model): """The parameters used when calling recall action on server endpoint. @@ -869,6 +1288,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 +1337,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 +1359,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 +1369,77 @@ class ServerEndpointCloudTieringStatus(Model): 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 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_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): @@ -1000,6 +1474,17 @@ class ServerEndpointCreateParameters(ProxyResource): :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum :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 +1507,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 +1521,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): @@ -1340,6 +1829,12 @@ class ServerEndpointUpdateParameters(Model): :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum :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 +1848,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): @@ -1515,6 +2012,10 @@ class StorageSyncService(TrackedResource): :vartype storage_sync_service_status: int :ivar storage_sync_service_uid: Storage Sync service Uid :vartype storage_sync_service_uid: str + :ivar private_endpoint_connections: List of private endpoint connections + associated with the storage sync service. + :vartype private_endpoint_connections: + list[~azure.mgmt.storagesync.models.PrivateEndpointConnectionItem] """ _validation = { @@ -1524,6 +2025,7 @@ class StorageSyncService(TrackedResource): 'location': {'required': True}, 'storage_sync_service_status': {'readonly': True}, 'storage_sync_service_uid': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1534,12 +2036,14 @@ class StorageSyncService(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'storage_sync_service_status': {'key': 'properties.storageSyncServiceStatus', 'type': 'int'}, 'storage_sync_service_uid': {'key': 'properties.storageSyncServiceUid', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionItem]'}, } def __init__(self, *, location: str, tags=None, **kwargs) -> None: super(StorageSyncService, self).__init__(tags=tags, location=location, **kwargs) self.storage_sync_service_status = None self.storage_sync_service_uid = None + self.private_endpoint_connections = None class StorageSyncServiceCreateParameters(Model): @@ -1559,7 +2063,7 @@ 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: + :param properties: StorageSyncService Body Properties object. :type properties: object """ 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..c8bfd9516a4f 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,12 +21,43 @@ class Reason(str, Enum): deleted = "Deleted" +class PrivateEndpointServiceConnectionStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + disconnected = "Disconnected" + + +class PrivateEndpointConnectionProvisioningState(str, Enum): + + succeeded = "Succeeded" + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + failed = "Failed" + disconnected = "Disconnected" + + class ChangeDetectionMode(str, Enum): default = "Default" recursive = "Recursive" +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 NameAvailabilityReason(str, Enum): invalid = "Invalid" 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..dbe8edfdcb67 --- /dev/null +++ b/sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,312 @@ +# 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 .. 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 Storage Account + :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( + self, resource_group_name, storage_sync_service_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, **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 Storage Account + :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: 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.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]: + 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 + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def delete( + self, resource_group_name, storage_sync_service_name, private_endpoint_connection_name, custom_headers=None, raw=False, **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 Storage Account + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`StorageSyncErrorException` + """ + # 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, 204]: + raise models.StorageSyncErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + 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..14fa4214c940 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 @@ -25,7 +25,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 +35,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/_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