diff --git a/azure-mgmt-storagesync/HISTORY.rst b/azure-mgmt-storagesync/HISTORY.rst new file mode 100644 index 000000000000..1c7f175a422e --- /dev/null +++ b/azure-mgmt-storagesync/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (2019-04-05) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-storagesync/MANIFEST.in b/azure-mgmt-storagesync/MANIFEST.in new file mode 100644 index 000000000000..e4884efef41b --- /dev/null +++ b/azure-mgmt-storagesync/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-storagesync/README.rst b/azure-mgmt-storagesync/README.rst new file mode 100644 index 000000000000..d09d065f89ba --- /dev/null +++ b/azure-mgmt-storagesync/README.rst @@ -0,0 +1,33 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure Storage Sync Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Usage +===== + +For code examples, see `Storage Sync +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-storagesync%2FREADME.png diff --git a/azure-mgmt-storagesync/azure/__init__.py b/azure-mgmt-storagesync/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-storagesync/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-storagesync/azure/mgmt/__init__.py b/azure-mgmt-storagesync/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/__init__.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/__init__.py new file mode 100644 index 000000000000..247ac4b4938c --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .storage_sync_management_client import StorageSyncManagementClient +from .version import VERSION + +__all__ = ['StorageSyncManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/__init__.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/__init__.py new file mode 100644 index 000000000000..d702a79ff889 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/__init__.py @@ -0,0 +1,150 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .storage_sync_error_details_py3 import StorageSyncErrorDetails + from .storage_sync_api_error_py3 import StorageSyncApiError + from .storage_sync_error_py3 import StorageSyncError, StorageSyncErrorException + from .subscription_state_py3 import SubscriptionState + from .storage_sync_service_py3 import StorageSyncService + from .sync_group_py3 import SyncGroup + from .cloud_endpoint_py3 import CloudEndpoint + from .recall_action_parameters_py3 import RecallActionParameters + from .storage_sync_service_create_parameters_py3 import StorageSyncServiceCreateParameters + from .sync_group_create_parameters_py3 import SyncGroupCreateParameters + from .cloud_endpoint_create_parameters_py3 import CloudEndpointCreateParameters + from .server_endpoint_create_parameters_py3 import ServerEndpointCreateParameters + from .trigger_rollover_request_py3 import TriggerRolloverRequest + from .registered_server_create_parameters_py3 import RegisteredServerCreateParameters + from .server_endpoint_update_parameters_py3 import ServerEndpointUpdateParameters + from .files_not_syncing_error_py3 import FilesNotSyncingError + from .sync_session_status_py3 import SyncSessionStatus + from .sync_activity_status_py3 import SyncActivityStatus + from .server_endpoint_sync_status_py3 import ServerEndpointSyncStatus + from .server_endpoint_py3 import ServerEndpoint + from .registered_server_py3 import RegisteredServer + from .resources_move_info_py3 import ResourcesMoveInfo + from .workflow_py3 import Workflow + from .operation_display_info_py3 import OperationDisplayInfo + from .operation_entity_py3 import OperationEntity + from .operation_display_resource_py3 import OperationDisplayResource + from .check_name_availability_parameters_py3 import CheckNameAvailabilityParameters + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .restore_file_spec_py3 import RestoreFileSpec + from .post_restore_request_py3 import PostRestoreRequest + from .pre_restore_request_py3 import PreRestoreRequest + from .backup_request_py3 import BackupRequest + from .post_backup_response_py3 import PostBackupResponse + from .storage_sync_service_update_parameters_py3 import StorageSyncServiceUpdateParameters + from .tracked_resource_py3 import TrackedResource + from .azure_entity_resource_py3 import AzureEntityResource + from .resource_py3 import Resource + from .proxy_resource_py3 import ProxyResource +except (SyntaxError, ImportError): + from .storage_sync_error_details import StorageSyncErrorDetails + from .storage_sync_api_error import StorageSyncApiError + from .storage_sync_error import StorageSyncError, StorageSyncErrorException + from .subscription_state import SubscriptionState + from .storage_sync_service import StorageSyncService + from .sync_group import SyncGroup + from .cloud_endpoint import CloudEndpoint + from .recall_action_parameters import RecallActionParameters + from .storage_sync_service_create_parameters import StorageSyncServiceCreateParameters + from .sync_group_create_parameters import SyncGroupCreateParameters + from .cloud_endpoint_create_parameters import CloudEndpointCreateParameters + from .server_endpoint_create_parameters import ServerEndpointCreateParameters + from .trigger_rollover_request import TriggerRolloverRequest + from .registered_server_create_parameters import RegisteredServerCreateParameters + from .server_endpoint_update_parameters import ServerEndpointUpdateParameters + from .files_not_syncing_error import FilesNotSyncingError + from .sync_session_status import SyncSessionStatus + from .sync_activity_status import SyncActivityStatus + from .server_endpoint_sync_status import ServerEndpointSyncStatus + from .server_endpoint import ServerEndpoint + from .registered_server import RegisteredServer + from .resources_move_info import ResourcesMoveInfo + from .workflow import Workflow + from .operation_display_info import OperationDisplayInfo + from .operation_entity import OperationEntity + from .operation_display_resource import OperationDisplayResource + from .check_name_availability_parameters import CheckNameAvailabilityParameters + from .check_name_availability_result import CheckNameAvailabilityResult + from .restore_file_spec import RestoreFileSpec + from .post_restore_request import PostRestoreRequest + from .pre_restore_request import PreRestoreRequest + from .backup_request import BackupRequest + from .post_backup_response import PostBackupResponse + from .storage_sync_service_update_parameters import StorageSyncServiceUpdateParameters + from .tracked_resource import TrackedResource + from .azure_entity_resource import AzureEntityResource + from .resource import Resource + from .proxy_resource import ProxyResource +from .operation_entity_paged import OperationEntityPaged +from .storage_sync_service_paged import StorageSyncServicePaged +from .sync_group_paged import SyncGroupPaged +from .cloud_endpoint_paged import CloudEndpointPaged +from .server_endpoint_paged import ServerEndpointPaged +from .registered_server_paged import RegisteredServerPaged +from .workflow_paged import WorkflowPaged +from .storage_sync_management_client_enums import ( + Reason, + NameAvailabilityReason, +) + +__all__ = [ + 'StorageSyncErrorDetails', + 'StorageSyncApiError', + 'StorageSyncError', 'StorageSyncErrorException', + 'SubscriptionState', + 'StorageSyncService', + 'SyncGroup', + 'CloudEndpoint', + 'RecallActionParameters', + 'StorageSyncServiceCreateParameters', + 'SyncGroupCreateParameters', + 'CloudEndpointCreateParameters', + 'ServerEndpointCreateParameters', + 'TriggerRolloverRequest', + 'RegisteredServerCreateParameters', + 'ServerEndpointUpdateParameters', + 'FilesNotSyncingError', + 'SyncSessionStatus', + 'SyncActivityStatus', + 'ServerEndpointSyncStatus', + 'ServerEndpoint', + 'RegisteredServer', + 'ResourcesMoveInfo', + 'Workflow', + 'OperationDisplayInfo', + 'OperationEntity', + 'OperationDisplayResource', + 'CheckNameAvailabilityParameters', + 'CheckNameAvailabilityResult', + 'RestoreFileSpec', + 'PostRestoreRequest', + 'PreRestoreRequest', + 'BackupRequest', + 'PostBackupResponse', + 'StorageSyncServiceUpdateParameters', + 'TrackedResource', + 'AzureEntityResource', + 'Resource', + 'ProxyResource', + 'OperationEntityPaged', + 'StorageSyncServicePaged', + 'SyncGroupPaged', + 'CloudEndpointPaged', + 'ServerEndpointPaged', + 'RegisteredServerPaged', + 'WorkflowPaged', + 'Reason', + 'NameAvailabilityReason', +] diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/azure_entity_resource.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/azure_entity_resource.py new file mode 100644 index 000000000000..3bffaab8d35b --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/azure_entity_resource.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + 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 etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/azure_entity_resource_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/azure_entity_resource_py3.py new file mode 100644 index 000000000000..d3f80d87498a --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/azure_entity_resource_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + 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 etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/backup_request.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/backup_request.py new file mode 100644 index 000000000000..7985fa523e2c --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/backup_request.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BackupRequest(Model): + """Backup request. + + :param azure_file_share: Azure File Share. + :type azure_file_share: str + """ + + _attribute_map = { + 'azure_file_share': {'key': 'azureFileShare', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BackupRequest, self).__init__(**kwargs) + self.azure_file_share = kwargs.get('azure_file_share', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/backup_request_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/backup_request_py3.py new file mode 100644 index 000000000000..40ce93af2004 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/backup_request_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BackupRequest(Model): + """Backup request. + + :param azure_file_share: Azure File Share. + :type azure_file_share: str + """ + + _attribute_map = { + 'azure_file_share': {'key': 'azureFileShare', 'type': 'str'}, + } + + def __init__(self, *, azure_file_share: str=None, **kwargs) -> None: + super(BackupRequest, self).__init__(**kwargs) + self.azure_file_share = azure_file_share diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/check_name_availability_parameters.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/check_name_availability_parameters.py new file mode 100644 index 000000000000..de7bfc6d4f7b --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/check_name_availability_parameters.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityParameters(Model): + """Parameters for a check name availability request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name to check for availability + :type name: str + :ivar type: Required. The resource type. Must be set to + Microsoft.StorageSync/storageSyncServices. Default value: + "Microsoft.StorageSync/storageSyncServices" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.StorageSync/storageSyncServices" + + def __init__(self, **kwargs): + super(CheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/check_name_availability_parameters_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..4e5f4a4b374c --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/check_name_availability_parameters_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityParameters(Model): + """Parameters for a check name availability request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name to check for availability + :type name: str + :ivar type: Required. The resource type. Must be set to + Microsoft.StorageSync/storageSyncServices. Default value: + "Microsoft.StorageSync/storageSyncServices" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.StorageSync/storageSyncServices" + + def __init__(self, *, name: str, **kwargs) -> None: + super(CheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/check_name_availability_result.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/check_name_availability_result.py new file mode 100644 index 000000000000..2e861884d51e --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/check_name_availability_result.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a Storage Sync Service name could not + be used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'Invalid', 'AlreadyExists' + :vartype reason: str or + ~azure.mgmt.storagesync.models.NameAvailabilityReason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'NameAvailabilityReason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/check_name_availability_result_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..c15345123e3c --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/check_name_availability_result_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a Storage Sync Service name could not + be used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'Invalid', 'AlreadyExists' + :vartype reason: str or + ~azure.mgmt.storagesync.models.NameAvailabilityReason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'NameAvailabilityReason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint.py new file mode 100644 index 000000000000..406c7e067bb2 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class CloudEndpoint(ProxyResource): + """Cloud Endpoint object. + + 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 storage_account_resource_id: Storage Account Resource Id + :type storage_account_resource_id: str + :param azure_file_share_name: Azure file share name + :type azure_file_share_name: str + :param storage_account_tenant_id: Storage Account Tenant Id + :type storage_account_tenant_id: str + :param partnership_id: Partnership Id + :type partnership_id: str + :param friendly_name: Friendly Name + :type friendly_name: str + :ivar backup_enabled: Backup Enabled + :vartype backup_enabled: str + :param provisioning_state: CloudEndpoint Provisioning State + :type provisioning_state: str + :param last_workflow_id: CloudEndpoint lastWorkflowId + :type last_workflow_id: str + :param last_operation_name: Resource Last Operation Name + :type last_operation_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'backup_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'azure_file_share_name': {'key': 'properties.azureFileShareName', 'type': 'str'}, + 'storage_account_tenant_id': {'key': 'properties.storageAccountTenantId', 'type': 'str'}, + 'partnership_id': {'key': 'properties.partnershipId', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'backup_enabled': {'key': 'properties.backupEnabled', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'last_workflow_id': {'key': 'properties.lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'properties.lastOperationName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CloudEndpoint, self).__init__(**kwargs) + self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) + self.azure_file_share_name = kwargs.get('azure_file_share_name', None) + self.storage_account_tenant_id = kwargs.get('storage_account_tenant_id', None) + self.partnership_id = kwargs.get('partnership_id', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.backup_enabled = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.last_workflow_id = kwargs.get('last_workflow_id', None) + self.last_operation_name = kwargs.get('last_operation_name', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint_create_parameters.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint_create_parameters.py new file mode 100644 index 000000000000..eff777ef470c --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint_create_parameters.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class CloudEndpointCreateParameters(ProxyResource): + """The parameters used when creating a cloud endpoint. + + 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 storage_account_resource_id: Storage Account Resource Id + :type storage_account_resource_id: str + :param azure_file_share_name: Azure file share name + :type azure_file_share_name: str + :param storage_account_tenant_id: Storage Account Tenant Id + :type storage_account_tenant_id: str + """ + + _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'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'azure_file_share_name': {'key': 'properties.azureFileShareName', 'type': 'str'}, + 'storage_account_tenant_id': {'key': 'properties.storageAccountTenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CloudEndpointCreateParameters, self).__init__(**kwargs) + self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) + self.azure_file_share_name = kwargs.get('azure_file_share_name', None) + self.storage_account_tenant_id = kwargs.get('storage_account_tenant_id', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint_create_parameters_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint_create_parameters_py3.py new file mode 100644 index 000000000000..230aa1ff81da --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint_create_parameters_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +class CloudEndpointCreateParameters(ProxyResource): + """The parameters used when creating a cloud endpoint. + + 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 storage_account_resource_id: Storage Account Resource Id + :type storage_account_resource_id: str + :param azure_file_share_name: Azure file share name + :type azure_file_share_name: str + :param storage_account_tenant_id: Storage Account Tenant Id + :type storage_account_tenant_id: str + """ + + _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'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'azure_file_share_name': {'key': 'properties.azureFileShareName', 'type': 'str'}, + 'storage_account_tenant_id': {'key': 'properties.storageAccountTenantId', 'type': 'str'}, + } + + def __init__(self, *, storage_account_resource_id: str=None, azure_file_share_name: str=None, storage_account_tenant_id: str=None, **kwargs) -> None: + super(CloudEndpointCreateParameters, self).__init__(**kwargs) + self.storage_account_resource_id = storage_account_resource_id + self.azure_file_share_name = azure_file_share_name + self.storage_account_tenant_id = storage_account_tenant_id diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint_paged.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint_paged.py new file mode 100644 index 000000000000..e8236a3b36b7 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class CloudEndpointPaged(Paged): + """ + A paging container for iterating over a list of :class:`CloudEndpoint ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CloudEndpoint]'} + } + + def __init__(self, *args, **kwargs): + + super(CloudEndpointPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint_py3.py new file mode 100644 index 000000000000..3cd23e520ff7 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/cloud_endpoint_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +class CloudEndpoint(ProxyResource): + """Cloud Endpoint object. + + 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 storage_account_resource_id: Storage Account Resource Id + :type storage_account_resource_id: str + :param azure_file_share_name: Azure file share name + :type azure_file_share_name: str + :param storage_account_tenant_id: Storage Account Tenant Id + :type storage_account_tenant_id: str + :param partnership_id: Partnership Id + :type partnership_id: str + :param friendly_name: Friendly Name + :type friendly_name: str + :ivar backup_enabled: Backup Enabled + :vartype backup_enabled: str + :param provisioning_state: CloudEndpoint Provisioning State + :type provisioning_state: str + :param last_workflow_id: CloudEndpoint lastWorkflowId + :type last_workflow_id: str + :param last_operation_name: Resource Last Operation Name + :type last_operation_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'backup_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'azure_file_share_name': {'key': 'properties.azureFileShareName', 'type': 'str'}, + 'storage_account_tenant_id': {'key': 'properties.storageAccountTenantId', 'type': 'str'}, + 'partnership_id': {'key': 'properties.partnershipId', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'backup_enabled': {'key': 'properties.backupEnabled', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'last_workflow_id': {'key': 'properties.lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'properties.lastOperationName', 'type': 'str'}, + } + + def __init__(self, *, storage_account_resource_id: str=None, azure_file_share_name: str=None, storage_account_tenant_id: str=None, partnership_id: str=None, friendly_name: str=None, provisioning_state: str=None, last_workflow_id: str=None, last_operation_name: str=None, **kwargs) -> None: + super(CloudEndpoint, self).__init__(**kwargs) + self.storage_account_resource_id = storage_account_resource_id + self.azure_file_share_name = azure_file_share_name + self.storage_account_tenant_id = storage_account_tenant_id + self.partnership_id = partnership_id + self.friendly_name = friendly_name + self.backup_enabled = None + self.provisioning_state = provisioning_state + self.last_workflow_id = last_workflow_id + self.last_operation_name = last_operation_name diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/files_not_syncing_error.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/files_not_syncing_error.py new file mode 100644 index 000000000000..9b6666f42528 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/files_not_syncing_error.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FilesNotSyncingError(Model): + """Files not syncing 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 persistent_count: Count of persistent files not syncing with the + specified error code + :vartype persistent_count: long + :ivar transient_count: Count of transient files not syncing with the + specified error code + :vartype transient_count: long + """ + + _validation = { + 'error_code': {'readonly': True}, + 'persistent_count': {'readonly': True}, + 'transient_count': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'persistent_count': {'key': 'persistentCount', 'type': 'long'}, + 'transient_count': {'key': 'transientCount', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(FilesNotSyncingError, self).__init__(**kwargs) + self.error_code = None + self.persistent_count = None + self.transient_count = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/files_not_syncing_error_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/files_not_syncing_error_py3.py new file mode 100644 index 000000000000..f28f2c1f9770 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/files_not_syncing_error_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FilesNotSyncingError(Model): + """Files not syncing 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 persistent_count: Count of persistent files not syncing with the + specified error code + :vartype persistent_count: long + :ivar transient_count: Count of transient files not syncing with the + specified error code + :vartype transient_count: long + """ + + _validation = { + 'error_code': {'readonly': True}, + 'persistent_count': {'readonly': True}, + 'transient_count': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'persistent_count': {'key': 'persistentCount', 'type': 'long'}, + 'transient_count': {'key': 'transientCount', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(FilesNotSyncingError, self).__init__(**kwargs) + self.error_code = None + self.persistent_count = None + self.transient_count = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_display_info.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_display_info.py new file mode 100644 index 000000000000..0873ac288acf --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_display_info.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplayInfo(Model): + """The operation supported by storage sync. + + :param description: The description of the operation. + :type description: str + :param operation: The action that users can perform, based on their + permission level. + :type operation: str + :param provider: Service provider: Microsoft StorageSync. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplayInfo, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.operation = kwargs.get('operation', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_display_info_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_display_info_py3.py new file mode 100644 index 000000000000..3b267484ebcf --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_display_info_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplayInfo(Model): + """The operation supported by storage sync. + + :param description: The description of the operation. + :type description: str + :param operation: The action that users can perform, based on their + permission level. + :type operation: str + :param provider: Service provider: Microsoft StorageSync. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, operation: str=None, provider: str=None, resource: str=None, **kwargs) -> None: + super(OperationDisplayInfo, self).__init__(**kwargs) + self.description = description + self.operation = operation + self.provider = provider + self.resource = resource diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_display_resource.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_display_resource.py new file mode 100644 index 000000000000..63411958a683 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_display_resource.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplayResource(Model): + """Operation Display Resource object. + + :param provider: Operation Display Resource Provider. + :type provider: str + :param resource: Operation Display Resource. + :type resource: str + :param operation: Operation Display Resource Operation. + :type operation: str + :param description: Operation Display Resource Description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplayResource, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_display_resource_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_display_resource_py3.py new file mode 100644 index 000000000000..dd1a69b42c0d --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_display_resource_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplayResource(Model): + """Operation Display Resource object. + + :param provider: Operation Display Resource Provider. + :type provider: str + :param resource: Operation Display Resource. + :type resource: str + :param operation: Operation Display Resource Operation. + :type operation: str + :param description: Operation Display Resource Description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplayResource, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_entity.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_entity.py new file mode 100644 index 000000000000..5927baf919e7 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_entity.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationEntity(Model): + """The operation supported by storage sync. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The operation supported by storage sync. + :type display: ~azure.mgmt.storagesync.models.OperationDisplayInfo + :param origin: The origin. + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationEntity, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_entity_paged.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_entity_paged.py new file mode 100644 index 000000000000..b1bf74619a98 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_entity_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationEntityPaged(Paged): + """ + A paging container for iterating over a list of :class:`OperationEntity ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OperationEntity]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationEntityPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_entity_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_entity_py3.py new file mode 100644 index 000000000000..2f4f5a9b79ed --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/operation_entity_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationEntity(Model): + """The operation supported by storage sync. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The operation supported by storage sync. + :type display: ~azure.mgmt.storagesync.models.OperationDisplayInfo + :param origin: The origin. + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, **kwargs) -> None: + super(OperationEntity, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/post_backup_response.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/post_backup_response.py new file mode 100644 index 000000000000..2c4ea0b1bfea --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/post_backup_response.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PostBackupResponse(Model): + """Post Backup Response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar cloud_endpoint_name: cloud endpoint Name. + :vartype cloud_endpoint_name: str + """ + + _validation = { + 'cloud_endpoint_name': {'readonly': True}, + } + + _attribute_map = { + 'cloud_endpoint_name': {'key': 'backupMetadata.cloudEndpointName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PostBackupResponse, self).__init__(**kwargs) + self.cloud_endpoint_name = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/post_backup_response_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/post_backup_response_py3.py new file mode 100644 index 000000000000..525387f960b3 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/post_backup_response_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PostBackupResponse(Model): + """Post Backup Response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar cloud_endpoint_name: cloud endpoint Name. + :vartype cloud_endpoint_name: str + """ + + _validation = { + 'cloud_endpoint_name': {'readonly': True}, + } + + _attribute_map = { + 'cloud_endpoint_name': {'key': 'backupMetadata.cloudEndpointName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PostBackupResponse, self).__init__(**kwargs) + self.cloud_endpoint_name = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/post_restore_request.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/post_restore_request.py new file mode 100644 index 000000000000..7c9141c765e1 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/post_restore_request.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PostRestoreRequest(Model): + """Post Restore Request. + + :param partition: Post Restore partition. + :type partition: str + :param replica_group: Post Restore replica group. + :type replica_group: str + :param request_id: Post Restore request id. + :type request_id: str + :param azure_file_share_uri: Post Restore Azure file share uri. + :type azure_file_share_uri: str + :param status: Post Restore Azure status. + :type status: str + :param source_azure_file_share_uri: Post Restore Azure source azure file + share uri. + :type source_azure_file_share_uri: str + :param failed_file_list: Post Restore Azure failed file list. + :type failed_file_list: str + :param restore_file_spec: Post Restore restore file spec array. + :type restore_file_spec: + list[~azure.mgmt.storagesync.models.RestoreFileSpec] + """ + + _attribute_map = { + 'partition': {'key': 'partition', 'type': 'str'}, + 'replica_group': {'key': 'replicaGroup', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'azure_file_share_uri': {'key': 'azureFileShareUri', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'source_azure_file_share_uri': {'key': 'sourceAzureFileShareUri', 'type': 'str'}, + 'failed_file_list': {'key': 'failedFileList', 'type': 'str'}, + 'restore_file_spec': {'key': 'restoreFileSpec', 'type': '[RestoreFileSpec]'}, + } + + def __init__(self, **kwargs): + super(PostRestoreRequest, self).__init__(**kwargs) + self.partition = kwargs.get('partition', None) + self.replica_group = kwargs.get('replica_group', None) + self.request_id = kwargs.get('request_id', None) + self.azure_file_share_uri = kwargs.get('azure_file_share_uri', None) + self.status = kwargs.get('status', None) + self.source_azure_file_share_uri = kwargs.get('source_azure_file_share_uri', None) + self.failed_file_list = kwargs.get('failed_file_list', None) + self.restore_file_spec = kwargs.get('restore_file_spec', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/post_restore_request_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/post_restore_request_py3.py new file mode 100644 index 000000000000..6d9d7ec049f9 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/post_restore_request_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PostRestoreRequest(Model): + """Post Restore Request. + + :param partition: Post Restore partition. + :type partition: str + :param replica_group: Post Restore replica group. + :type replica_group: str + :param request_id: Post Restore request id. + :type request_id: str + :param azure_file_share_uri: Post Restore Azure file share uri. + :type azure_file_share_uri: str + :param status: Post Restore Azure status. + :type status: str + :param source_azure_file_share_uri: Post Restore Azure source azure file + share uri. + :type source_azure_file_share_uri: str + :param failed_file_list: Post Restore Azure failed file list. + :type failed_file_list: str + :param restore_file_spec: Post Restore restore file spec array. + :type restore_file_spec: + list[~azure.mgmt.storagesync.models.RestoreFileSpec] + """ + + _attribute_map = { + 'partition': {'key': 'partition', 'type': 'str'}, + 'replica_group': {'key': 'replicaGroup', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'azure_file_share_uri': {'key': 'azureFileShareUri', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'source_azure_file_share_uri': {'key': 'sourceAzureFileShareUri', 'type': 'str'}, + 'failed_file_list': {'key': 'failedFileList', 'type': 'str'}, + 'restore_file_spec': {'key': 'restoreFileSpec', 'type': '[RestoreFileSpec]'}, + } + + def __init__(self, *, partition: str=None, replica_group: str=None, request_id: str=None, azure_file_share_uri: str=None, status: str=None, source_azure_file_share_uri: str=None, failed_file_list: str=None, restore_file_spec=None, **kwargs) -> None: + super(PostRestoreRequest, self).__init__(**kwargs) + self.partition = partition + self.replica_group = replica_group + self.request_id = request_id + self.azure_file_share_uri = azure_file_share_uri + self.status = status + self.source_azure_file_share_uri = source_azure_file_share_uri + self.failed_file_list = failed_file_list + self.restore_file_spec = restore_file_spec diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/pre_restore_request.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/pre_restore_request.py new file mode 100644 index 000000000000..3ed5cf3e7060 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/pre_restore_request.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PreRestoreRequest(Model): + """Pre Restore request object. + + :param partition: Pre Restore partition. + :type partition: str + :param replica_group: Pre Restore replica group. + :type replica_group: str + :param request_id: Pre Restore request id. + :type request_id: str + :param azure_file_share_uri: Pre Restore Azure file share uri. + :type azure_file_share_uri: str + :param status: Pre Restore Azure status. + :type status: str + :param source_azure_file_share_uri: Pre Restore Azure source azure file + share uri. + :type source_azure_file_share_uri: str + :param backup_metadata_property_bag: Pre Restore backup metadata property + bag. + :type backup_metadata_property_bag: str + :param restore_file_spec: Pre Restore restore file spec array. + :type restore_file_spec: + list[~azure.mgmt.storagesync.models.RestoreFileSpec] + :param pause_wait_for_sync_drain_time_period_in_seconds: Pre Restore pause + wait for sync drain time period in seconds. + :type pause_wait_for_sync_drain_time_period_in_seconds: int + """ + + _attribute_map = { + 'partition': {'key': 'partition', 'type': 'str'}, + 'replica_group': {'key': 'replicaGroup', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'azure_file_share_uri': {'key': 'azureFileShareUri', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'source_azure_file_share_uri': {'key': 'sourceAzureFileShareUri', 'type': 'str'}, + 'backup_metadata_property_bag': {'key': 'backupMetadataPropertyBag', 'type': 'str'}, + 'restore_file_spec': {'key': 'restoreFileSpec', 'type': '[RestoreFileSpec]'}, + 'pause_wait_for_sync_drain_time_period_in_seconds': {'key': 'pauseWaitForSyncDrainTimePeriodInSeconds', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(PreRestoreRequest, self).__init__(**kwargs) + self.partition = kwargs.get('partition', None) + self.replica_group = kwargs.get('replica_group', None) + self.request_id = kwargs.get('request_id', None) + self.azure_file_share_uri = kwargs.get('azure_file_share_uri', None) + self.status = kwargs.get('status', None) + self.source_azure_file_share_uri = kwargs.get('source_azure_file_share_uri', None) + self.backup_metadata_property_bag = kwargs.get('backup_metadata_property_bag', None) + self.restore_file_spec = kwargs.get('restore_file_spec', None) + self.pause_wait_for_sync_drain_time_period_in_seconds = kwargs.get('pause_wait_for_sync_drain_time_period_in_seconds', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/pre_restore_request_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/pre_restore_request_py3.py new file mode 100644 index 000000000000..036e95b5690d --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/pre_restore_request_py3.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PreRestoreRequest(Model): + """Pre Restore request object. + + :param partition: Pre Restore partition. + :type partition: str + :param replica_group: Pre Restore replica group. + :type replica_group: str + :param request_id: Pre Restore request id. + :type request_id: str + :param azure_file_share_uri: Pre Restore Azure file share uri. + :type azure_file_share_uri: str + :param status: Pre Restore Azure status. + :type status: str + :param source_azure_file_share_uri: Pre Restore Azure source azure file + share uri. + :type source_azure_file_share_uri: str + :param backup_metadata_property_bag: Pre Restore backup metadata property + bag. + :type backup_metadata_property_bag: str + :param restore_file_spec: Pre Restore restore file spec array. + :type restore_file_spec: + list[~azure.mgmt.storagesync.models.RestoreFileSpec] + :param pause_wait_for_sync_drain_time_period_in_seconds: Pre Restore pause + wait for sync drain time period in seconds. + :type pause_wait_for_sync_drain_time_period_in_seconds: int + """ + + _attribute_map = { + 'partition': {'key': 'partition', 'type': 'str'}, + 'replica_group': {'key': 'replicaGroup', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'azure_file_share_uri': {'key': 'azureFileShareUri', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'source_azure_file_share_uri': {'key': 'sourceAzureFileShareUri', 'type': 'str'}, + 'backup_metadata_property_bag': {'key': 'backupMetadataPropertyBag', 'type': 'str'}, + 'restore_file_spec': {'key': 'restoreFileSpec', 'type': '[RestoreFileSpec]'}, + 'pause_wait_for_sync_drain_time_period_in_seconds': {'key': 'pauseWaitForSyncDrainTimePeriodInSeconds', 'type': 'int'}, + } + + def __init__(self, *, partition: str=None, replica_group: str=None, request_id: str=None, azure_file_share_uri: str=None, status: str=None, source_azure_file_share_uri: str=None, backup_metadata_property_bag: str=None, restore_file_spec=None, pause_wait_for_sync_drain_time_period_in_seconds: int=None, **kwargs) -> None: + super(PreRestoreRequest, self).__init__(**kwargs) + self.partition = partition + self.replica_group = replica_group + self.request_id = request_id + self.azure_file_share_uri = azure_file_share_uri + self.status = status + self.source_azure_file_share_uri = source_azure_file_share_uri + self.backup_metadata_property_bag = backup_metadata_property_bag + self.restore_file_spec = restore_file_spec + self.pause_wait_for_sync_drain_time_period_in_seconds = pause_wait_for_sync_drain_time_period_in_seconds diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/proxy_resource.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/proxy_resource.py new file mode 100644 index 000000000000..0de8fb6bd420 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/proxy_resource.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/proxy_resource_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/proxy_resource_py3.py new file mode 100644 index 000000000000..2e8391f912d6 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/proxy_resource_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/recall_action_parameters.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/recall_action_parameters.py new file mode 100644 index 000000000000..aebb1bca3c1b --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/recall_action_parameters.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RecallActionParameters(Model): + """The parameters used when calling recall action on server endpoint. + + :param pattern: Pattern of the files. + :type pattern: str + :param recall_path: Recall path. + :type recall_path: str + """ + + _attribute_map = { + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'recall_path': {'key': 'recallPath', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RecallActionParameters, self).__init__(**kwargs) + self.pattern = kwargs.get('pattern', None) + self.recall_path = kwargs.get('recall_path', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/recall_action_parameters_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/recall_action_parameters_py3.py new file mode 100644 index 000000000000..e755fe00abc6 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/recall_action_parameters_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RecallActionParameters(Model): + """The parameters used when calling recall action on server endpoint. + + :param pattern: Pattern of the files. + :type pattern: str + :param recall_path: Recall path. + :type recall_path: str + """ + + _attribute_map = { + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'recall_path': {'key': 'recallPath', 'type': 'str'}, + } + + def __init__(self, *, pattern: str=None, recall_path: str=None, **kwargs) -> None: + super(RecallActionParameters, self).__init__(**kwargs) + self.pattern = pattern + self.recall_path = recall_path diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server.py new file mode 100644 index 000000000000..e9635ab5bd7e --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class RegisteredServer(ProxyResource): + """Registered Server 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 server_certificate: Registered Server Certificate + :type server_certificate: str + :param agent_version: Registered Server Agent Version + :type agent_version: str + :param server_os_version: Registered Server OS Version + :type server_os_version: str + :param server_management_error_code: Registered Server Management Error + Code + :type server_management_error_code: int + :param last_heart_beat: Registered Server last heart beat + :type last_heart_beat: str + :param provisioning_state: Registered Server Provisioning State + :type provisioning_state: str + :param server_role: Registered Server serverRole + :type server_role: str + :param cluster_id: Registered Server clusterId + :type cluster_id: str + :param cluster_name: Registered Server clusterName + :type cluster_name: str + :param server_id: Registered Server serverId + :type server_id: str + :param storage_sync_service_uid: Registered Server storageSyncServiceUid + :type storage_sync_service_uid: str + :param last_workflow_id: Registered Server lastWorkflowId + :type last_workflow_id: str + :param last_operation_name: Resource Last Operation Name + :type last_operation_name: str + :param discovery_endpoint_uri: Resource discoveryEndpointUri + :type discovery_endpoint_uri: str + :param resource_location: Resource Location + :type resource_location: str + :param service_location: Service Location + :type service_location: str + :param friendly_name: Friendly Name + :type friendly_name: str + :param management_endpoint_uri: Management Endpoint Uri + :type management_endpoint_uri: str + :param monitoring_configuration: Monitoring Configuration + :type monitoring_configuration: str + """ + + _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'}, + 'server_certificate': {'key': 'properties.serverCertificate', 'type': 'str'}, + 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, + 'server_os_version': {'key': 'properties.serverOSVersion', 'type': 'str'}, + 'server_management_error_code': {'key': 'properties.serverManagementErrorCode', 'type': 'int'}, + 'last_heart_beat': {'key': 'properties.lastHeartBeat', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'server_role': {'key': 'properties.serverRole', 'type': 'str'}, + 'cluster_id': {'key': 'properties.clusterId', 'type': 'str'}, + 'cluster_name': {'key': 'properties.clusterName', 'type': 'str'}, + 'server_id': {'key': 'properties.serverId', 'type': 'str'}, + 'storage_sync_service_uid': {'key': 'properties.storageSyncServiceUid', 'type': 'str'}, + 'last_workflow_id': {'key': 'properties.lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'properties.lastOperationName', 'type': 'str'}, + 'discovery_endpoint_uri': {'key': 'properties.discoveryEndpointUri', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'service_location': {'key': 'properties.serviceLocation', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'management_endpoint_uri': {'key': 'properties.managementEndpointUri', 'type': 'str'}, + 'monitoring_configuration': {'key': 'properties.monitoringConfiguration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegisteredServer, self).__init__(**kwargs) + self.server_certificate = kwargs.get('server_certificate', None) + self.agent_version = kwargs.get('agent_version', None) + self.server_os_version = kwargs.get('server_os_version', None) + self.server_management_error_code = kwargs.get('server_management_error_code', None) + self.last_heart_beat = kwargs.get('last_heart_beat', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.server_role = kwargs.get('server_role', None) + self.cluster_id = kwargs.get('cluster_id', None) + self.cluster_name = kwargs.get('cluster_name', None) + self.server_id = kwargs.get('server_id', None) + self.storage_sync_service_uid = kwargs.get('storage_sync_service_uid', None) + self.last_workflow_id = kwargs.get('last_workflow_id', None) + self.last_operation_name = kwargs.get('last_operation_name', None) + self.discovery_endpoint_uri = kwargs.get('discovery_endpoint_uri', None) + self.resource_location = kwargs.get('resource_location', None) + self.service_location = kwargs.get('service_location', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.management_endpoint_uri = kwargs.get('management_endpoint_uri', None) + self.monitoring_configuration = kwargs.get('monitoring_configuration', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server_create_parameters.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server_create_parameters.py new file mode 100644 index 000000000000..d1dd456e9cf2 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server_create_parameters.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class RegisteredServerCreateParameters(ProxyResource): + """The parameters used when creating a registered server. + + 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 server_certificate: Registered Server Certificate + :type server_certificate: str + :param agent_version: Registered Server Agent Version + :type agent_version: str + :param server_os_version: Registered Server OS Version + :type server_os_version: str + :param last_heart_beat: Registered Server last heart beat + :type last_heart_beat: str + :param server_role: Registered Server serverRole + :type server_role: str + :param cluster_id: Registered Server clusterId + :type cluster_id: str + :param cluster_name: Registered Server clusterName + :type cluster_name: str + :param server_id: Registered Server serverId + :type server_id: str + :param friendly_name: Friendly Name + :type friendly_name: str + """ + + _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'}, + 'server_certificate': {'key': 'properties.serverCertificate', 'type': 'str'}, + 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, + 'server_os_version': {'key': 'properties.serverOSVersion', 'type': 'str'}, + 'last_heart_beat': {'key': 'properties.lastHeartBeat', 'type': 'str'}, + 'server_role': {'key': 'properties.serverRole', 'type': 'str'}, + 'cluster_id': {'key': 'properties.clusterId', 'type': 'str'}, + 'cluster_name': {'key': 'properties.clusterName', 'type': 'str'}, + 'server_id': {'key': 'properties.serverId', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegisteredServerCreateParameters, self).__init__(**kwargs) + self.server_certificate = kwargs.get('server_certificate', None) + self.agent_version = kwargs.get('agent_version', None) + self.server_os_version = kwargs.get('server_os_version', None) + self.last_heart_beat = kwargs.get('last_heart_beat', None) + self.server_role = kwargs.get('server_role', None) + self.cluster_id = kwargs.get('cluster_id', None) + self.cluster_name = kwargs.get('cluster_name', None) + self.server_id = kwargs.get('server_id', None) + self.friendly_name = kwargs.get('friendly_name', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server_create_parameters_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server_create_parameters_py3.py new file mode 100644 index 000000000000..1ca4e7e3da5c --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server_create_parameters_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +class RegisteredServerCreateParameters(ProxyResource): + """The parameters used when creating a registered server. + + 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 server_certificate: Registered Server Certificate + :type server_certificate: str + :param agent_version: Registered Server Agent Version + :type agent_version: str + :param server_os_version: Registered Server OS Version + :type server_os_version: str + :param last_heart_beat: Registered Server last heart beat + :type last_heart_beat: str + :param server_role: Registered Server serverRole + :type server_role: str + :param cluster_id: Registered Server clusterId + :type cluster_id: str + :param cluster_name: Registered Server clusterName + :type cluster_name: str + :param server_id: Registered Server serverId + :type server_id: str + :param friendly_name: Friendly Name + :type friendly_name: str + """ + + _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'}, + 'server_certificate': {'key': 'properties.serverCertificate', 'type': 'str'}, + 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, + 'server_os_version': {'key': 'properties.serverOSVersion', 'type': 'str'}, + 'last_heart_beat': {'key': 'properties.lastHeartBeat', 'type': 'str'}, + 'server_role': {'key': 'properties.serverRole', 'type': 'str'}, + 'cluster_id': {'key': 'properties.clusterId', 'type': 'str'}, + 'cluster_name': {'key': 'properties.clusterName', 'type': 'str'}, + 'server_id': {'key': 'properties.serverId', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + } + + def __init__(self, *, server_certificate: str=None, agent_version: str=None, server_os_version: str=None, last_heart_beat: str=None, server_role: str=None, cluster_id: str=None, cluster_name: str=None, server_id: str=None, friendly_name: str=None, **kwargs) -> None: + super(RegisteredServerCreateParameters, self).__init__(**kwargs) + self.server_certificate = server_certificate + self.agent_version = agent_version + self.server_os_version = server_os_version + self.last_heart_beat = last_heart_beat + self.server_role = server_role + self.cluster_id = cluster_id + self.cluster_name = cluster_name + self.server_id = server_id + self.friendly_name = friendly_name diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server_paged.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server_paged.py new file mode 100644 index 000000000000..427520af9dcf --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class RegisteredServerPaged(Paged): + """ + A paging container for iterating over a list of :class:`RegisteredServer ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RegisteredServer]'} + } + + def __init__(self, *args, **kwargs): + + super(RegisteredServerPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server_py3.py new file mode 100644 index 000000000000..696ae085506c --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/registered_server_py3.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +class RegisteredServer(ProxyResource): + """Registered Server 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 server_certificate: Registered Server Certificate + :type server_certificate: str + :param agent_version: Registered Server Agent Version + :type agent_version: str + :param server_os_version: Registered Server OS Version + :type server_os_version: str + :param server_management_error_code: Registered Server Management Error + Code + :type server_management_error_code: int + :param last_heart_beat: Registered Server last heart beat + :type last_heart_beat: str + :param provisioning_state: Registered Server Provisioning State + :type provisioning_state: str + :param server_role: Registered Server serverRole + :type server_role: str + :param cluster_id: Registered Server clusterId + :type cluster_id: str + :param cluster_name: Registered Server clusterName + :type cluster_name: str + :param server_id: Registered Server serverId + :type server_id: str + :param storage_sync_service_uid: Registered Server storageSyncServiceUid + :type storage_sync_service_uid: str + :param last_workflow_id: Registered Server lastWorkflowId + :type last_workflow_id: str + :param last_operation_name: Resource Last Operation Name + :type last_operation_name: str + :param discovery_endpoint_uri: Resource discoveryEndpointUri + :type discovery_endpoint_uri: str + :param resource_location: Resource Location + :type resource_location: str + :param service_location: Service Location + :type service_location: str + :param friendly_name: Friendly Name + :type friendly_name: str + :param management_endpoint_uri: Management Endpoint Uri + :type management_endpoint_uri: str + :param monitoring_configuration: Monitoring Configuration + :type monitoring_configuration: str + """ + + _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'}, + 'server_certificate': {'key': 'properties.serverCertificate', 'type': 'str'}, + 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, + 'server_os_version': {'key': 'properties.serverOSVersion', 'type': 'str'}, + 'server_management_error_code': {'key': 'properties.serverManagementErrorCode', 'type': 'int'}, + 'last_heart_beat': {'key': 'properties.lastHeartBeat', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'server_role': {'key': 'properties.serverRole', 'type': 'str'}, + 'cluster_id': {'key': 'properties.clusterId', 'type': 'str'}, + 'cluster_name': {'key': 'properties.clusterName', 'type': 'str'}, + 'server_id': {'key': 'properties.serverId', 'type': 'str'}, + 'storage_sync_service_uid': {'key': 'properties.storageSyncServiceUid', 'type': 'str'}, + 'last_workflow_id': {'key': 'properties.lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'properties.lastOperationName', 'type': 'str'}, + 'discovery_endpoint_uri': {'key': 'properties.discoveryEndpointUri', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'service_location': {'key': 'properties.serviceLocation', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'management_endpoint_uri': {'key': 'properties.managementEndpointUri', 'type': 'str'}, + 'monitoring_configuration': {'key': 'properties.monitoringConfiguration', 'type': 'str'}, + } + + def __init__(self, *, server_certificate: str=None, agent_version: str=None, server_os_version: str=None, server_management_error_code: int=None, last_heart_beat: str=None, provisioning_state: str=None, server_role: str=None, cluster_id: str=None, cluster_name: str=None, server_id: str=None, storage_sync_service_uid: str=None, last_workflow_id: str=None, last_operation_name: str=None, discovery_endpoint_uri: str=None, resource_location: str=None, service_location: str=None, friendly_name: str=None, management_endpoint_uri: str=None, monitoring_configuration: str=None, **kwargs) -> None: + super(RegisteredServer, self).__init__(**kwargs) + self.server_certificate = server_certificate + self.agent_version = agent_version + self.server_os_version = server_os_version + self.server_management_error_code = server_management_error_code + self.last_heart_beat = last_heart_beat + self.provisioning_state = provisioning_state + self.server_role = server_role + self.cluster_id = cluster_id + self.cluster_name = cluster_name + self.server_id = server_id + self.storage_sync_service_uid = storage_sync_service_uid + self.last_workflow_id = last_workflow_id + self.last_operation_name = last_operation_name + self.discovery_endpoint_uri = discovery_endpoint_uri + self.resource_location = resource_location + self.service_location = service_location + self.friendly_name = friendly_name + self.management_endpoint_uri = management_endpoint_uri + self.monitoring_configuration = monitoring_configuration diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/resource.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/resource.py new file mode 100644 index 000000000000..9333a2ac49ef --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/resource.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """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 + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/resource_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/resource_py3.py new file mode 100644 index 000000000000..370e6c506581 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/resource_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """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 + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/resources_move_info.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/resources_move_info.py new file mode 100644 index 000000000000..06ef882f8273 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/resources_move_info.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourcesMoveInfo(Model): + """Resource Move Info. + + :param target_resource_group: Target resource group. + :type target_resource_group: str + :param resources: Collection of Resources. + :type resources: list[str] + """ + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.target_resource_group = kwargs.get('target_resource_group', None) + self.resources = kwargs.get('resources', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/resources_move_info_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/resources_move_info_py3.py new file mode 100644 index 000000000000..b726db1e2fad --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/resources_move_info_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourcesMoveInfo(Model): + """Resource Move Info. + + :param target_resource_group: Target resource group. + :type target_resource_group: str + :param resources: Collection of Resources. + :type resources: list[str] + """ + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__(self, *, target_resource_group: str=None, resources=None, **kwargs) -> None: + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resources = resources diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/restore_file_spec.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/restore_file_spec.py new file mode 100644 index 000000000000..a35239a38814 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/restore_file_spec.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RestoreFileSpec(Model): + """Restore file spec. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param path: Restore file spec path + :type path: str + :ivar isdir: Restore file spec isdir + :vartype isdir: bool + """ + + _validation = { + 'isdir': {'readonly': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'isdir': {'key': 'isdir', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(RestoreFileSpec, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.isdir = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/restore_file_spec_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/restore_file_spec_py3.py new file mode 100644 index 000000000000..388311853cc4 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/restore_file_spec_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RestoreFileSpec(Model): + """Restore file spec. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param path: Restore file spec path + :type path: str + :ivar isdir: Restore file spec isdir + :vartype isdir: bool + """ + + _validation = { + 'isdir': {'readonly': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'isdir': {'key': 'isdir', 'type': 'bool'}, + } + + def __init__(self, *, path: str=None, **kwargs) -> None: + super(RestoreFileSpec, self).__init__(**kwargs) + self.path = path + self.isdir = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint.py new file mode 100644 index 000000000000..deea0447c85f --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class ServerEndpoint(ProxyResource): + """Server Endpoint object. + + 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 server_local_path: Server Local path. + :type server_local_path: str + :param cloud_tiering: Cloud Tiering. Possible values include: 'on', 'off' + :type cloud_tiering: str or ~azure.mgmt.storagesync.models.enum + :param volume_free_space_percent: Level of free space to be maintained by + Cloud Tiering if it is enabled. + :type volume_free_space_percent: int + :param tier_files_older_than_days: Tier files older than days. + :type tier_files_older_than_days: int + :param friendly_name: Friendly Name + :type friendly_name: str + :param server_resource_id: Server Resource Id. + :type server_resource_id: str + :ivar provisioning_state: ServerEndpoint Provisioning State + :vartype provisioning_state: str + :ivar last_workflow_id: ServerEndpoint lastWorkflowId + :vartype last_workflow_id: str + :ivar last_operation_name: Resource Last Operation Name + :vartype last_operation_name: str + :ivar sync_status: Server Endpoint sync status + :vartype sync_status: + ~azure.mgmt.storagesync.models.ServerEndpointSyncStatus + :param offline_data_transfer: Offline data transfer. Possible values + include: 'on', 'off' + :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum + :ivar offline_data_transfer_storage_account_resource_id: Offline data + transfer storage account resource ID + :vartype offline_data_transfer_storage_account_resource_id: str + :ivar offline_data_transfer_storage_account_tenant_id: Offline data + transfer storage account tenant ID + :vartype offline_data_transfer_storage_account_tenant_id: str + :param offline_data_transfer_share_name: Offline data transfer share name + :type offline_data_transfer_share_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'volume_free_space_percent': {'maximum': 100, 'minimum': 0}, + 'tier_files_older_than_days': {'maximum': 2147483647, 'minimum': 0}, + 'provisioning_state': {'readonly': True}, + 'last_workflow_id': {'readonly': True}, + 'last_operation_name': {'readonly': True}, + 'sync_status': {'readonly': True}, + 'offline_data_transfer_storage_account_resource_id': {'readonly': True}, + 'offline_data_transfer_storage_account_tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'server_local_path': {'key': 'properties.serverLocalPath', 'type': 'str'}, + 'cloud_tiering': {'key': 'properties.cloudTiering', 'type': 'str'}, + 'volume_free_space_percent': {'key': 'properties.volumeFreeSpacePercent', 'type': 'int'}, + 'tier_files_older_than_days': {'key': 'properties.tierFilesOlderThanDays', 'type': 'int'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'server_resource_id': {'key': 'properties.serverResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'last_workflow_id': {'key': 'properties.lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'properties.lastOperationName', 'type': 'str'}, + 'sync_status': {'key': 'properties.syncStatus', 'type': 'ServerEndpointSyncStatus'}, + 'offline_data_transfer': {'key': 'properties.offlineDataTransfer', 'type': 'str'}, + 'offline_data_transfer_storage_account_resource_id': {'key': 'properties.offlineDataTransferStorageAccountResourceId', 'type': 'str'}, + 'offline_data_transfer_storage_account_tenant_id': {'key': 'properties.offlineDataTransferStorageAccountTenantId', 'type': 'str'}, + 'offline_data_transfer_share_name': {'key': 'properties.offlineDataTransferShareName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServerEndpoint, self).__init__(**kwargs) + self.server_local_path = kwargs.get('server_local_path', None) + self.cloud_tiering = kwargs.get('cloud_tiering', None) + self.volume_free_space_percent = kwargs.get('volume_free_space_percent', None) + self.tier_files_older_than_days = kwargs.get('tier_files_older_than_days', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.server_resource_id = kwargs.get('server_resource_id', None) + self.provisioning_state = None + self.last_workflow_id = None + self.last_operation_name = None + self.sync_status = None + self.offline_data_transfer = kwargs.get('offline_data_transfer', None) + self.offline_data_transfer_storage_account_resource_id = None + self.offline_data_transfer_storage_account_tenant_id = None + self.offline_data_transfer_share_name = kwargs.get('offline_data_transfer_share_name', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_create_parameters.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_create_parameters.py new file mode 100644 index 000000000000..6d21513418f4 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_create_parameters.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class ServerEndpointCreateParameters(ProxyResource): + """The parameters used when creating a server endpoint. + + 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 server_local_path: Server Local path. + :type server_local_path: str + :param cloud_tiering: Cloud Tiering. Possible values include: 'on', 'off' + :type cloud_tiering: str or ~azure.mgmt.storagesync.models.enum + :param volume_free_space_percent: Level of free space to be maintained by + Cloud Tiering if it is enabled. + :type volume_free_space_percent: int + :param tier_files_older_than_days: Tier files older than days. + :type tier_files_older_than_days: int + :param friendly_name: Friendly Name + :type friendly_name: str + :param server_resource_id: Server Resource Id. + :type server_resource_id: str + :param offline_data_transfer: Offline data transfer. Possible values + include: 'on', 'off' + :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum + :param offline_data_transfer_share_name: Offline data transfer share name + :type offline_data_transfer_share_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'volume_free_space_percent': {'maximum': 100, 'minimum': 0}, + 'tier_files_older_than_days': {'maximum': 2147483647, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'server_local_path': {'key': 'properties.serverLocalPath', 'type': 'str'}, + 'cloud_tiering': {'key': 'properties.cloudTiering', 'type': 'str'}, + 'volume_free_space_percent': {'key': 'properties.volumeFreeSpacePercent', 'type': 'int'}, + 'tier_files_older_than_days': {'key': 'properties.tierFilesOlderThanDays', 'type': 'int'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + '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'}, + } + + def __init__(self, **kwargs): + super(ServerEndpointCreateParameters, self).__init__(**kwargs) + self.server_local_path = kwargs.get('server_local_path', None) + self.cloud_tiering = kwargs.get('cloud_tiering', None) + self.volume_free_space_percent = kwargs.get('volume_free_space_percent', None) + self.tier_files_older_than_days = kwargs.get('tier_files_older_than_days', None) + self.friendly_name = kwargs.get('friendly_name', None) + 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) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_create_parameters_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_create_parameters_py3.py new file mode 100644 index 000000000000..e50d73f0ab6b --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_create_parameters_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +class ServerEndpointCreateParameters(ProxyResource): + """The parameters used when creating a server endpoint. + + 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 server_local_path: Server Local path. + :type server_local_path: str + :param cloud_tiering: Cloud Tiering. Possible values include: 'on', 'off' + :type cloud_tiering: str or ~azure.mgmt.storagesync.models.enum + :param volume_free_space_percent: Level of free space to be maintained by + Cloud Tiering if it is enabled. + :type volume_free_space_percent: int + :param tier_files_older_than_days: Tier files older than days. + :type tier_files_older_than_days: int + :param friendly_name: Friendly Name + :type friendly_name: str + :param server_resource_id: Server Resource Id. + :type server_resource_id: str + :param offline_data_transfer: Offline data transfer. Possible values + include: 'on', 'off' + :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum + :param offline_data_transfer_share_name: Offline data transfer share name + :type offline_data_transfer_share_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'volume_free_space_percent': {'maximum': 100, 'minimum': 0}, + 'tier_files_older_than_days': {'maximum': 2147483647, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'server_local_path': {'key': 'properties.serverLocalPath', 'type': 'str'}, + 'cloud_tiering': {'key': 'properties.cloudTiering', 'type': 'str'}, + 'volume_free_space_percent': {'key': 'properties.volumeFreeSpacePercent', 'type': 'int'}, + 'tier_files_older_than_days': {'key': 'properties.tierFilesOlderThanDays', 'type': 'int'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + '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'}, + } + + 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: + super(ServerEndpointCreateParameters, self).__init__(**kwargs) + self.server_local_path = server_local_path + 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.friendly_name = friendly_name + 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 diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_paged.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_paged.py new file mode 100644 index 000000000000..28f07cf6b012 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ServerEndpointPaged(Paged): + """ + A paging container for iterating over a list of :class:`ServerEndpoint ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServerEndpoint]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerEndpointPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_py3.py new file mode 100644 index 000000000000..64683d6ba5e3 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_py3.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +class ServerEndpoint(ProxyResource): + """Server Endpoint object. + + 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 server_local_path: Server Local path. + :type server_local_path: str + :param cloud_tiering: Cloud Tiering. Possible values include: 'on', 'off' + :type cloud_tiering: str or ~azure.mgmt.storagesync.models.enum + :param volume_free_space_percent: Level of free space to be maintained by + Cloud Tiering if it is enabled. + :type volume_free_space_percent: int + :param tier_files_older_than_days: Tier files older than days. + :type tier_files_older_than_days: int + :param friendly_name: Friendly Name + :type friendly_name: str + :param server_resource_id: Server Resource Id. + :type server_resource_id: str + :ivar provisioning_state: ServerEndpoint Provisioning State + :vartype provisioning_state: str + :ivar last_workflow_id: ServerEndpoint lastWorkflowId + :vartype last_workflow_id: str + :ivar last_operation_name: Resource Last Operation Name + :vartype last_operation_name: str + :ivar sync_status: Server Endpoint sync status + :vartype sync_status: + ~azure.mgmt.storagesync.models.ServerEndpointSyncStatus + :param offline_data_transfer: Offline data transfer. Possible values + include: 'on', 'off' + :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum + :ivar offline_data_transfer_storage_account_resource_id: Offline data + transfer storage account resource ID + :vartype offline_data_transfer_storage_account_resource_id: str + :ivar offline_data_transfer_storage_account_tenant_id: Offline data + transfer storage account tenant ID + :vartype offline_data_transfer_storage_account_tenant_id: str + :param offline_data_transfer_share_name: Offline data transfer share name + :type offline_data_transfer_share_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'volume_free_space_percent': {'maximum': 100, 'minimum': 0}, + 'tier_files_older_than_days': {'maximum': 2147483647, 'minimum': 0}, + 'provisioning_state': {'readonly': True}, + 'last_workflow_id': {'readonly': True}, + 'last_operation_name': {'readonly': True}, + 'sync_status': {'readonly': True}, + 'offline_data_transfer_storage_account_resource_id': {'readonly': True}, + 'offline_data_transfer_storage_account_tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'server_local_path': {'key': 'properties.serverLocalPath', 'type': 'str'}, + 'cloud_tiering': {'key': 'properties.cloudTiering', 'type': 'str'}, + 'volume_free_space_percent': {'key': 'properties.volumeFreeSpacePercent', 'type': 'int'}, + 'tier_files_older_than_days': {'key': 'properties.tierFilesOlderThanDays', 'type': 'int'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'server_resource_id': {'key': 'properties.serverResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'last_workflow_id': {'key': 'properties.lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'properties.lastOperationName', 'type': 'str'}, + 'sync_status': {'key': 'properties.syncStatus', 'type': 'ServerEndpointSyncStatus'}, + 'offline_data_transfer': {'key': 'properties.offlineDataTransfer', 'type': 'str'}, + 'offline_data_transfer_storage_account_resource_id': {'key': 'properties.offlineDataTransferStorageAccountResourceId', 'type': 'str'}, + 'offline_data_transfer_storage_account_tenant_id': {'key': 'properties.offlineDataTransferStorageAccountTenantId', 'type': 'str'}, + 'offline_data_transfer_share_name': {'key': 'properties.offlineDataTransferShareName', 'type': 'str'}, + } + + 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: + super(ServerEndpoint, self).__init__(**kwargs) + self.server_local_path = server_local_path + 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.friendly_name = friendly_name + self.server_resource_id = server_resource_id + self.provisioning_state = None + self.last_workflow_id = None + self.last_operation_name = None + self.sync_status = None + self.offline_data_transfer = offline_data_transfer + self.offline_data_transfer_storage_account_resource_id = None + self.offline_data_transfer_storage_account_tenant_id = None + self.offline_data_transfer_share_name = offline_data_transfer_share_name diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_sync_status.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_sync_status.py new file mode 100644 index 000000000000..fd3be05457e1 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_sync_status.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerEndpointSyncStatus(Model): + """Server Endpoint sync status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar download_health: Download Health Status. Possible values include: + 'Healthy', 'Error', 'SyncBlockedForRestore', + 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' + :vartype download_health: str or ~azure.mgmt.storagesync.models.enum + :ivar upload_health: Upload Health Status. Possible values include: + 'Healthy', 'Error', 'SyncBlockedForRestore', + 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' + :vartype upload_health: str or ~azure.mgmt.storagesync.models.enum + :ivar combined_health: Combined Health Status. Possible values include: + 'Healthy', 'Error', 'SyncBlockedForRestore', + 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' + :vartype combined_health: str or ~azure.mgmt.storagesync.models.enum + :ivar sync_activity: Sync activity. Possible values include: 'Upload', + 'Download', 'UploadAndDownload' + :vartype sync_activity: str or ~azure.mgmt.storagesync.models.enum + :ivar total_persistent_files_not_syncing_count: Total count of persistent + files not syncing (combined upload + download). Reserved for future use. + :vartype total_persistent_files_not_syncing_count: long + :ivar last_updated_timestamp: Last Updated Timestamp + :vartype last_updated_timestamp: datetime + :ivar upload_status: Upload Status + :vartype upload_status: ~azure.mgmt.storagesync.models.SyncSessionStatus + :ivar download_status: Download Status + :vartype download_status: ~azure.mgmt.storagesync.models.SyncSessionStatus + :ivar upload_activity: Upload sync activity + :vartype upload_activity: + ~azure.mgmt.storagesync.models.SyncActivityStatus + :ivar download_activity: Download sync activity + :vartype download_activity: + ~azure.mgmt.storagesync.models.SyncActivityStatus + :ivar offline_data_transfer_status: Offline Data Transfer State. Possible + values include: 'InProgress', 'Stopping', 'NotRunning', 'Complete' + :vartype offline_data_transfer_status: str or + ~azure.mgmt.storagesync.models.enum + """ + + _validation = { + 'download_health': {'readonly': True}, + 'upload_health': {'readonly': True}, + 'combined_health': {'readonly': True}, + 'sync_activity': {'readonly': True}, + 'total_persistent_files_not_syncing_count': {'readonly': True}, + 'last_updated_timestamp': {'readonly': True}, + 'upload_status': {'readonly': True}, + 'download_status': {'readonly': True}, + 'upload_activity': {'readonly': True}, + 'download_activity': {'readonly': True}, + 'offline_data_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'download_health': {'key': 'downloadHealth', 'type': 'str'}, + 'upload_health': {'key': 'uploadHealth', 'type': 'str'}, + 'combined_health': {'key': 'combinedHealth', 'type': 'str'}, + 'sync_activity': {'key': 'syncActivity', 'type': 'str'}, + 'total_persistent_files_not_syncing_count': {'key': 'totalPersistentFilesNotSyncingCount', 'type': 'long'}, + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'upload_status': {'key': 'uploadStatus', 'type': 'SyncSessionStatus'}, + 'download_status': {'key': 'downloadStatus', 'type': 'SyncSessionStatus'}, + 'upload_activity': {'key': 'uploadActivity', 'type': 'SyncActivityStatus'}, + 'download_activity': {'key': 'downloadActivity', 'type': 'SyncActivityStatus'}, + 'offline_data_transfer_status': {'key': 'offlineDataTransferStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServerEndpointSyncStatus, self).__init__(**kwargs) + self.download_health = None + self.upload_health = None + self.combined_health = None + self.sync_activity = None + self.total_persistent_files_not_syncing_count = None + self.last_updated_timestamp = None + self.upload_status = None + self.download_status = None + self.upload_activity = None + self.download_activity = None + self.offline_data_transfer_status = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_sync_status_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_sync_status_py3.py new file mode 100644 index 000000000000..f31d58773c8f --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_sync_status_py3.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerEndpointSyncStatus(Model): + """Server Endpoint sync status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar download_health: Download Health Status. Possible values include: + 'Healthy', 'Error', 'SyncBlockedForRestore', + 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' + :vartype download_health: str or ~azure.mgmt.storagesync.models.enum + :ivar upload_health: Upload Health Status. Possible values include: + 'Healthy', 'Error', 'SyncBlockedForRestore', + 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' + :vartype upload_health: str or ~azure.mgmt.storagesync.models.enum + :ivar combined_health: Combined Health Status. Possible values include: + 'Healthy', 'Error', 'SyncBlockedForRestore', + 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' + :vartype combined_health: str or ~azure.mgmt.storagesync.models.enum + :ivar sync_activity: Sync activity. Possible values include: 'Upload', + 'Download', 'UploadAndDownload' + :vartype sync_activity: str or ~azure.mgmt.storagesync.models.enum + :ivar total_persistent_files_not_syncing_count: Total count of persistent + files not syncing (combined upload + download). Reserved for future use. + :vartype total_persistent_files_not_syncing_count: long + :ivar last_updated_timestamp: Last Updated Timestamp + :vartype last_updated_timestamp: datetime + :ivar upload_status: Upload Status + :vartype upload_status: ~azure.mgmt.storagesync.models.SyncSessionStatus + :ivar download_status: Download Status + :vartype download_status: ~azure.mgmt.storagesync.models.SyncSessionStatus + :ivar upload_activity: Upload sync activity + :vartype upload_activity: + ~azure.mgmt.storagesync.models.SyncActivityStatus + :ivar download_activity: Download sync activity + :vartype download_activity: + ~azure.mgmt.storagesync.models.SyncActivityStatus + :ivar offline_data_transfer_status: Offline Data Transfer State. Possible + values include: 'InProgress', 'Stopping', 'NotRunning', 'Complete' + :vartype offline_data_transfer_status: str or + ~azure.mgmt.storagesync.models.enum + """ + + _validation = { + 'download_health': {'readonly': True}, + 'upload_health': {'readonly': True}, + 'combined_health': {'readonly': True}, + 'sync_activity': {'readonly': True}, + 'total_persistent_files_not_syncing_count': {'readonly': True}, + 'last_updated_timestamp': {'readonly': True}, + 'upload_status': {'readonly': True}, + 'download_status': {'readonly': True}, + 'upload_activity': {'readonly': True}, + 'download_activity': {'readonly': True}, + 'offline_data_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'download_health': {'key': 'downloadHealth', 'type': 'str'}, + 'upload_health': {'key': 'uploadHealth', 'type': 'str'}, + 'combined_health': {'key': 'combinedHealth', 'type': 'str'}, + 'sync_activity': {'key': 'syncActivity', 'type': 'str'}, + 'total_persistent_files_not_syncing_count': {'key': 'totalPersistentFilesNotSyncingCount', 'type': 'long'}, + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'upload_status': {'key': 'uploadStatus', 'type': 'SyncSessionStatus'}, + 'download_status': {'key': 'downloadStatus', 'type': 'SyncSessionStatus'}, + 'upload_activity': {'key': 'uploadActivity', 'type': 'SyncActivityStatus'}, + 'download_activity': {'key': 'downloadActivity', 'type': 'SyncActivityStatus'}, + 'offline_data_transfer_status': {'key': 'offlineDataTransferStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ServerEndpointSyncStatus, self).__init__(**kwargs) + self.download_health = None + self.upload_health = None + self.combined_health = None + self.sync_activity = None + self.total_persistent_files_not_syncing_count = None + self.last_updated_timestamp = None + self.upload_status = None + self.download_status = None + self.upload_activity = None + self.download_activity = None + self.offline_data_transfer_status = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_update_parameters.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_update_parameters.py new file mode 100644 index 000000000000..25554c2b0a46 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_update_parameters.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerEndpointUpdateParameters(Model): + """Parameters for updating an Server Endpoint. + + :param cloud_tiering: Cloud Tiering. Possible values include: 'on', 'off' + :type cloud_tiering: str or ~azure.mgmt.storagesync.models.enum + :param volume_free_space_percent: Level of free space to be maintained by + Cloud Tiering if it is enabled. + :type volume_free_space_percent: int + :param tier_files_older_than_days: Tier files older than days. + :type tier_files_older_than_days: int + :param offline_data_transfer: Offline data transfer. Possible values + include: 'on', 'off' + :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum + :param offline_data_transfer_share_name: Offline data transfer share name + :type offline_data_transfer_share_name: str + """ + + _validation = { + 'volume_free_space_percent': {'maximum': 100, 'minimum': 0}, + 'tier_files_older_than_days': {'maximum': 2147483647, 'minimum': 0}, + } + + _attribute_map = { + 'cloud_tiering': {'key': 'properties.cloudTiering', 'type': 'str'}, + 'volume_free_space_percent': {'key': 'properties.volumeFreeSpacePercent', 'type': 'int'}, + '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'}, + } + + def __init__(self, **kwargs): + super(ServerEndpointUpdateParameters, self).__init__(**kwargs) + self.cloud_tiering = kwargs.get('cloud_tiering', None) + self.volume_free_space_percent = kwargs.get('volume_free_space_percent', None) + 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) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_update_parameters_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_update_parameters_py3.py new file mode 100644 index 000000000000..a44778969f64 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/server_endpoint_update_parameters_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerEndpointUpdateParameters(Model): + """Parameters for updating an Server Endpoint. + + :param cloud_tiering: Cloud Tiering. Possible values include: 'on', 'off' + :type cloud_tiering: str or ~azure.mgmt.storagesync.models.enum + :param volume_free_space_percent: Level of free space to be maintained by + Cloud Tiering if it is enabled. + :type volume_free_space_percent: int + :param tier_files_older_than_days: Tier files older than days. + :type tier_files_older_than_days: int + :param offline_data_transfer: Offline data transfer. Possible values + include: 'on', 'off' + :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.enum + :param offline_data_transfer_share_name: Offline data transfer share name + :type offline_data_transfer_share_name: str + """ + + _validation = { + 'volume_free_space_percent': {'maximum': 100, 'minimum': 0}, + 'tier_files_older_than_days': {'maximum': 2147483647, 'minimum': 0}, + } + + _attribute_map = { + 'cloud_tiering': {'key': 'properties.cloudTiering', 'type': 'str'}, + 'volume_free_space_percent': {'key': 'properties.volumeFreeSpacePercent', 'type': 'int'}, + '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'}, + } + + 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: + 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 diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_api_error.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_api_error.py new file mode 100644 index 000000000000..6994277562aa --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_api_error.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageSyncApiError(Model): + """Error type. + + :param code: Error code of the given entry. + :type code: str + :param message: Error message of the given entry. + :type message: str + :param target: Target of the given error entry. + :type target: str + :param details: Error details of the given entry. + :type details: ~azure.mgmt.storagesync.models.StorageSyncErrorDetails + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'StorageSyncErrorDetails'}, + } + + def __init__(self, **kwargs): + super(StorageSyncApiError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_api_error_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_api_error_py3.py new file mode 100644 index 000000000000..c95d94f7ebf8 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_api_error_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageSyncApiError(Model): + """Error type. + + :param code: Error code of the given entry. + :type code: str + :param message: Error message of the given entry. + :type message: str + :param target: Target of the given error entry. + :type target: str + :param details: Error details of the given entry. + :type details: ~azure.mgmt.storagesync.models.StorageSyncErrorDetails + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'StorageSyncErrorDetails'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(StorageSyncApiError, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_error.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_error.py new file mode 100644 index 000000000000..f218da1917d1 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_error.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class StorageSyncError(Model): + """Error type. + + :param error: Error details of the given entry. + :type error: ~azure.mgmt.storagesync.models.StorageSyncApiError + :param innererror: Error details of the given entry. + :type innererror: ~azure.mgmt.storagesync.models.StorageSyncApiError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'StorageSyncApiError'}, + 'innererror': {'key': 'innererror', 'type': 'StorageSyncApiError'}, + } + + def __init__(self, **kwargs): + super(StorageSyncError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + self.innererror = kwargs.get('innererror', None) + + +class StorageSyncErrorException(HttpOperationError): + """Server responsed with exception of type: 'StorageSyncError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(StorageSyncErrorException, self).__init__(deserialize, response, 'StorageSyncError', *args) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_error_details.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_error_details.py new file mode 100644 index 000000000000..c7f59c2cc17b --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_error_details.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageSyncErrorDetails(Model): + """Error Details object. + + :param code: Error code of the given entry. + :type code: str + :param message: Error message of the given entry. + :type message: str + :param target: Target of the given entry. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageSyncErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_error_details_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_error_details_py3.py new file mode 100644 index 000000000000..27ef02028e3e --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_error_details_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageSyncErrorDetails(Model): + """Error Details object. + + :param code: Error code of the given entry. + :type code: str + :param message: Error message of the given entry. + :type message: str + :param target: Target of the given entry. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, **kwargs) -> None: + super(StorageSyncErrorDetails, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_error_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_error_py3.py new file mode 100644 index 000000000000..4c7863155a2a --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_error_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class StorageSyncError(Model): + """Error type. + + :param error: Error details of the given entry. + :type error: ~azure.mgmt.storagesync.models.StorageSyncApiError + :param innererror: Error details of the given entry. + :type innererror: ~azure.mgmt.storagesync.models.StorageSyncApiError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'StorageSyncApiError'}, + 'innererror': {'key': 'innererror', 'type': 'StorageSyncApiError'}, + } + + def __init__(self, *, error=None, innererror=None, **kwargs) -> None: + super(StorageSyncError, self).__init__(**kwargs) + self.error = error + self.innererror = innererror + + +class StorageSyncErrorException(HttpOperationError): + """Server responsed with exception of type: 'StorageSyncError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(StorageSyncErrorException, self).__init__(deserialize, response, 'StorageSyncError', *args) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_management_client_enums.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_management_client_enums.py new file mode 100644 index 000000000000..2e5f8975de92 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_management_client_enums.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class Reason(str, Enum): + + registered = "Registered" + unregistered = "Unregistered" + warned = "Warned" + suspended = "Suspended" + deleted = "Deleted" + + +class NameAvailabilityReason(str, Enum): + + invalid = "Invalid" + already_exists = "AlreadyExists" diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service.py new file mode 100644 index 000000000000..07cdf0c2be10 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource import TrackedResource + + +class StorageSyncService(TrackedResource): + """Storage Sync Service object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar storage_sync_service_status: Storage Sync service status. + :vartype storage_sync_service_status: int + :ivar storage_sync_service_uid: Storage Sync service Uid + :vartype storage_sync_service_uid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'storage_sync_service_status': {'readonly': True}, + 'storage_sync_service_uid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'storage_sync_service_status': {'key': 'properties.storageSyncServiceStatus', 'type': 'int'}, + 'storage_sync_service_uid': {'key': 'properties.storageSyncServiceUid', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageSyncService, self).__init__(**kwargs) + self.storage_sync_service_status = None + self.storage_sync_service_uid = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_create_parameters.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_create_parameters.py new file mode 100644 index 000000000000..88f1df814a2a --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_create_parameters.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageSyncServiceCreateParameters(Model): + """The parameters used when creating a storage sync service. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param properties: + :type properties: object + """ + + _validation = { + 'location': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(StorageSyncServiceCreateParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_create_parameters_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_create_parameters_py3.py new file mode 100644 index 000000000000..15d33d0c62f4 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_create_parameters_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageSyncServiceCreateParameters(Model): + """The parameters used when creating a storage sync service. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param properties: + :type properties: object + """ + + _validation = { + 'location': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, location: str, tags=None, properties=None, **kwargs) -> None: + super(StorageSyncServiceCreateParameters, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.properties = properties diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_paged.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_paged.py new file mode 100644 index 000000000000..5904a21bc2b8 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class StorageSyncServicePaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageSyncService ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageSyncService]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageSyncServicePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_py3.py new file mode 100644 index 000000000000..0fa5d1290171 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource_py3 import TrackedResource + + +class StorageSyncService(TrackedResource): + """Storage Sync Service object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar storage_sync_service_status: Storage Sync service status. + :vartype storage_sync_service_status: int + :ivar storage_sync_service_uid: Storage Sync service Uid + :vartype storage_sync_service_uid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'storage_sync_service_status': {'readonly': True}, + 'storage_sync_service_uid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'storage_sync_service_status': {'key': 'properties.storageSyncServiceStatus', 'type': 'int'}, + 'storage_sync_service_uid': {'key': 'properties.storageSyncServiceUid', 'type': 'str'}, + } + + 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 diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_update_parameters.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_update_parameters.py new file mode 100644 index 000000000000..4038e1fb1941 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_update_parameters.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageSyncServiceUpdateParameters(Model): + """Parameters for updating an Storage sync service. + + :param tags: The user-specified tags associated with the storage sync + service. + :type tags: dict[str, str] + :param properties: The properties of the storage sync service. + :type properties: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(StorageSyncServiceUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_update_parameters_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_update_parameters_py3.py new file mode 100644 index 000000000000..b70ad833087d --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/storage_sync_service_update_parameters_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageSyncServiceUpdateParameters(Model): + """Parameters for updating an Storage sync service. + + :param tags: The user-specified tags associated with the storage sync + service. + :type tags: dict[str, str] + :param properties: The properties of the storage sync service. + :type properties: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, tags=None, properties=None, **kwargs) -> None: + super(StorageSyncServiceUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.properties = properties diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/subscription_state.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/subscription_state.py new file mode 100644 index 000000000000..20d18d8dc12c --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/subscription_state.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubscriptionState(Model): + """Subscription State object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param state: State of Azure Subscription. Possible values include: + 'Registered', 'Unregistered', 'Warned', 'Suspended', 'Deleted' + :type state: str or ~azure.mgmt.storagesync.models.Reason + :ivar istransitioning: Is Transitioning + :vartype istransitioning: bool + :param properties: Subscription state properties. + :type properties: object + """ + + _validation = { + 'istransitioning': {'readonly': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'istransitioning': {'key': 'istransitioning', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(SubscriptionState, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.istransitioning = None + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/subscription_state_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/subscription_state_py3.py new file mode 100644 index 000000000000..8d56b794f628 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/subscription_state_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubscriptionState(Model): + """Subscription State object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param state: State of Azure Subscription. Possible values include: + 'Registered', 'Unregistered', 'Warned', 'Suspended', 'Deleted' + :type state: str or ~azure.mgmt.storagesync.models.Reason + :ivar istransitioning: Is Transitioning + :vartype istransitioning: bool + :param properties: Subscription state properties. + :type properties: object + """ + + _validation = { + 'istransitioning': {'readonly': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'istransitioning': {'key': 'istransitioning', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, state=None, properties=None, **kwargs) -> None: + super(SubscriptionState, self).__init__(**kwargs) + self.state = state + self.istransitioning = None + self.properties = properties diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_activity_status.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_activity_status.py new file mode 100644 index 000000000000..03353341d74b --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_activity_status.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SyncActivityStatus(Model): + """Sync Session status object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar timestamp: Timestamp when properties were updated + :vartype timestamp: datetime + :ivar per_item_error_count: Per item error count + :vartype per_item_error_count: long + :ivar applied_item_count: Applied item count. + :vartype applied_item_count: long + :ivar total_item_count: Total item count (if available) + :vartype total_item_count: long + :ivar applied_bytes: Applied bytes + :vartype applied_bytes: long + :ivar total_bytes: Total bytes (if available) + :vartype total_bytes: long + """ + + _validation = { + 'timestamp': {'readonly': True}, + 'per_item_error_count': {'readonly': True}, + 'applied_item_count': {'readonly': True}, + 'total_item_count': {'readonly': True}, + 'applied_bytes': {'readonly': True}, + 'total_bytes': {'readonly': True}, + } + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'per_item_error_count': {'key': 'perItemErrorCount', 'type': 'long'}, + 'applied_item_count': {'key': 'appliedItemCount', 'type': 'long'}, + 'total_item_count': {'key': 'totalItemCount', 'type': 'long'}, + 'applied_bytes': {'key': 'appliedBytes', 'type': 'long'}, + 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(SyncActivityStatus, self).__init__(**kwargs) + self.timestamp = None + self.per_item_error_count = None + self.applied_item_count = None + self.total_item_count = None + self.applied_bytes = None + self.total_bytes = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_activity_status_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_activity_status_py3.py new file mode 100644 index 000000000000..bf137c2f6a52 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_activity_status_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SyncActivityStatus(Model): + """Sync Session status object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar timestamp: Timestamp when properties were updated + :vartype timestamp: datetime + :ivar per_item_error_count: Per item error count + :vartype per_item_error_count: long + :ivar applied_item_count: Applied item count. + :vartype applied_item_count: long + :ivar total_item_count: Total item count (if available) + :vartype total_item_count: long + :ivar applied_bytes: Applied bytes + :vartype applied_bytes: long + :ivar total_bytes: Total bytes (if available) + :vartype total_bytes: long + """ + + _validation = { + 'timestamp': {'readonly': True}, + 'per_item_error_count': {'readonly': True}, + 'applied_item_count': {'readonly': True}, + 'total_item_count': {'readonly': True}, + 'applied_bytes': {'readonly': True}, + 'total_bytes': {'readonly': True}, + } + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'per_item_error_count': {'key': 'perItemErrorCount', 'type': 'long'}, + 'applied_item_count': {'key': 'appliedItemCount', 'type': 'long'}, + 'total_item_count': {'key': 'totalItemCount', 'type': 'long'}, + 'applied_bytes': {'key': 'appliedBytes', 'type': 'long'}, + 'total_bytes': {'key': 'totalBytes', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(SyncActivityStatus, self).__init__(**kwargs) + self.timestamp = None + self.per_item_error_count = None + self.applied_item_count = None + self.total_item_count = None + self.applied_bytes = None + self.total_bytes = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group.py new file mode 100644 index 000000000000..8b483ca16437 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class SyncGroup(ProxyResource): + """Sync Group object. + + 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 unique_id: Unique Id + :type unique_id: str + :ivar sync_group_status: Sync group status + :vartype sync_group_status: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sync_group_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, + 'sync_group_status': {'key': 'properties.syncGroupStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SyncGroup, self).__init__(**kwargs) + self.unique_id = kwargs.get('unique_id', None) + self.sync_group_status = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group_create_parameters.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group_create_parameters.py new file mode 100644 index 000000000000..b849f3819c7e --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group_create_parameters.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class SyncGroupCreateParameters(ProxyResource): + """The parameters used when creating a sync group. + + 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 properties: The parameters used to create the sync group + :type properties: object + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(SyncGroupCreateParameters, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group_create_parameters_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group_create_parameters_py3.py new file mode 100644 index 000000000000..85d13ef96c34 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group_create_parameters_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +class SyncGroupCreateParameters(ProxyResource): + """The parameters used when creating a sync group. + + 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 properties: The parameters used to create the sync group + :type properties: object + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(SyncGroupCreateParameters, self).__init__(**kwargs) + self.properties = properties diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group_paged.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group_paged.py new file mode 100644 index 000000000000..cf4ed77592c2 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SyncGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`SyncGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SyncGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(SyncGroupPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group_py3.py new file mode 100644 index 000000000000..0c3721525fc4 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_group_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +class SyncGroup(ProxyResource): + """Sync Group object. + + 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 unique_id: Unique Id + :type unique_id: str + :ivar sync_group_status: Sync group status + :vartype sync_group_status: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sync_group_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, + 'sync_group_status': {'key': 'properties.syncGroupStatus', 'type': 'str'}, + } + + def __init__(self, *, unique_id: str=None, **kwargs) -> None: + super(SyncGroup, self).__init__(**kwargs) + self.unique_id = unique_id + self.sync_group_status = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_session_status.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_session_status.py new file mode 100644 index 000000000000..71ee1a7aec4b --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_session_status.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SyncSessionStatus(Model): + """Sync Session status object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_sync_result: Last sync result (HResult) + :vartype last_sync_result: int + :ivar last_sync_timestamp: Last sync timestamp + :vartype last_sync_timestamp: datetime + :ivar last_sync_success_timestamp: Last sync success timestamp + :vartype last_sync_success_timestamp: datetime + :ivar last_sync_per_item_error_count: Last sync per item error count. + :vartype last_sync_per_item_error_count: long + :ivar persistent_files_not_syncing_count: Count of persistent files not + syncing. Reserved for future use. + :vartype persistent_files_not_syncing_count: long + :ivar transient_files_not_syncing_count: Count of transient files not + syncing. Reserved for future use. + :vartype transient_files_not_syncing_count: long + :ivar files_not_syncing_errors: Array of per-item errors coming from the + last sync session. Reserved for future use. + :vartype files_not_syncing_errors: + list[~azure.mgmt.storagesync.models.FilesNotSyncingError] + """ + + _validation = { + 'last_sync_result': {'readonly': True}, + 'last_sync_timestamp': {'readonly': True}, + 'last_sync_success_timestamp': {'readonly': True}, + 'last_sync_per_item_error_count': {'readonly': True}, + 'persistent_files_not_syncing_count': {'readonly': True}, + 'transient_files_not_syncing_count': {'readonly': True}, + 'files_not_syncing_errors': {'readonly': True}, + } + + _attribute_map = { + 'last_sync_result': {'key': 'lastSyncResult', 'type': 'int'}, + 'last_sync_timestamp': {'key': 'lastSyncTimestamp', 'type': 'iso-8601'}, + 'last_sync_success_timestamp': {'key': 'lastSyncSuccessTimestamp', 'type': 'iso-8601'}, + 'last_sync_per_item_error_count': {'key': 'lastSyncPerItemErrorCount', 'type': 'long'}, + 'persistent_files_not_syncing_count': {'key': 'persistentFilesNotSyncingCount', 'type': 'long'}, + 'transient_files_not_syncing_count': {'key': 'transientFilesNotSyncingCount', 'type': 'long'}, + 'files_not_syncing_errors': {'key': 'filesNotSyncingErrors', 'type': '[FilesNotSyncingError]'}, + } + + def __init__(self, **kwargs): + super(SyncSessionStatus, self).__init__(**kwargs) + self.last_sync_result = None + self.last_sync_timestamp = None + self.last_sync_success_timestamp = None + self.last_sync_per_item_error_count = None + self.persistent_files_not_syncing_count = None + self.transient_files_not_syncing_count = None + self.files_not_syncing_errors = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_session_status_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_session_status_py3.py new file mode 100644 index 000000000000..fafec1ea77c8 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/sync_session_status_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SyncSessionStatus(Model): + """Sync Session status object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_sync_result: Last sync result (HResult) + :vartype last_sync_result: int + :ivar last_sync_timestamp: Last sync timestamp + :vartype last_sync_timestamp: datetime + :ivar last_sync_success_timestamp: Last sync success timestamp + :vartype last_sync_success_timestamp: datetime + :ivar last_sync_per_item_error_count: Last sync per item error count. + :vartype last_sync_per_item_error_count: long + :ivar persistent_files_not_syncing_count: Count of persistent files not + syncing. Reserved for future use. + :vartype persistent_files_not_syncing_count: long + :ivar transient_files_not_syncing_count: Count of transient files not + syncing. Reserved for future use. + :vartype transient_files_not_syncing_count: long + :ivar files_not_syncing_errors: Array of per-item errors coming from the + last sync session. Reserved for future use. + :vartype files_not_syncing_errors: + list[~azure.mgmt.storagesync.models.FilesNotSyncingError] + """ + + _validation = { + 'last_sync_result': {'readonly': True}, + 'last_sync_timestamp': {'readonly': True}, + 'last_sync_success_timestamp': {'readonly': True}, + 'last_sync_per_item_error_count': {'readonly': True}, + 'persistent_files_not_syncing_count': {'readonly': True}, + 'transient_files_not_syncing_count': {'readonly': True}, + 'files_not_syncing_errors': {'readonly': True}, + } + + _attribute_map = { + 'last_sync_result': {'key': 'lastSyncResult', 'type': 'int'}, + 'last_sync_timestamp': {'key': 'lastSyncTimestamp', 'type': 'iso-8601'}, + 'last_sync_success_timestamp': {'key': 'lastSyncSuccessTimestamp', 'type': 'iso-8601'}, + 'last_sync_per_item_error_count': {'key': 'lastSyncPerItemErrorCount', 'type': 'long'}, + 'persistent_files_not_syncing_count': {'key': 'persistentFilesNotSyncingCount', 'type': 'long'}, + 'transient_files_not_syncing_count': {'key': 'transientFilesNotSyncingCount', 'type': 'long'}, + 'files_not_syncing_errors': {'key': 'filesNotSyncingErrors', 'type': '[FilesNotSyncingError]'}, + } + + def __init__(self, **kwargs) -> None: + super(SyncSessionStatus, self).__init__(**kwargs) + self.last_sync_result = None + self.last_sync_timestamp = None + self.last_sync_success_timestamp = None + self.last_sync_per_item_error_count = None + self.persistent_files_not_syncing_count = None + self.transient_files_not_syncing_count = None + self.files_not_syncing_errors = None diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/tracked_resource.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/tracked_resource.py new file mode 100644 index 000000000000..27ab94c7a8dd --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/tracked_resource.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/tracked_resource_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/tracked_resource_py3.py new file mode 100644 index 000000000000..b28cc1859448 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/tracked_resource_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/trigger_rollover_request.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/trigger_rollover_request.py new file mode 100644 index 000000000000..3a691fbfb6a9 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/trigger_rollover_request.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TriggerRolloverRequest(Model): + """Trigger Rollover Request. + + :param server_certificate: Certificate Data + :type server_certificate: str + """ + + _attribute_map = { + 'server_certificate': {'key': 'serverCertificate', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TriggerRolloverRequest, self).__init__(**kwargs) + self.server_certificate = kwargs.get('server_certificate', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/trigger_rollover_request_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/trigger_rollover_request_py3.py new file mode 100644 index 000000000000..b79783439066 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/trigger_rollover_request_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TriggerRolloverRequest(Model): + """Trigger Rollover Request. + + :param server_certificate: Certificate Data + :type server_certificate: str + """ + + _attribute_map = { + 'server_certificate': {'key': 'serverCertificate', 'type': 'str'}, + } + + def __init__(self, *, server_certificate: str=None, **kwargs) -> None: + super(TriggerRolloverRequest, self).__init__(**kwargs) + self.server_certificate = server_certificate diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/workflow.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/workflow.py new file mode 100644 index 000000000000..f77bbd7fc476 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/workflow.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class Workflow(ProxyResource): + """Workflow 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 last_step_name: last step name + :type last_step_name: str + :param status: workflow status. Possible values include: 'active', + 'expired', 'succeeded', 'aborted', 'failed' + :type status: str or ~azure.mgmt.storagesync.models.enum + :param operation: operation direction. Possible values include: 'do', + 'undo', 'cancel' + :type operation: str or ~azure.mgmt.storagesync.models.enum + :param steps: workflow steps + :type steps: str + :param last_operation_id: workflow last operation identifier. + :type last_operation_id: str + """ + + _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'}, + 'last_step_name': {'key': 'properties.lastStepName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'operation': {'key': 'properties.operation', 'type': 'str'}, + 'steps': {'key': 'properties.steps', 'type': 'str'}, + 'last_operation_id': {'key': 'properties.lastOperationId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Workflow, self).__init__(**kwargs) + self.last_step_name = kwargs.get('last_step_name', None) + self.status = kwargs.get('status', None) + self.operation = kwargs.get('operation', None) + self.steps = kwargs.get('steps', None) + self.last_operation_id = kwargs.get('last_operation_id', None) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/workflow_paged.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/workflow_paged.py new file mode 100644 index 000000000000..1eae6f26f1ba --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/workflow_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class WorkflowPaged(Paged): + """ + A paging container for iterating over a list of :class:`Workflow ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Workflow]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkflowPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/models/workflow_py3.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/workflow_py3.py new file mode 100644 index 000000000000..1b42835730ed --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/models/workflow_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +class Workflow(ProxyResource): + """Workflow 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 last_step_name: last step name + :type last_step_name: str + :param status: workflow status. Possible values include: 'active', + 'expired', 'succeeded', 'aborted', 'failed' + :type status: str or ~azure.mgmt.storagesync.models.enum + :param operation: operation direction. Possible values include: 'do', + 'undo', 'cancel' + :type operation: str or ~azure.mgmt.storagesync.models.enum + :param steps: workflow steps + :type steps: str + :param last_operation_id: workflow last operation identifier. + :type last_operation_id: str + """ + + _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'}, + 'last_step_name': {'key': 'properties.lastStepName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'operation': {'key': 'properties.operation', 'type': 'str'}, + 'steps': {'key': 'properties.steps', 'type': 'str'}, + 'last_operation_id': {'key': 'properties.lastOperationId', 'type': 'str'}, + } + + def __init__(self, *, last_step_name: str=None, status=None, operation=None, steps: str=None, last_operation_id: str=None, **kwargs) -> None: + super(Workflow, self).__init__(**kwargs) + self.last_step_name = last_step_name + self.status = status + self.operation = operation + self.steps = steps + self.last_operation_id = last_operation_id diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/__init__.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/__init__.py new file mode 100644 index 000000000000..d4c402966ab6 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/__init__.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .operations import Operations +from .storage_sync_services_operations import StorageSyncServicesOperations +from .sync_groups_operations import SyncGroupsOperations +from .cloud_endpoints_operations import CloudEndpointsOperations +from .server_endpoints_operations import ServerEndpointsOperations +from .registered_servers_operations import RegisteredServersOperations +from .workflows_operations import WorkflowsOperations + +__all__ = [ + 'Operations', + 'StorageSyncServicesOperations', + 'SyncGroupsOperations', + 'CloudEndpointsOperations', + 'ServerEndpointsOperations', + 'RegisteredServersOperations', + 'WorkflowsOperations', +] diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/cloud_endpoints_operations.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/cloud_endpoints_operations.py new file mode 100644 index 000000000000..3e257e576ed3 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/cloud_endpoints_operations.py @@ -0,0 +1,926 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class CloudEndpointsOperations(object): + """CloudEndpointsOperations operations. + + :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: "2019-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-02-01" + + self.config = config + + + def _create_initial( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), + 'cloudEndpointName': self._serialize.url("cloud_endpoint_name", cloud_endpoint_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(parameters, 'CloudEndpointCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.StorageSyncErrorException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('CloudEndpoint', response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a new CloudEndpoint. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param cloud_endpoint_name: Name of Cloud Endpoint object. + :type cloud_endpoint_name: str + :param parameters: Body of Cloud Endpoint resource. + :type parameters: + ~azure.mgmt.storagesync.models.CloudEndpointCreateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns CloudEndpoint or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storagesync.models.CloudEndpoint] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storagesync.models.CloudEndpoint]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + sync_group_name=sync_group_name, + cloud_endpoint_name=cloud_endpoint_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('CloudEndpoint', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} + + def get( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, custom_headers=None, raw=False, **operation_config): + """Get a given CloudEndpoint. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param cloud_endpoint_name: Name of Cloud Endpoint object. + :type cloud_endpoint_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: CloudEndpoint or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storagesync.models.CloudEndpoint or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`StorageSyncErrorException` + """ + # Construct URL + url = self.get.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), + 'cloudEndpointName': self._serialize.url("cloud_endpoint_name", cloud_endpoint_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 + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('CloudEndpoint', response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} + + + def _delete_initial( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), + 'cloudEndpointName': self._serialize.url("cloud_endpoint_name", cloud_endpoint_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.StorageSyncErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def delete( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a given CloudEndpoint. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param cloud_endpoint_name: Name of Cloud Endpoint object. + :type cloud_endpoint_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + sync_group_name=sync_group_name, + cloud_endpoint_name=cloud_endpoint_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} + + def list_by_sync_group( + self, resource_group_name, storage_sync_service_name, sync_group_name, custom_headers=None, raw=False, **operation_config): + """Get a CloudEndpoint 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 sync_group_name: Name of Sync Group resource. + :type sync_group_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 CloudEndpoint + :rtype: + ~azure.mgmt.storagesync.models.CloudEndpointPaged[~azure.mgmt.storagesync.models.CloudEndpoint] + :raises: + :class:`StorageSyncErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_sync_group.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_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) + 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 + deserialized = models.CloudEndpointPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CloudEndpointPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_sync_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints'} + + + def _pre_backup_initial( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, azure_file_share=None, custom_headers=None, raw=False, **operation_config): + parameters = models.BackupRequest(azure_file_share=azure_file_share) + + # Construct URL + url = self.pre_backup.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), + 'cloudEndpointName': self._serialize.url("cloud_endpoint_name", cloud_endpoint_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['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(parameters, 'BackupRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.StorageSyncErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Location': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def pre_backup( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, azure_file_share=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Pre Backup a given CloudEndpoint. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param cloud_endpoint_name: Name of Cloud Endpoint object. + :type cloud_endpoint_name: str + :param azure_file_share: Azure File Share. + :type azure_file_share: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._pre_backup_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + sync_group_name=sync_group_name, + cloud_endpoint_name=cloud_endpoint_name, + azure_file_share=azure_file_share, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Location': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + pre_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup'} + + + def _post_backup_initial( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, azure_file_share=None, custom_headers=None, raw=False, **operation_config): + parameters = models.BackupRequest(azure_file_share=azure_file_share) + + # Construct URL + url = self.post_backup.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), + 'cloudEndpointName': self._serialize.url("cloud_endpoint_name", cloud_endpoint_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(parameters, 'BackupRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.StorageSyncErrorException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('PostBackupResponse', response) + header_dict = { + 'Location': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def post_backup( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, azure_file_share=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Post Backup a given CloudEndpoint. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param cloud_endpoint_name: Name of Cloud Endpoint object. + :type cloud_endpoint_name: str + :param azure_file_share: Azure File Share. + :type azure_file_share: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PostBackupResponse or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storagesync.models.PostBackupResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storagesync.models.PostBackupResponse]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._post_backup_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + sync_group_name=sync_group_name, + cloud_endpoint_name=cloud_endpoint_name, + azure_file_share=azure_file_share, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + deserialized = self._deserialize('PostBackupResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + post_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup'} + + + def _pre_restore_initial( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.pre_restore.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), + 'cloudEndpointName': self._serialize.url("cloud_endpoint_name", cloud_endpoint_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['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(parameters, 'PreRestoreRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.StorageSyncErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Location': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def pre_restore( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Pre Restore a given CloudEndpoint. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param cloud_endpoint_name: Name of Cloud Endpoint object. + :type cloud_endpoint_name: str + :param parameters: Body of Cloud Endpoint object. + :type parameters: ~azure.mgmt.storagesync.models.PreRestoreRequest + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._pre_restore_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + sync_group_name=sync_group_name, + cloud_endpoint_name=cloud_endpoint_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Location': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + pre_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore'} + + def restoreheartbeat( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, custom_headers=None, raw=False, **operation_config): + """Restore Heartbeat a given CloudEndpoint. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param cloud_endpoint_name: Name of Cloud Endpoint object. + :type cloud_endpoint_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.restoreheartbeat.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), + 'cloudEndpointName': self._serialize.url("cloud_endpoint_name", cloud_endpoint_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.post(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) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + }) + return client_raw_response + restoreheartbeat.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/restoreheartbeat'} + + + def _post_restore_initial( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.post_restore.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), + 'cloudEndpointName': self._serialize.url("cloud_endpoint_name", cloud_endpoint_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['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(parameters, 'PostRestoreRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.StorageSyncErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Location': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def post_restore( + self, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Post Restore a given CloudEndpoint. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param cloud_endpoint_name: Name of Cloud Endpoint object. + :type cloud_endpoint_name: str + :param parameters: Body of Cloud Endpoint object. + :type parameters: ~azure.mgmt.storagesync.models.PostRestoreRequest + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._post_restore_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + sync_group_name=sync_group_name, + cloud_endpoint_name=cloud_endpoint_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Location': 'str', + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + post_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore'} diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/operations.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/operations.py new file mode 100644 index 000000000000..6ec9ce2deeed --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/operations.py @@ -0,0 +1,96 @@ +# 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 Operations(object): + """Operations operations. + + :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: "2019-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-02-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Storage Sync Rest API operations. + + :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 OperationEntity + :rtype: + ~azure.mgmt.storagesync.models.OperationEntityPaged[~azure.mgmt.storagesync.models.OperationEntity] + :raises: + :class:`StorageSyncErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # 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) + 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 + deserialized = models.OperationEntityPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationEntityPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.StorageSync/operations'} diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/registered_servers_operations.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/registered_servers_operations.py new file mode 100644 index 000000000000..d372109c708a --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/registered_servers_operations.py @@ -0,0 +1,502 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class RegisteredServersOperations(object): + """RegisteredServersOperations operations. + + :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: "2019-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-02-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): + """Get a given registered server 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 RegisteredServer + :rtype: + ~azure.mgmt.storagesync.models.RegisteredServerPaged[~azure.mgmt.storagesync.models.RegisteredServer] + :raises: + :class:`StorageSyncErrorException` + """ + def internal_paging(next_link=None, raw=False): + + 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) + 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 + deserialized = models.RegisteredServerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RegisteredServerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers'} + + def get( + self, resource_group_name, storage_sync_service_name, server_id, custom_headers=None, raw=False, **operation_config): + """Get a given registered server. + + :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 server_id: GUID identifying the on-premises server. + :type server_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RegisteredServer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storagesync.models.RegisteredServer or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`StorageSyncErrorException` + """ + # Construct URL + url = self.get.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'), + 'serverId': self._serialize.url("server_id", server_id, '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 + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('RegisteredServer', response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + + + def _create_initial( + self, resource_group_name, storage_sync_service_name, server_id, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.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'), + 'serverId': self._serialize.url("server_id", server_id, '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(parameters, 'RegisteredServerCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.StorageSyncErrorException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('RegisteredServer', response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, storage_sync_service_name, server_id, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Add a new registered server. + + :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 server_id: GUID identifying the on-premises server. + :type server_id: str + :param parameters: Body of Registered Server object. + :type parameters: + ~azure.mgmt.storagesync.models.RegisteredServerCreateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RegisteredServer or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storagesync.models.RegisteredServer] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storagesync.models.RegisteredServer]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + server_id=server_id, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + } + deserialized = self._deserialize('RegisteredServer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + + + def _delete_initial( + self, resource_group_name, storage_sync_service_name, server_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.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'), + 'serverId': self._serialize.url("server_id", server_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.StorageSyncErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Location': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def delete( + self, resource_group_name, storage_sync_service_name, server_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete the given registered server. + + :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 server_id: GUID identifying the on-premises server. + :type server_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + server_id=server_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Location': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + + + def _trigger_rollover_initial( + self, resource_group_name, storage_sync_service_name, server_id, server_certificate=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TriggerRolloverRequest(server_certificate=server_certificate) + + # Construct URL + url = self.trigger_rollover.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'), + 'serverId': self._serialize.url("server_id", server_id, '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['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(parameters, 'TriggerRolloverRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.StorageSyncErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Location': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def trigger_rollover( + self, resource_group_name, storage_sync_service_name, server_id, server_certificate=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Triggers Server certificate rollover. + + :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 server_id: Server Id + :type server_id: str + :param server_certificate: Certificate Data + :type server_certificate: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._trigger_rollover_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + server_id=server_id, + server_certificate=server_certificate, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Location': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + trigger_rollover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover'} diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/server_endpoints_operations.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/server_endpoints_operations.py new file mode 100644 index 000000000000..ca95bbedf58a --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/server_endpoints_operations.py @@ -0,0 +1,651 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ServerEndpointsOperations(object): + """ServerEndpointsOperations operations. + + :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: "2019-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-02-01" + + self.config = config + + + def _create_initial( + self, resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), + 'serverEndpointName': self._serialize.url("server_endpoint_name", server_endpoint_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(parameters, 'ServerEndpointCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.StorageSyncErrorException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ServerEndpoint', response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a new ServerEndpoint. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param server_endpoint_name: Name of Server Endpoint object. + :type server_endpoint_name: str + :param parameters: Body of Server Endpoint object. + :type parameters: + ~azure.mgmt.storagesync.models.ServerEndpointCreateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ServerEndpoint or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storagesync.models.ServerEndpoint] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storagesync.models.ServerEndpoint]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + sync_group_name=sync_group_name, + server_endpoint_name=server_endpoint_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + } + deserialized = self._deserialize('ServerEndpoint', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + + + def _update_initial( + self, resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, parameters=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', 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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), + 'serverEndpointName': self._serialize.url("server_endpoint_name", server_endpoint_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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'ServerEndpointUpdateParameters') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.StorageSyncErrorException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ServerEndpoint', response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, parameters=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Patch a given ServerEndpoint. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param server_endpoint_name: Name of Server Endpoint object. + :type server_endpoint_name: str + :param parameters: Any of the properties applicable in PUT request. + :type parameters: + ~azure.mgmt.storagesync.models.ServerEndpointUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ServerEndpoint or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storagesync.models.ServerEndpoint] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storagesync.models.ServerEndpoint]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + sync_group_name=sync_group_name, + server_endpoint_name=server_endpoint_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + } + deserialized = self._deserialize('ServerEndpoint', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + + def get( + self, resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, custom_headers=None, raw=False, **operation_config): + """Get a ServerEndpoint. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param server_endpoint_name: Name of Server Endpoint object. + :type server_endpoint_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: ServerEndpoint or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storagesync.models.ServerEndpoint or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`StorageSyncErrorException` + """ + # Construct URL + url = self.get.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), + 'serverEndpointName': self._serialize.url("server_endpoint_name", server_endpoint_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 + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ServerEndpoint', response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + + + def _delete_initial( + self, resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), + 'serverEndpointName': self._serialize.url("server_endpoint_name", server_endpoint_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.StorageSyncErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Location': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def delete( + self, resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a given ServerEndpoint. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param server_endpoint_name: Name of Server Endpoint object. + :type server_endpoint_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + sync_group_name=sync_group_name, + server_endpoint_name=server_endpoint_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Location': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + + def list_by_sync_group( + self, resource_group_name, storage_sync_service_name, sync_group_name, custom_headers=None, raw=False, **operation_config): + """Get a ServerEndpoint 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 sync_group_name: Name of Sync Group resource. + :type sync_group_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 ServerEndpoint + :rtype: + ~azure.mgmt.storagesync.models.ServerEndpointPaged[~azure.mgmt.storagesync.models.ServerEndpoint] + :raises: + :class:`StorageSyncErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_sync_group.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_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) + 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 + deserialized = models.ServerEndpointPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ServerEndpointPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_sync_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints'} + + + def _recall_action_initial( + self, resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, pattern=None, recall_path=None, custom_headers=None, raw=False, **operation_config): + parameters = models.RecallActionParameters(pattern=pattern, recall_path=recall_path) + + # Construct URL + url = self.recall_action.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), + 'serverEndpointName': self._serialize.url("server_endpoint_name", server_endpoint_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['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(parameters, 'RecallActionParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.StorageSyncErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Location': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def recall_action( + self, resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, pattern=None, recall_path=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Recall a server endpoint. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param server_endpoint_name: Name of Server Endpoint object. + :type server_endpoint_name: str + :param pattern: Pattern of the files. + :type pattern: str + :param recall_path: Recall path. + :type recall_path: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`StorageSyncErrorException` + """ + raw_result = self._recall_action_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + sync_group_name=sync_group_name, + server_endpoint_name=server_endpoint_name, + pattern=pattern, + recall_path=recall_path, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + 'Location': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + recall_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction'} diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/storage_sync_services_operations.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/storage_sync_services_operations.py new file mode 100644 index 000000000000..a113bd836e17 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/storage_sync_services_operations.py @@ -0,0 +1,517 @@ +# 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 StorageSyncServicesOperations(object): + """StorageSyncServicesOperations operations. + + :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: "2019-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-02-01" + + self.config = config + + def check_name_availability( + self, location_name, name, custom_headers=None, raw=False, **operation_config): + """Check the give namespace name availability. + + :param location_name: The desired region for the name check. + :type location_name: str + :param name: The name to check for availability + :type 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: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storagesync.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.CheckNameAvailabilityParameters(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'locationName': self._serialize.url("location_name", location_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' + 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(parameters, 'CheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/checkNameAvailability'} + + def create( + self, resource_group_name, storage_sync_service_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a new StorageSyncService. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storage_sync_service_name: Name of Storage Sync Service + resource. + :type storage_sync_service_name: str + :param parameters: Storage Sync Service resource name. + :type parameters: + ~azure.mgmt.storagesync.models.StorageSyncServiceCreateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageSyncService or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storagesync.models.StorageSyncService or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`StorageSyncErrorException` + """ + # Construct URL + url = self.create.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) + + # 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(parameters, 'StorageSyncServiceCreateParameters') + + # 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('StorageSyncService', 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}'} + + def get( + self, resource_group_name, storage_sync_service_name, custom_headers=None, raw=False, **operation_config): + """Get a given StorageSyncService. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storage_sync_service_name: Name of Storage Sync Service + resource. + :type storage_sync_service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageSyncService or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storagesync.models.StorageSyncService or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`StorageSyncErrorException` + """ + # Construct URL + url = self.get.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) + + # 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 + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('StorageSyncService', response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + + def update( + self, resource_group_name, storage_sync_service_name, tags=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Patch a given StorageSyncService. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param storage_sync_service_name: Name of Storage Sync Service + resource. + :type storage_sync_service_name: str + :param tags: The user-specified tags associated with the storage sync + service. + :type tags: dict[str, str] + :param properties: The properties of the storage sync service. + :type properties: object + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageSyncService or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storagesync.models.StorageSyncService or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`StorageSyncErrorException` + """ + parameters = None + if tags is not None or properties is not None: + parameters = models.StorageSyncServiceUpdateParameters(tags=tags, properties=properties) + + # Construct URL + url = self.update.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) + + # 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'StorageSyncServiceUpdateParameters') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.StorageSyncErrorException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('StorageSyncService', response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + + def delete( + self, resource_group_name, storage_sync_service_name, custom_headers=None, raw=False, **operation_config): + """Delete a given StorageSyncService. + + :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: 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 = { + '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) + + # 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) + client_raw_response.add_headers({ + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + }) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get a StorageSyncService list by Resource group name. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_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 StorageSyncService + :rtype: + ~azure.mgmt.storagesync.models.StorageSyncServicePaged[~azure.mgmt.storagesync.models.StorageSyncService] + :raises: + :class:`StorageSyncErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.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\._\(\)]+$') + } + 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) + 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 + deserialized = models.StorageSyncServicePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.StorageSyncServicePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Get a StorageSyncService list by subscription. + + :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 StorageSyncService + :rtype: + ~azure.mgmt.storagesync.models.StorageSyncServicePaged[~azure.mgmt.storagesync.models.StorageSyncService] + :raises: + :class:`StorageSyncErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + '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) + + 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) + 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 + deserialized = models.StorageSyncServicePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.StorageSyncServicePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/storageSyncServices'} diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/sync_groups_operations.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/sync_groups_operations.py new file mode 100644 index 000000000000..707da9413192 --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/sync_groups_operations.py @@ -0,0 +1,321 @@ +# 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 SyncGroupsOperations(object): + """SyncGroupsOperations operations. + + :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: "2019-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-02-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): + """Get a SyncGroup 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 SyncGroup + :rtype: + ~azure.mgmt.storagesync.models.SyncGroupPaged[~azure.mgmt.storagesync.models.SyncGroup] + :raises: + :class:`StorageSyncErrorException` + """ + def internal_paging(next_link=None, raw=False): + + 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) + 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 + deserialized = models.SyncGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SyncGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups'} + + def create( + self, resource_group_name, storage_sync_service_name, sync_group_name, properties=None, custom_headers=None, raw=False, **operation_config): + """Create a new SyncGroup. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_name: str + :param properties: The parameters used to create the sync group + :type properties: object + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SyncGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storagesync.models.SyncGroup or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`StorageSyncErrorException` + """ + parameters = models.SyncGroupCreateParameters(properties=properties) + + # Construct URL + url = self.create.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_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(parameters, 'SyncGroupCreateParameters') + + # 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 + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('SyncGroup', response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} + + def get( + self, resource_group_name, storage_sync_service_name, sync_group_name, custom_headers=None, raw=False, **operation_config): + """Get a given SyncGroup. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_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: SyncGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storagesync.models.SyncGroup or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`StorageSyncErrorException` + """ + # Construct URL + url = self.get.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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_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 + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('SyncGroup', response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} + + def delete( + self, resource_group_name, storage_sync_service_name, sync_group_name, custom_headers=None, raw=False, **operation_config): + """Delete a given SyncGroup. + + :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 sync_group_name: Name of Sync Group resource. + :type sync_group_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 = { + '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'), + 'syncGroupName': self._serialize.url("sync_group_name", sync_group_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) + client_raw_response.add_headers({ + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + }) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/workflows_operations.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/workflows_operations.py new file mode 100644 index 000000000000..dec1e43b855e --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/operations/workflows_operations.py @@ -0,0 +1,241 @@ +# 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 WorkflowsOperations(object): + """WorkflowsOperations operations. + + :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: "2019-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-02-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): + """Get a Workflow 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 Workflow + :rtype: + ~azure.mgmt.storagesync.models.WorkflowPaged[~azure.mgmt.storagesync.models.Workflow] + :raises: + :class:`StorageSyncErrorException` + """ + def internal_paging(next_link=None, raw=False): + + 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) + 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 + deserialized = models.WorkflowPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.WorkflowPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows'} + + def get( + self, resource_group_name, storage_sync_service_name, workflow_id, custom_headers=None, raw=False, **operation_config): + """Get Workflows resource. + + :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 workflow_id: workflow Id + :type workflow_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Workflow or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storagesync.models.Workflow or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`StorageSyncErrorException` + """ + # Construct URL + url = self.get.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'), + 'workflowId': self._serialize.url("workflow_id", workflow_id, '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 + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('Workflow', response) + header_dict = { + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}'} + + def abort( + self, resource_group_name, storage_sync_service_name, workflow_id, custom_headers=None, raw=False, **operation_config): + """Abort the given workflow. + + :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 workflow_id: workflow Id + :type workflow_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`StorageSyncErrorException` + """ + # Construct URL + url = self.abort.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'), + 'workflowId': self._serialize.url("workflow_id", workflow_id, '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.post(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) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-request-id': 'str', + 'x-ms-correlation-request-id': 'str', + }) + return client_raw_response + abort.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}/abort'} diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/storage_sync_management_client.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/storage_sync_management_client.py new file mode 100644 index 000000000000..da0b709553ec --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/storage_sync_management_client.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.operations import Operations +from .operations.storage_sync_services_operations import StorageSyncServicesOperations +from .operations.sync_groups_operations import SyncGroupsOperations +from .operations.cloud_endpoints_operations import CloudEndpointsOperations +from .operations.server_endpoints_operations import ServerEndpointsOperations +from .operations.registered_servers_operations import RegisteredServersOperations +from .operations.workflows_operations import WorkflowsOperations +from . import models + + +class StorageSyncManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageSyncManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(StorageSyncManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-storagesync/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class StorageSyncManagementClient(SDKClient): + """Microsoft Storage Sync Service API + + :ivar config: Configuration for client. + :vartype config: StorageSyncManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storagesync.operations.Operations + :ivar storage_sync_services: StorageSyncServices operations + :vartype storage_sync_services: azure.mgmt.storagesync.operations.StorageSyncServicesOperations + :ivar sync_groups: SyncGroups operations + :vartype sync_groups: azure.mgmt.storagesync.operations.SyncGroupsOperations + :ivar cloud_endpoints: CloudEndpoints operations + :vartype cloud_endpoints: azure.mgmt.storagesync.operations.CloudEndpointsOperations + :ivar server_endpoints: ServerEndpoints operations + :vartype server_endpoints: azure.mgmt.storagesync.operations.ServerEndpointsOperations + :ivar registered_servers: RegisteredServers operations + :vartype registered_servers: azure.mgmt.storagesync.operations.RegisteredServersOperations + :ivar workflows: Workflows operations + :vartype workflows: azure.mgmt.storagesync.operations.WorkflowsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageSyncManagementClientConfiguration(credentials, subscription_id, base_url) + 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-02-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.storage_sync_services = StorageSyncServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.sync_groups = SyncGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.cloud_endpoints = CloudEndpointsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.server_endpoints = ServerEndpointsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.registered_servers = RegisteredServersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workflows = WorkflowsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-storagesync/azure/mgmt/storagesync/version.py b/azure-mgmt-storagesync/azure/mgmt/storagesync/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-storagesync/azure/mgmt/storagesync/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + diff --git a/azure-mgmt-storagesync/sdk_packaging.toml b/azure-mgmt-storagesync/sdk_packaging.toml new file mode 100644 index 000000000000..f86b64dcbf49 --- /dev/null +++ b/azure-mgmt-storagesync/sdk_packaging.toml @@ -0,0 +1,5 @@ +[packaging] +package_name = "azure-mgmt-storagesync" +package_pprint_name = "Storage Sync" +package_doc_id = "" +is_stable = false diff --git a/azure-mgmt-storagesync/setup.cfg b/azure-mgmt-storagesync/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-storagesync/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-storagesync/setup.py b/azure-mgmt-storagesync/setup.py new file mode 100644 index 000000000000..d84f1437c36c --- /dev/null +++ b/azure-mgmt-storagesync/setup.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-storagesync" +PACKAGE_PPRINT_NAME = "Storage Sync" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)