From a7a89010191ce38584bd5a87ed19601a244157c0 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 9 Mar 2020 14:45:41 +0000 Subject: [PATCH] Generated from f1b924bd86d7f315e86c2cee1c90820c4eb43244 update namespace --- src/storagesync/HISTORY.rst | 8 + src/storagesync/README.rst | 5 + src/storagesync/azext_storagesync/__init__.py | 32 + src/storagesync/azext_storagesync/action.py | 13 + .../azext_storagesync/azext_metadata.json | 4 + src/storagesync/azext_storagesync/commands.py | 13 + src/storagesync/azext_storagesync/custom.py | 13 + .../generated/_client_factory.py | 38 + .../azext_storagesync/generated/_help.py | 412 +++ .../azext_storagesync/generated/_params.py | 209 ++ .../generated/_validators.py | 18 + .../azext_storagesync/generated/action.py | 33 + .../azext_storagesync/generated/commands.py | 92 + .../azext_storagesync/generated/custom.py | 269 ++ .../tests/latest/__init__.py | 4 + .../tests/latest/preparers.py | 130 + .../tests/latest/test_storagesync_scenario.py | 259 ++ .../vendored_sdks/__init__.py | 12 + .../vendored_sdks/storagesync/__init__.py | 10 + .../storagesync/_configuration.py | 60 + .../storagesync/_microsoft_storage_sync.py | 97 + .../vendored_sdks/storagesync/aio/__init__.py | 10 + .../storagesync/aio/_configuration_async.py | 58 + .../aio/_microsoft_storage_sync_async.py | 93 + .../aio/operations_async/__init__.py | 27 + .../_cloud_endpoint_operations_async.py | 1058 ++++++ .../_operation_operations_async.py | 98 + .../_operation_status_operations_async.py | 105 + .../_registered_server_operations_async.py | 504 +++ .../_server_endpoint_operations_async.py | 660 ++++ .../_storage_sync_service_operations_async.py | 470 +++ .../_sync_group_operations_async.py | 301 ++ .../_workflow_operations_async.py | 231 ++ .../storagesync/models/__init__.py | 247 ++ .../models/_microsoft_storage_sync_enums.py | 80 + .../storagesync/models/_models.py | 2845 +++++++++++++++ .../storagesync/models/_models_py3.py | 3088 +++++++++++++++++ .../storagesync/operations/__init__.py | 27 + .../operations/_cloud_endpoint_operations.py | 1075 ++++++ .../operations/_operation_operations.py | 99 + .../_operation_status_operations.py | 106 + .../_registered_server_operations.py | 512 +++ .../operations/_server_endpoint_operations.py | 670 ++++ .../_storage_sync_service_operations.py | 477 +++ .../operations/_sync_group_operations.py | 305 ++ .../operations/_workflow_operations.py | 234 ++ src/storagesync/report.md | 254 ++ src/storagesync/setup.cfg | 2 + src/storagesync/setup.py | 60 + 49 files changed, 15427 insertions(+) create mode 100644 src/storagesync/HISTORY.rst create mode 100644 src/storagesync/README.rst create mode 100644 src/storagesync/azext_storagesync/__init__.py create mode 100644 src/storagesync/azext_storagesync/action.py create mode 100644 src/storagesync/azext_storagesync/azext_metadata.json create mode 100644 src/storagesync/azext_storagesync/commands.py create mode 100644 src/storagesync/azext_storagesync/custom.py create mode 100644 src/storagesync/azext_storagesync/generated/_client_factory.py create mode 100644 src/storagesync/azext_storagesync/generated/_help.py create mode 100644 src/storagesync/azext_storagesync/generated/_params.py create mode 100644 src/storagesync/azext_storagesync/generated/_validators.py create mode 100644 src/storagesync/azext_storagesync/generated/action.py create mode 100644 src/storagesync/azext_storagesync/generated/commands.py create mode 100644 src/storagesync/azext_storagesync/generated/custom.py create mode 100644 src/storagesync/azext_storagesync/tests/latest/__init__.py create mode 100644 src/storagesync/azext_storagesync/tests/latest/preparers.py create mode 100644 src/storagesync/azext_storagesync/tests/latest/test_storagesync_scenario.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/__init__.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/__init__.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/_configuration.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/_microsoft_storage_sync.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/__init__.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/_configuration_async.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/_microsoft_storage_sync_async.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/__init__.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_cloud_endpoint_operations_async.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_operation_operations_async.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_operation_status_operations_async.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_registered_server_operations_async.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_server_endpoint_operations_async.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_storage_sync_service_operations_async.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_sync_group_operations_async.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_workflow_operations_async.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/__init__.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_microsoft_storage_sync_enums.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models_py3.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/__init__.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_cloud_endpoint_operations.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_operation_operations.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_operation_status_operations.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_registered_server_operations.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_server_endpoint_operations.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_storage_sync_service_operations.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_sync_group_operations.py create mode 100644 src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_workflow_operations.py create mode 100644 src/storagesync/report.md create mode 100644 src/storagesync/setup.cfg create mode 100644 src/storagesync/setup.py diff --git a/src/storagesync/HISTORY.rst b/src/storagesync/HISTORY.rst new file mode 100644 index 00000000000..27f152061e8 --- /dev/null +++ b/src/storagesync/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/storagesync/README.rst b/src/storagesync/README.rst new file mode 100644 index 00000000000..57520267f19 --- /dev/null +++ b/src/storagesync/README.rst @@ -0,0 +1,5 @@ +Microsoft Azure CLI 'storagesync' Extension +========================================== + +This package is for the 'storagesync' extension. +i.e. 'az storagesync' diff --git a/src/storagesync/azext_storagesync/__init__.py b/src/storagesync/azext_storagesync/__init__.py new file mode 100644 index 00000000000..41dd910e8ef --- /dev/null +++ b/src/storagesync/azext_storagesync/__init__.py @@ -0,0 +1,32 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader + +from .generated._help import helps # pylint: disable=unused-import + + +class MicrosoftStorageSyncCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from .generated._client_factory import cf_storagesync + storagesync_custom = CliCommandType( + operations_tmpl='azext_storagesync.custom#{}', + client_factory=cf_storagesync) + super(MicrosoftStorageSyncCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=storagesync_custom) + + def load_command_table(self, args): + from .generated.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from .generated._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = MicrosoftStorageSyncCommandsLoader diff --git a/src/storagesync/azext_storagesync/action.py b/src/storagesync/azext_storagesync/action.py new file mode 100644 index 00000000000..ceefe51c197 --- /dev/null +++ b/src/storagesync/azext_storagesync/action.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/storagesync/azext_storagesync/azext_metadata.json b/src/storagesync/azext_storagesync/azext_metadata.json new file mode 100644 index 00000000000..fc707c41f3b --- /dev/null +++ b/src/storagesync/azext_storagesync/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.67" +} \ No newline at end of file diff --git a/src/storagesync/azext_storagesync/commands.py b/src/storagesync/azext_storagesync/commands.py new file mode 100644 index 00000000000..38f66bd23df --- /dev/null +++ b/src/storagesync/azext_storagesync/commands.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.commands import * # noqa: F403 +try: + from .manual.commands import * # noqa: F403 +except ImportError: + pass diff --git a/src/storagesync/azext_storagesync/custom.py b/src/storagesync/azext_storagesync/custom.py new file mode 100644 index 00000000000..84a2070bce4 --- /dev/null +++ b/src/storagesync/azext_storagesync/custom.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/storagesync/azext_storagesync/generated/_client_factory.py b/src/storagesync/azext_storagesync/generated/_client_factory.py new file mode 100644 index 00000000000..39b8b27339e --- /dev/null +++ b/src/storagesync/azext_storagesync/generated/_client_factory.py @@ -0,0 +1,38 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def cf_storagesync(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from ..vendored_sdks.storagesync import MicrosoftStorageSync + return get_mgmt_service_client(cli_ctx, MicrosoftStorageSync) + + +def cf_storage_sync_service(cli_ctx, *_): + return cf_storagesync(cli_ctx).storage_sync_service + + +def cf_sync_group(cli_ctx, *_): + return cf_storagesync(cli_ctx).sync_group + + +def cf_cloud_endpoint(cli_ctx, *_): + return cf_storagesync(cli_ctx).cloud_endpoint + + +def cf_server_endpoint(cli_ctx, *_): + return cf_storagesync(cli_ctx).server_endpoint + + +def cf_registered_server(cli_ctx, *_): + return cf_storagesync(cli_ctx).registered_server + + +def cf_workflow(cli_ctx, *_): + return cf_storagesync(cli_ctx).workflow + + +def cf_operation_status(cli_ctx, *_): + return cf_storagesync(cli_ctx).operation_status diff --git a/src/storagesync/azext_storagesync/generated/_help.py b/src/storagesync/azext_storagesync/generated/_help.py new file mode 100644 index 00000000000..6d774b52f42 --- /dev/null +++ b/src/storagesync/azext_storagesync/generated/_help.py @@ -0,0 +1,412 @@ +# 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. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=line-too-long +from knack.help_files import helps # pylint: disable=unused-import + + +helps['storagesync storage-sync-service'] = """ + type: group + short-summary: storagesync storage-sync-service +""" + +helps['storagesync storage-sync-service list'] = """ + type: command + short-summary: Get a StorageSyncService list by subscription. + examples: + - name: StorageSyncServices_ListByResourceGroup + text: |- + az storagesync storage-sync-service list --resource-group "SampleResourceGroup_1" +""" + +helps['storagesync storage-sync-service show'] = """ + type: command + short-summary: Get a given StorageSyncService. + examples: + - name: StorageSyncServices_Get + text: |- + az storagesync storage-sync-service show --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" +""" + +helps['storagesync storage-sync-service create'] = """ + type: command + short-summary: Create a new StorageSyncService. + examples: + - name: StorageSyncServices_Create + text: |- + az storagesync storage-sync-service create --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" +""" + +helps['storagesync storage-sync-service update'] = """ + type: command + short-summary: Patch a given StorageSyncService. + examples: + - name: StorageSyncServices_Update + text: |- + az storagesync storage-sync-service update --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" +""" + +helps['storagesync storage-sync-service delete'] = """ + type: command + short-summary: Delete a given StorageSyncService. + examples: + - name: StorageSyncServices_Delete + text: |- + az storagesync storage-sync-service delete --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" +""" + +helps['storagesync sync-group'] = """ + type: group + short-summary: storagesync sync-group +""" + +helps['storagesync sync-group list'] = """ + type: command + short-summary: Get a SyncGroup List. + examples: + - name: SyncGroups_ListByStorageSyncService + text: |- + az storagesync sync-group list --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" +""" + +helps['storagesync sync-group show'] = """ + type: command + short-summary: Get a given SyncGroup. + examples: + - name: SyncGroups_Get + text: |- + az storagesync sync-group show --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name \\ + "SampleSyncGroup_1" +""" + +helps['storagesync sync-group create'] = """ + type: command + short-summary: Create a new SyncGroup. + examples: + - name: SyncGroups_Create + text: |- + az storagesync sync-group create --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name \\ + "SampleSyncGroup_1" +""" + +helps['storagesync sync-group delete'] = """ + type: command + short-summary: Delete a given SyncGroup. + examples: + - name: SyncGroups_Delete + text: |- + az storagesync sync-group delete --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name \\ + "SampleSyncGroup_1" +""" + +helps['storagesync cloud-endpoint'] = """ + type: group + short-summary: storagesync cloud-endpoint +""" + +helps['storagesync cloud-endpoint list'] = """ + type: command + short-summary: Get a CloudEndpoint List. + examples: + - name: CloudEndpoints_ListBySyncGroup + text: |- + az storagesync cloud-endpoint list --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name \\ + "SampleSyncGroup_1" +""" + +helps['storagesync cloud-endpoint show'] = """ + type: command + short-summary: Get a given CloudEndpoint. + examples: + - name: CloudEndpoints_Get + text: |- + az storagesync cloud-endpoint show --cloud-endpoint-name "SampleCloudEndpoint_1" \\ + --resource-group "SampleResourceGroup_1" --storage-sync-service-name \\ + "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +""" + +helps['storagesync cloud-endpoint create'] = """ + type: command + short-summary: Create a new CloudEndpoint. + examples: + - name: CloudEndpoints_Create + text: |- + az storagesync cloud-endpoint create --cloud-endpoint-name "SampleCloudEndpoint_1" \\ + --resource-group "SampleResourceGroup_1" --storage-sync-service-name \\ + "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +""" + +helps['storagesync cloud-endpoint delete'] = """ + type: command + short-summary: Delete a given CloudEndpoint. + examples: + - name: CloudEndpoints_Delete + text: |- + az storagesync cloud-endpoint delete --cloud-endpoint-name "SampleCloudEndpoint_1" \\ + --resource-group "SampleResourceGroup_1" --storage-sync-service-name \\ + "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +""" + +helps['storagesync cloud-endpoint pre-backup'] = """ + type: command + short-summary: Pre Backup a given CloudEndpoint. + examples: + - name: CloudEndpoints_PreBackup + text: |- + az storagesync cloud-endpoint pre-backup --cloud-endpoint-name "SampleCloudEndpoint_1" \\ + --resource-group "SampleResourceGroup_1" --storage-sync-service-name \\ + "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +""" + +helps['storagesync cloud-endpoint post-backup'] = """ + type: command + short-summary: Post Backup a given CloudEndpoint. + examples: + - name: CloudEndpoints_PostBackup + text: |- + az storagesync cloud-endpoint post-backup --cloud-endpoint-name "SampleCloudEndpoint_1" \\ + --resource-group "SampleResourceGroup_1" --storage-sync-service-name \\ + "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +""" + +helps['storagesync cloud-endpoint pre-restore'] = """ + type: command + short-summary: Pre Restore a given CloudEndpoint. + examples: + - name: CloudEndpoints_PreRestore + text: |- + az storagesync cloud-endpoint pre-restore --cloud-endpoint-name "SampleCloudEndpoint_1" \\ + --resource-group "SampleResourceGroup_1" --storage-sync-service-name \\ + "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +""" + +helps['storagesync cloud-endpoint post-restore'] = """ + type: command + short-summary: Post Restore a given CloudEndpoint. + examples: + - name: CloudEndpoints_PostRestore + text: |- + az storagesync cloud-endpoint post-restore --cloud-endpoint-name "SampleCloudEndpoint_1" \\ + --resource-group "SampleResourceGroup_1" --storage-sync-service-name \\ + "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +""" + +helps['storagesync cloud-endpoint trigger-change-detection'] = """ + type: command + short-summary: Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud Endpoint. + examples: + - name: CloudEndpoints_TriggerChangeDetection + text: |- + az storagesync cloud-endpoint trigger-change-detection --cloud-endpoint-name \\ + "SampleCloudEndpoint_1" --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name \\ + "SampleSyncGroup_1" +""" + +helps['storagesync cloud-endpoint restoreheartbeat'] = """ + type: command + short-summary: Restore Heartbeat a given CloudEndpoint. + examples: + - name: CloudEndpoints_restoreheartbeat + text: |- + az storagesync cloud-endpoint restoreheartbeat --cloud-endpoint-name \\ + "SampleCloudEndpoint_1" --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name \\ + "SampleSyncGroup_1" +""" + +helps['storagesync server-endpoint'] = """ + type: group + short-summary: storagesync server-endpoint +""" + +helps['storagesync server-endpoint list'] = """ + type: command + short-summary: Get a ServerEndpoint list. + examples: + - name: ServerEndpoints_ListBySyncGroup + text: |- + az storagesync server-endpoint list --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name \\ + "SampleSyncGroup_1" +""" + +helps['storagesync server-endpoint show'] = """ + type: command + short-summary: Get a ServerEndpoint. + examples: + - name: ServerEndpoints_Get + text: |- + az storagesync server-endpoint show --resource-group "SampleResourceGroup_1" \\ + --server-endpoint-name "SampleServerEndpoint_1" --storage-sync-service-name \\ + "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +""" + +helps['storagesync server-endpoint create'] = """ + type: command + short-summary: Create a new ServerEndpoint. + examples: + - name: ServerEndpoints_Create + text: |- + az storagesync server-endpoint create --resource-group "SampleResourceGroup_1" \\ + --server-endpoint-name "SampleServerEndpoint_1" --storage-sync-service-name \\ + "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +""" + +helps['storagesync server-endpoint update'] = """ + type: command + short-summary: Patch a given ServerEndpoint. + examples: + - name: ServerEndpoints_Update + text: |- + az storagesync server-endpoint update --resource-group "SampleResourceGroup_1" \\ + --server-endpoint-name "SampleServerEndpoint_1" --storage-sync-service-name \\ + "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +""" + +helps['storagesync server-endpoint delete'] = """ + type: command + short-summary: Delete a given ServerEndpoint. + examples: + - name: ServerEndpoints_Delete + text: |- + az storagesync server-endpoint delete --resource-group "SampleResourceGroup_1" \\ + --server-endpoint-name "SampleServerEndpoint_1" --storage-sync-service-name \\ + "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +""" + +helps['storagesync server-endpoint recall-action'] = """ + type: command + short-summary: Recall a server endpoint. + examples: + - name: ServerEndpoints_recallAction + text: |- + az storagesync server-endpoint recall-action --resource-group "SampleResourceGroup_1" \\ + --server-endpoint-name "SampleServerEndpoint_1" --storage-sync-service-name \\ + "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +""" + +helps['storagesync registered-server'] = """ + type: group + short-summary: storagesync registered-server +""" + +helps['storagesync registered-server list'] = """ + type: command + short-summary: Get a given registered server list. + examples: + - name: RegisteredServers_ListByStorageSyncService + text: |- + az storagesync registered-server list --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" +""" + +helps['storagesync registered-server show'] = """ + type: command + short-summary: Get a given registered server. + examples: + - name: RegisteredServers_Get + text: |- + az storagesync registered-server show --resource-group "SampleResourceGroup_1" \\ + --server-id "080d4133-bdb5-40a0-96a0-71a6057bfe9a" --storage-sync-service-name \\ + "SampleStorageSyncService_1" +""" + +helps['storagesync registered-server create'] = """ + type: command + short-summary: Add a new registered server. + examples: + - name: RegisteredServers_Create + text: |- + az storagesync registered-server create --resource-group "SampleResourceGroup_1" \\ + --server-id "\\"080d4133-bdb5-40a0-96a0-71a6057bfe9a\\"" --storage-sync-service-name \\ + "SampleStorageSyncService_1" +""" + +helps['storagesync registered-server delete'] = """ + type: command + short-summary: Delete the given registered server. + examples: + - name: RegisteredServers_Delete + text: |- + az storagesync registered-server delete --resource-group "SampleResourceGroup_1" \\ + --server-id "41166691-ab03-43e9-ab3e-0330eda162ac" --storage-sync-service-name \\ + "SampleStorageSyncService_1" +""" + +helps['storagesync registered-server trigger-rollover'] = """ + type: command + short-summary: Triggers Server certificate rollover. + examples: + - name: RegisteredServers_triggerRollover + text: |- + az storagesync registered-server trigger-rollover --resource-group \\ + "SampleResourceGroup_1" --server-id "d166ca76-dad2-49df-b409-12345642d730" \\ + --storage-sync-service-name "SampleStorageSyncService_1" +""" + +helps['storagesync workflow'] = """ + type: group + short-summary: storagesync workflow +""" + +helps['storagesync workflow list'] = """ + type: command + short-summary: Get a Workflow List + examples: + - name: Workflows_ListByStorageSyncService + text: |- + az storagesync workflow list --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" +""" + +helps['storagesync workflow show'] = """ + type: command + short-summary: Get Workflows resource + examples: + - name: Workflows_Get + text: |- + az storagesync workflow show --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" --workflow-id \\ + "828219ea-083e-48b5-89ea-8fd9991b2e75" +""" + +helps['storagesync workflow abort'] = """ + type: command + short-summary: Abort the given workflow. + examples: + - name: Workflows_Abort + text: |- + az storagesync workflow abort --resource-group "SampleResourceGroup_1" \\ + --storage-sync-service-name "SampleStorageSyncService_1" --workflow-id \\ + "7ffd50b3-5574-478d-9ff2-9371bc42ce68" +""" + +helps['storagesync operation-status'] = """ + type: group + short-summary: storagesync operation-status +""" + +helps['storagesync operation-status show'] = """ + type: command + short-summary: Get Operation status + examples: + - name: Workflows_Get + text: |- + az storagesync operation-status show --operation-id \\ + "14b50e24-f68d-4b29-a882-38be9dfb8bd1" --location-name "westus" --resource-group \\ + "SampleResourceGroup_1" --workflow-id "828219ea-083e-48b5-89ea-8fd9991b2e75" +""" diff --git a/src/storagesync/azext_storagesync/generated/_params.py b/src/storagesync/azext_storagesync/generated/_params.py new file mode 100644 index 00000000000..6e2c173bf45 --- /dev/null +++ b/src/storagesync/azext_storagesync/generated/_params.py @@ -0,0 +1,209 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=line-too-long +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + resource_group_name_type, + get_location_type +) +from azext_storagesync.action import ( + AddParameters +) + + +def load_arguments(self, _): + + with self.argument_context('storagesync storage-sync-service list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('storagesync storage-sync-service show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + + with self.argument_context('storagesync storage-sync-service create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('parameters', help='Storage Sync Service resource name.', action=AddParameters, nargs='+') + + with self.argument_context('storagesync storage-sync-service update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('parameters', help='Storage Sync Service resource.', action=AddParameters, nargs='+') + + with self.argument_context('storagesync storage-sync-service delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + + with self.argument_context('storagesync sync-group list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + + with self.argument_context('storagesync sync-group show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + + with self.argument_context('storagesync sync-group create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('parameters', help='Sync Group Body', action=AddParameters, nargs='+') + + with self.argument_context('storagesync sync-group delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + + with self.argument_context('storagesync cloud-endpoint list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + + with self.argument_context('storagesync cloud-endpoint show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('cloud_endpoint_name', help='Name of Cloud Endpoint object.') + + with self.argument_context('storagesync cloud-endpoint create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('cloud_endpoint_name', help='Name of Cloud Endpoint object.') + c.argument('parameters', help='Body of Cloud Endpoint resource.', action=AddParameters, nargs='+') + + with self.argument_context('storagesync cloud-endpoint delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('cloud_endpoint_name', help='Name of Cloud Endpoint object.') + + with self.argument_context('storagesync cloud-endpoint pre-backup') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('cloud_endpoint_name', help='Name of Cloud Endpoint object.') + c.argument('parameters', help='Body of Backup request.', action=AddParameters, nargs='+') + + with self.argument_context('storagesync cloud-endpoint post-backup') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('cloud_endpoint_name', help='Name of Cloud Endpoint object.') + c.argument('parameters', help='Body of Backup request.', action=AddParameters, nargs='+') + + with self.argument_context('storagesync cloud-endpoint pre-restore') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('cloud_endpoint_name', help='Name of Cloud Endpoint object.') + c.argument('parameters', help='Body of Cloud Endpoint object.', action=AddParameters, nargs='+') + + with self.argument_context('storagesync cloud-endpoint post-restore') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('cloud_endpoint_name', help='Name of Cloud Endpoint object.') + c.argument('parameters', help='Body of Cloud Endpoint object.', action=AddParameters, nargs='+') + + with self.argument_context('storagesync cloud-endpoint trigger-change-detection') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('cloud_endpoint_name', help='Name of Cloud Endpoint object.') + c.argument('parameters', help='Trigger Change Detection Action parameters.', action=AddParameters, nargs='+') + + with self.argument_context('storagesync cloud-endpoint restoreheartbeat') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('cloud_endpoint_name', help='Name of Cloud Endpoint object.') + + with self.argument_context('storagesync server-endpoint list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + + with self.argument_context('storagesync server-endpoint show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('server_endpoint_name', help='Name of Server Endpoint object.') + + with self.argument_context('storagesync server-endpoint create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('server_endpoint_name', help='Name of Server Endpoint object.') + c.argument('parameters', help='Body of Server Endpoint object.', action=AddParameters, nargs='+') + + with self.argument_context('storagesync server-endpoint update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('server_endpoint_name', help='Name of Server Endpoint object.') + c.argument('parameters', help='Any of the properties applicable in PUT request.', action=AddParameters, nargs='+') + + with self.argument_context('storagesync server-endpoint delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('server_endpoint_name', help='Name of Server Endpoint object.') + + with self.argument_context('storagesync server-endpoint recall-action') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('sync_group_name', help='Name of Sync Group resource.') + c.argument('server_endpoint_name', help='Name of Server Endpoint object.') + c.argument('parameters', help='Body of Recall Action object.', action=AddParameters, nargs='+') + + with self.argument_context('storagesync registered-server list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + + with self.argument_context('storagesync registered-server show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('server_id', help='GUID identifying the on-premises server.') + + with self.argument_context('storagesync registered-server create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('server_id', help='GUID identifying the on-premises server.') + c.argument('parameters', help='Body of Registered Server object.', action=AddParameters, nargs='+') + + with self.argument_context('storagesync registered-server delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('server_id', help='GUID identifying the on-premises server.') + + with self.argument_context('storagesync registered-server trigger-rollover') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('server_id', help='GUID identifying the on-premises server.') + c.argument('parameters', help='Body of Trigger Rollover request.', action=AddParameters, nargs='+') + + with self.argument_context('storagesync workflow list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + + with self.argument_context('storagesync workflow show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('workflow_id', help='workflow Id') + + with self.argument_context('storagesync workflow abort') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.') + c.argument('workflow_id', help='workflow Id') + + with self.argument_context('storagesync operation-status show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('location_name', help='The desired region for the name check.') + c.argument('workflow_id', help='workflow Id') + c.argument('operation_id', help='operation Id') diff --git a/src/storagesync/azext_storagesync/generated/_validators.py b/src/storagesync/azext_storagesync/generated/_validators.py new file mode 100644 index 00000000000..25e260a7bb4 --- /dev/null +++ b/src/storagesync/azext_storagesync/generated/_validators.py @@ -0,0 +1,18 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def example_name_or_id_validator(cmd, namespace): + from azure.cli.core.commands.client_factory import get_subscription_id + from msrestazure.tools import is_valid_resource_id, resource_id + if namespace.storage_account: + if not is_valid_resource_id(namespace.RESOURCE): + namespace.storage_account = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=namespace.resource_group_name, + namespace='Microsoft.Storage', + type='storageAccounts', + name=namespace.storage_account + ) diff --git a/src/storagesync/azext_storagesync/generated/action.py b/src/storagesync/azext_storagesync/generated/action.py new file mode 100644 index 00000000000..b2738795e2f --- /dev/null +++ b/src/storagesync/azext_storagesync/generated/action.py @@ -0,0 +1,33 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import argparse +from knack.util import CLIError + + +# pylint: disable=protected-access + + +class AddParameters(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddParameters, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = dict(x.split('=', 1) for x in values) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'location': + d['location'] = v + elif kl == 'tags': + d['tags'] = v + elif kl == 'properties': + d['properties'] = v + return d diff --git a/src/storagesync/azext_storagesync/generated/commands.py b/src/storagesync/azext_storagesync/generated/commands.py new file mode 100644 index 00000000000..d7647b8f4b4 --- /dev/null +++ b/src/storagesync/azext_storagesync/generated/commands.py @@ -0,0 +1,92 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from ._client_factory import cf_storage_sync_service + storagesync_storage_sync_service = CliCommandType( + operations_tmpl='azext_storagesync.vendored_sdks.storagesync.operations._storage_sync_service_operations#StorageSyncServiceOperations.{}', + client_factory=cf_storage_sync_service) + with self.command_group('storagesync storage-sync-service', storagesync_storage_sync_service, client_factory=cf_storage_sync_service) as g: + g.custom_command('list', 'storagesync_storage_sync_service_list') + g.custom_show_command('show', 'storagesync_storage_sync_service_show') + g.custom_command('create', 'storagesync_storage_sync_service_create') + g.custom_command('update', 'storagesync_storage_sync_service_update') + g.custom_command('delete', 'storagesync_storage_sync_service_delete') + + from ._client_factory import cf_sync_group + storagesync_sync_group = CliCommandType( + operations_tmpl='azext_storagesync.vendored_sdks.storagesync.operations._sync_group_operations#SyncGroupOperations.{}', + client_factory=cf_sync_group) + with self.command_group('storagesync sync-group', storagesync_sync_group, client_factory=cf_sync_group) as g: + g.custom_command('list', 'storagesync_sync_group_list') + g.custom_show_command('show', 'storagesync_sync_group_show') + g.custom_command('create', 'storagesync_sync_group_create') + g.custom_command('delete', 'storagesync_sync_group_delete') + + from ._client_factory import cf_cloud_endpoint + storagesync_cloud_endpoint = CliCommandType( + operations_tmpl='azext_storagesync.vendored_sdks.storagesync.operations._cloud_endpoint_operations#CloudEndpointOperations.{}', + client_factory=cf_cloud_endpoint) + with self.command_group('storagesync cloud-endpoint', storagesync_cloud_endpoint, client_factory=cf_cloud_endpoint) as g: + g.custom_command('list', 'storagesync_cloud_endpoint_list') + g.custom_show_command('show', 'storagesync_cloud_endpoint_show') + g.custom_command('create', 'storagesync_cloud_endpoint_create', supports_no_wait=True) + g.custom_command('delete', 'storagesync_cloud_endpoint_delete', supports_no_wait=True) + g.custom_command('pre-backup', 'storagesync_cloud_endpoint_pre_backup', supports_no_wait=True) + g.custom_command('post-backup', 'storagesync_cloud_endpoint_post_backup', supports_no_wait=True) + g.custom_command('pre-restore', 'storagesync_cloud_endpoint_pre_restore', supports_no_wait=True) + g.custom_command('post-restore', 'storagesync_cloud_endpoint_post_restore', supports_no_wait=True) + g.custom_command('trigger-change-detection', 'storagesync_cloud_endpoint_trigger_change_detection', supports_no_wait=True) + g.custom_command('restoreheartbeat', 'storagesync_cloud_endpoint_restoreheartbeat') + g.wait_command('wait'); + + from ._client_factory import cf_server_endpoint + storagesync_server_endpoint = CliCommandType( + operations_tmpl='azext_storagesync.vendored_sdks.storagesync.operations._server_endpoint_operations#ServerEndpointOperations.{}', + client_factory=cf_server_endpoint) + with self.command_group('storagesync server-endpoint', storagesync_server_endpoint, client_factory=cf_server_endpoint) as g: + g.custom_command('list', 'storagesync_server_endpoint_list') + g.custom_show_command('show', 'storagesync_server_endpoint_show') + g.custom_command('create', 'storagesync_server_endpoint_create', supports_no_wait=True) + g.custom_command('update', 'storagesync_server_endpoint_update', supports_no_wait=True) + g.custom_command('delete', 'storagesync_server_endpoint_delete', supports_no_wait=True) + g.custom_command('recall-action', 'storagesync_server_endpoint_recall_action', supports_no_wait=True) + g.wait_command('wait'); + + from ._client_factory import cf_registered_server + storagesync_registered_server = CliCommandType( + operations_tmpl='azext_storagesync.vendored_sdks.storagesync.operations._registered_server_operations#RegisteredServerOperations.{}', + client_factory=cf_registered_server) + with self.command_group('storagesync registered-server', storagesync_registered_server, client_factory=cf_registered_server) as g: + g.custom_command('list', 'storagesync_registered_server_list') + g.custom_show_command('show', 'storagesync_registered_server_show') + g.custom_command('create', 'storagesync_registered_server_create', supports_no_wait=True) + g.custom_command('delete', 'storagesync_registered_server_delete', supports_no_wait=True) + g.custom_command('trigger-rollover', 'storagesync_registered_server_trigger_rollover', supports_no_wait=True) + g.wait_command('wait'); + + from ._client_factory import cf_workflow + storagesync_workflow = CliCommandType( + operations_tmpl='azext_storagesync.vendored_sdks.storagesync.operations._workflow_operations#WorkflowOperations.{}', + client_factory=cf_workflow) + with self.command_group('storagesync workflow', storagesync_workflow, client_factory=cf_workflow) as g: + g.custom_command('list', 'storagesync_workflow_list') + g.custom_show_command('show', 'storagesync_workflow_show') + g.custom_command('abort', 'storagesync_workflow_abort') + + from ._client_factory import cf_operation_status + storagesync_operation_status = CliCommandType( + operations_tmpl='azext_storagesync.vendored_sdks.storagesync.operations._operation_status_operations#OperationStatusOperations.{}', + client_factory=cf_operation_status) + with self.command_group('storagesync operation-status', storagesync_operation_status, client_factory=cf_operation_status) as g: + g.custom_show_command('show', 'storagesync_operation_status_show') diff --git a/src/storagesync/azext_storagesync/generated/custom.py b/src/storagesync/azext_storagesync/generated/custom.py new file mode 100644 index 00000000000..5fc32e415df --- /dev/null +++ b/src/storagesync/azext_storagesync/generated/custom.py @@ -0,0 +1,269 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=line-too-long +# pylint: disable=too-many-statements +# pylint: disable=too-many-lines +# pylint: disable=too-many-locals +# pylint: disable=unused-argument + + +def storagesync_storage_sync_service_list(cmd, client, + resource_group_name=None): + if resource_group_name is not None: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def storagesync_storage_sync_service_show(cmd, client, + resource_group_name, + storage_sync_service_name): + return client.get(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name) + + +def storagesync_storage_sync_service_create(cmd, client, + resource_group_name, + storage_sync_service_name, + parameters): + return client.create(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, parameters=parameters) + + +def storagesync_storage_sync_service_update(cmd, client, + resource_group_name, + storage_sync_service_name, + parameters=None): + return client.update(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, parameters=parameters) + + +def storagesync_storage_sync_service_delete(cmd, client, + resource_group_name, + storage_sync_service_name): + return client.delete(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name) + + +def storagesync_sync_group_list(cmd, client, + resource_group_name, + storage_sync_service_name): + return client.list_by_storage_sync_service(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name) + + +def storagesync_sync_group_show(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name): + return client.get(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, sync_group_name=sync_group_name) + + +def storagesync_sync_group_create(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + parameters): + return client.create(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, sync_group_name=sync_group_name, parameters=parameters) + + +def storagesync_sync_group_delete(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name): + return client.delete(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, sync_group_name=sync_group_name) + + +def storagesync_cloud_endpoint_list(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name): + return client.list_by_sync_group(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, sync_group_name=sync_group_name) + + +def storagesync_cloud_endpoint_show(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + cloud_endpoint_name): + return client.get(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) + + +def storagesync_cloud_endpoint_create(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + cloud_endpoint_name, + parameters): + return client.begin_create(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) + + +def storagesync_cloud_endpoint_delete(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + cloud_endpoint_name): + return client.begin_delete(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) + + +def storagesync_cloud_endpoint_pre_backup(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + cloud_endpoint_name, + parameters): + return client.begin_pre_backup(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) + + +def storagesync_cloud_endpoint_post_backup(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + cloud_endpoint_name, + parameters): + return client.begin_post_backup(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) + + +def storagesync_cloud_endpoint_pre_restore(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + cloud_endpoint_name, + parameters): + return client.begin_pre_restore(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) + + +def storagesync_cloud_endpoint_post_restore(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + cloud_endpoint_name, + parameters): + return client.begin_post_restore(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) + + +def storagesync_cloud_endpoint_trigger_change_detection(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + cloud_endpoint_name, + parameters): + return client.begin_trigger_change_detection(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) + + +def storagesync_cloud_endpoint_restoreheartbeat(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + cloud_endpoint_name): + return client.restoreheartbeat(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) + + +def storagesync_server_endpoint_list(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name): + return client.list_by_sync_group(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, sync_group_name=sync_group_name) + + +def storagesync_server_endpoint_show(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + server_endpoint_name): + return client.get(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) + + +def storagesync_server_endpoint_create(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + server_endpoint_name, + parameters): + return client.begin_create(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) + + +def storagesync_server_endpoint_update(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + server_endpoint_name, + parameters=None): + return client.begin_update(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) + + +def storagesync_server_endpoint_delete(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + server_endpoint_name): + return client.begin_delete(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) + + +def storagesync_server_endpoint_recall_action(cmd, client, + resource_group_name, + storage_sync_service_name, + sync_group_name, + server_endpoint_name, + parameters): + return client.begin_recall_action(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) + + +def storagesync_registered_server_list(cmd, client, + resource_group_name, + storage_sync_service_name): + return client.list_by_storage_sync_service(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name) + + +def storagesync_registered_server_show(cmd, client, + resource_group_name, + storage_sync_service_name, + server_id): + return client.get(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, server_id=server_id) + + +def storagesync_registered_server_create(cmd, client, + resource_group_name, + storage_sync_service_name, + server_id, + parameters): + return client.begin_create(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, server_id=server_id, parameters=parameters) + + +def storagesync_registered_server_delete(cmd, client, + resource_group_name, + storage_sync_service_name, + server_id): + return client.begin_delete(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, server_id=server_id) + + +def storagesync_registered_server_trigger_rollover(cmd, client, + resource_group_name, + storage_sync_service_name, + server_id, + parameters): + return client.begin_trigger_rollover(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, server_id=server_id, parameters=parameters) + + +def storagesync_workflow_list(cmd, client, + resource_group_name, + storage_sync_service_name): + return client.list_by_storage_sync_service(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name) + + +def storagesync_workflow_show(cmd, client, + resource_group_name, + storage_sync_service_name, + workflow_id): + return client.get(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, workflow_id=workflow_id) + + +def storagesync_workflow_abort(cmd, client, + resource_group_name, + storage_sync_service_name, + workflow_id): + return client.abort(resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, workflow_id=workflow_id) + + +def storagesync_operation_status_show(cmd, client, + resource_group_name, + location_name, + workflow_id, + operation_id): + return client.get(resource_group_name=resource_group_name, location_name=location_name, workflow_id=workflow_id, operation_id=operation_id) diff --git a/src/storagesync/azext_storagesync/tests/latest/__init__.py b/src/storagesync/azext_storagesync/tests/latest/__init__.py new file mode 100644 index 00000000000..944e5654667 --- /dev/null +++ b/src/storagesync/azext_storagesync/tests/latest/__init__.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/src/storagesync/azext_storagesync/tests/latest/preparers.py b/src/storagesync/azext_storagesync/tests/latest/preparers.py new file mode 100644 index 00000000000..519ccea0ce9 --- /dev/null +++ b/src/storagesync/azext_storagesync/tests/latest/preparers.py @@ -0,0 +1,130 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +from datetime import datetime + +from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer +from azure_devtools.scenario_tests import SingleValueReplacer +from azure.cli.testsdk.exceptions import CliTestError +from azure.cli.testsdk.reverse_dependency import get_dummy_cli + + +KEY_RESOURCE_GROUP = 'rg' +KEY_VIRTUAL_NETWORK = 'vnet' +KEY_VNET_SUBNET = 'subnet' + + +class VirtualNetworkPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.vn', + parameter_name='virtual_network', + resource_group_name=None, + resource_group_key=KEY_RESOURCE_GROUP, + dev_setting_name='AZURE_CLI_TEST_DEV_VIRTUAL_NETWORK_NAME', + random_name_length=75, key=KEY_VIRTUAL_NETWORK): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VirtualNetworkPreparer, self).__init__( + name_prefix, random_name_length) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group_name = resource_group_name + self.resource_group_key = resource_group_key + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **kwargs): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group_name: + self.resource_group_name = self.test_class_instance.kwargs.get( + self.resource_group_key) + if not self.resource_group_name: + raise CliTestError("Error: No resource group configured!") + + tags = {'product': 'azurecli', 'cause': 'automation', + 'date': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')} + if 'ENV_JOB_NAME' in os.environ: + tags['job'] = os.environ['ENV_JOB_NAME'] + tags = ' '.join(['{}={}'.format(key, value) + for key, value in tags.items()]) + template = 'az network vnet create --resource-group {} --name {} --tag ' + tags + self.live_only_execute(self.cli_ctx, template.format( + self.resource_group_name, name)) + + self.test_class_instance.kwargs[self.key] = name + return {self.parameter_name: name} + + def remove_resource(self, name, **kwargs): + # delete vnet if test is being recorded and if the vnet is not a dev rg + if not self.dev_setting_name: + self.live_only_execute( + self.cli_ctx, 'az network vnet delete --name {}'.format(name)) + + +class VnetSubnetPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.vn', + parameter_name='virtual_network', + resource_group_name=None, + resource_group_key=KEY_RESOURCE_GROUP, + vnet_name=None, + vnet_key=KEY_VIRTUAL_NETWORK, + address_prefixes="11.0.0.0/24", + dev_setting_name='AZURE_CLI_TEST_DEV_VNET_SUBNET_NAME', + random_name_length=75, key=KEY_VNET_SUBNET): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VirtualNetworkPreparer, self).__init__( + name_prefix, random_name_length) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group_name = resource_group_name + self.resource_group_key = resource_group_key + self.vnet_name = vnet_name + self.vnet_key = vnet_key + self.address_prefixes = address_prefixes + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **kwargs): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group_name: + self.resource_group_name = self.test_class_instance.kwargs.get( + self.resource_group_key) + if not self.resource_group_name: + raise CliTestError("Error: No resource group configured!") + if not self.vnet_name: + self.vnet_name = self.test_class_instance.kwargs.get(self.vnet_key) + if not self.vnet_name: + raise CliTestError("Error: No vnet configured!") + + # tags = {'product': 'azurecli', 'cause': 'automation', + # 'date': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')} + # if 'ENV_JOB_NAME' in os.environ: + # tags['job'] = os.environ['ENV_JOB_NAME'] + # tags = ' '.join(['{}={}'.format(key, value) + # for key, value in tags.items()]) + template = "az network vnet subnet create --resource-group {} " \ + "--vnet-name {} --name {} --address-prefixes {}" + self.live_only_execute(self.cli_ctx, template.format( + self.resource_group_name, self.vnet_name, name, + self.address_prefixes)) + + self.test_class_instance.kwargs[self.key] = name + return {self.parameter_name: name} + + def remove_resource(self, name, **kwargs): + # delete vnet if test is being recorded and if the vnet is not a dev rg + if not self.dev_setting_name: + self.live_only_execute(self.cli_ctx, "az network vnet subnet" + "delete --name {} --resource-group {} " + "--vnet-name {}".format( + name, self.resource_group_name, + self.vnet_name)) diff --git a/src/storagesync/azext_storagesync/tests/latest/test_storagesync_scenario.py b/src/storagesync/azext_storagesync/tests/latest/test_storagesync_scenario.py new file mode 100644 index 00000000000..b07ffeb6b21 --- /dev/null +++ b/src/storagesync/azext_storagesync/tests/latest/test_storagesync_scenario.py @@ -0,0 +1,259 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import unittest + +from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class MicrosoftStorageSyncScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_storagesync_SampleResourceGroup_1', key='rg') + def test_storagesync(self, resource_group): + + self.kwargs.update({ + 'SampleStorageSyncService_1': self.create_random_name(prefix='storage_sync_services', length=24), + 'SampleSyncGroup_1': self.create_random_name(prefix='sync_groups', length=24), + 'SampleCloudEndpoint_1': self.create_random_name(prefix='cloud_endpoints', length=24), + 'SampleServerEndpoint_1': self.create_random_name(prefix='server_endpoints', length=24), + }) + + self.cmd('az storagesync storage-sync-service create ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}"', + checks=[]) + + self.cmd('az storagesync sync-group create ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync registered-server create ' + '--resource-group "{rg}" ' + '--server-id "\"080d4133-bdb5-40a0-96a0-71a6057bfe9a\"" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}"', + checks=[]) + + self.cmd('az storagesync cloud-endpoint create ' + '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync server-endpoint create ' + '--resource-group "{rg}" ' + '--server-endpoint-name "{SampleServerEndpoint_1}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync server-endpoint show ' + '--resource-group "{rg}" ' + '--server-endpoint-name "{SampleServerEndpoint_1}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync cloud-endpoint show ' + '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync server-endpoint list ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync cloud-endpoint list ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync registered-server show ' + '--resource-group "{rg}" ' + '--server-id "080d4133-bdb5-40a0-96a0-71a6057bfe9a" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}"', + checks=[]) + + self.cmd('az storagesync workflow show ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--workflow-id "828219ea-083e-48b5-89ea-8fd9991b2e75"', + checks=[]) + + self.cmd('az storagesync operation-status show ' + '--operation-id "14b50e24-f68d-4b29-a882-38be9dfb8bd1" ' + '--location-name "westus" ' + '--resource-group "{rg}" ' + '--workflow-id "828219ea-083e-48b5-89ea-8fd9991b2e75"', + checks=[]) + + self.cmd('az storagesync sync-group show ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync workflow show ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--workflow-id "828219ea-083e-48b5-89ea-8fd9991b2e75"', + checks=[]) + + self.cmd('az storagesync operation-status show ' + '--operation-id "14b50e24-f68d-4b29-a882-38be9dfb8bd1" ' + '--location-name "westus" ' + '--resource-group "{rg}" ' + '--workflow-id "828219ea-083e-48b5-89ea-8fd9991b2e75"', + checks=[]) + + self.cmd('az storagesync registered-server list ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}"', + checks=[]) + + self.cmd('az storagesync sync-group list ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}"', + checks=[]) + + self.cmd('az storagesync workflow list ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}"', + checks=[]) + + self.cmd('az storagesync storage-sync-service show ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}"', + checks=[]) + + self.cmd('az storagesync storage-sync-service list ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az storagesync storage-sync-service list', + checks=[]) + + # EXAMPLE NOT FOUND: Operations_List + + self.cmd('az storagesync cloud-endpoint trigger-change-detection ' + '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync cloud-endpoint restoreheartbeat ' + '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync server-endpoint recall-action ' + '--resource-group "{rg}" ' + '--server-endpoint-name "{SampleServerEndpoint_1}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync cloud-endpoint post-restore ' + '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync cloud-endpoint pre-restore ' + '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync cloud-endpoint post-backup ' + '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync cloud-endpoint pre-backup ' + '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync server-endpoint update ' + '--resource-group "{rg}" ' + '--server-endpoint-name "{SampleServerEndpoint_1}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync registered-server trigger-rollover ' + '--resource-group "{rg}" ' + '--server-id "d166ca76-dad2-49df-b409-12345642d730" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}"', + checks=[]) + + self.cmd('az storagesync workflow abort ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--workflow-id "7ffd50b3-5574-478d-9ff2-9371bc42ce68"', + checks=[]) + + self.cmd('az storagesync storage-sync-service update ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}"', + checks=[]) + + # EXAMPLE NOT FOUND: StorageSyncServiceCheckNameAvailability_AlreadyExists + + # EXAMPLE NOT FOUND: StorageSyncServiceCheckNameAvailability_Available + + self.cmd('az storagesync server-endpoint delete ' + '--resource-group "{rg}" ' + '--server-endpoint-name "{SampleServerEndpoint_1}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync cloud-endpoint delete ' + '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync registered-server delete ' + '--resource-group "{rg}" ' + '--server-id "41166691-ab03-43e9-ab3e-0330eda162ac" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}"', + checks=[]) + + self.cmd('az storagesync sync-group delete ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}" ' + '--sync-group-name "{SampleSyncGroup_1}"', + checks=[]) + + self.cmd('az storagesync storage-sync-service delete ' + '--resource-group "{rg}" ' + '--storage-sync-service-name "{SampleStorageSyncService_1}"', + checks=[]) diff --git a/src/storagesync/azext_storagesync/vendored_sdks/__init__.py b/src/storagesync/azext_storagesync/vendored_sdks/__init__.py new file mode 100644 index 00000000000..8d86d5a6be1 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/__init__.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/__init__.py new file mode 100644 index 00000000000..39f85d7fea6 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/__init__.py @@ -0,0 +1,10 @@ +# 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 ._microsoft_storage_sync import MicrosoftStorageSync +__all__ = ['MicrosoftStorageSync'] diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_configuration.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_configuration.py new file mode 100644 index 00000000000..9f57d74a31f --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_configuration.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 typing import Any + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class MicrosoftStorageSyncConfiguration(Configuration): + """Configuration for MicrosoftStorageSync + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(MicrosoftStorageSyncConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2019-10-01" + self._configure(**kwargs) + self.user_agent_policy.add_user_agent('azsdk-python-microsoftstoragesync/{}'.format(VERSION)) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, **kwargs) diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_microsoft_storage_sync.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_microsoft_storage_sync.py new file mode 100644 index 00000000000..23160754686 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_microsoft_storage_sync.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 typing import Any, Optional + +from azure.core import PipelineClient +from msrest import Deserializer, Serializer + +from ._configuration import MicrosoftStorageSyncConfiguration +from .operations import OperationOperations +from .operations import StorageSyncServiceOperations +from .operations import SyncGroupOperations +from .operations import CloudEndpointOperations +from .operations import ServerEndpointOperations +from .operations import RegisteredServerOperations +from .operations import WorkflowOperations +from .operations import OperationStatusOperations +from . import models + + +class MicrosoftStorageSync(object): + """Microsoft Storage Sync Service API + + :ivar operation: OperationOperations operations + :vartype operation: microsoft_storage_sync.operations.OperationOperations + :ivar storage_sync_service: StorageSyncServiceOperations operations + :vartype storage_sync_service: microsoft_storage_sync.operations.StorageSyncServiceOperations + :ivar sync_group: SyncGroupOperations operations + :vartype sync_group: microsoft_storage_sync.operations.SyncGroupOperations + :ivar cloud_endpoint: CloudEndpointOperations operations + :vartype cloud_endpoint: microsoft_storage_sync.operations.CloudEndpointOperations + :ivar server_endpoint: ServerEndpointOperations operations + :vartype server_endpoint: microsoft_storage_sync.operations.ServerEndpointOperations + :ivar registered_server: RegisteredServerOperations operations + :vartype registered_server: microsoft_storage_sync.operations.RegisteredServerOperations + :ivar workflow: WorkflowOperations operations + :vartype workflow: microsoft_storage_sync.operations.WorkflowOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: microsoft_storage_sync.operations.OperationStatusOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = MicrosoftStorageSyncConfiguration(credential, subscription_id, **kwargs) + self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_sync_service = StorageSyncServiceOperations( + self._client, self._config, self._serialize, self._deserialize) + self.sync_group = SyncGroupOperations( + self._client, self._config, self._serialize, self._deserialize) + self.cloud_endpoint = CloudEndpointOperations( + self._client, self._config, self._serialize, self._deserialize) + self.server_endpoint = ServerEndpointOperations( + self._client, self._config, self._serialize, self._deserialize) + self.registered_server = RegisteredServerOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow = WorkflowOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> MicrosoftStorageSync + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/__init__.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/__init__.py new file mode 100644 index 00000000000..75779376d20 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/__init__.py @@ -0,0 +1,10 @@ +# 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 ._microsoft_storage_sync_async import MicrosoftStorageSync +__all__ = ['MicrosoftStorageSync'] diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/_configuration_async.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/_configuration_async.py new file mode 100644 index 00000000000..cbb19864389 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/_configuration_async.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 typing import Any + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class MicrosoftStorageSyncConfiguration(Configuration): + """Configuration for MicrosoftStorageSync + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(MicrosoftStorageSyncConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2019-10-01" + self._configure(**kwargs) + self.user_agent_policy.add_user_agent('azsdk-python-microsoftstoragesync/{}'.format(VERSION)) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, **kwargs) diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/_microsoft_storage_sync_async.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/_microsoft_storage_sync_async.py new file mode 100644 index 00000000000..2618faf0669 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/_microsoft_storage_sync_async.py @@ -0,0 +1,93 @@ +# 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 typing import Any, Optional + +from azure.core import AsyncPipelineClient +from msrest import Deserializer, Serializer + +from ._configuration_async import MicrosoftStorageSyncConfiguration +from .operations_async import OperationOperations +from .operations_async import StorageSyncServiceOperations +from .operations_async import SyncGroupOperations +from .operations_async import CloudEndpointOperations +from .operations_async import ServerEndpointOperations +from .operations_async import RegisteredServerOperations +from .operations_async import WorkflowOperations +from .operations_async import OperationStatusOperations +from .. import models + + +class MicrosoftStorageSync(object): + """Microsoft Storage Sync Service API + + :ivar operation: OperationOperations operations + :vartype operation: microsoft_storage_sync.aio.operations_async.OperationOperations + :ivar storage_sync_service: StorageSyncServiceOperations operations + :vartype storage_sync_service: microsoft_storage_sync.aio.operations_async.StorageSyncServiceOperations + :ivar sync_group: SyncGroupOperations operations + :vartype sync_group: microsoft_storage_sync.aio.operations_async.SyncGroupOperations + :ivar cloud_endpoint: CloudEndpointOperations operations + :vartype cloud_endpoint: microsoft_storage_sync.aio.operations_async.CloudEndpointOperations + :ivar server_endpoint: ServerEndpointOperations operations + :vartype server_endpoint: microsoft_storage_sync.aio.operations_async.ServerEndpointOperations + :ivar registered_server: RegisteredServerOperations operations + :vartype registered_server: microsoft_storage_sync.aio.operations_async.RegisteredServerOperations + :ivar workflow: WorkflowOperations operations + :vartype workflow: microsoft_storage_sync.aio.operations_async.WorkflowOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: microsoft_storage_sync.aio.operations_async.OperationStatusOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = MicrosoftStorageSyncConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_sync_service = StorageSyncServiceOperations( + self._client, self._config, self._serialize, self._deserialize) + self.sync_group = SyncGroupOperations( + self._client, self._config, self._serialize, self._deserialize) + self.cloud_endpoint = CloudEndpointOperations( + self._client, self._config, self._serialize, self._deserialize) + self.server_endpoint = ServerEndpointOperations( + self._client, self._config, self._serialize, self._deserialize) + self.registered_server = RegisteredServerOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow = WorkflowOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "MicrosoftStorageSync": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/__init__.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/__init__.py new file mode 100644 index 00000000000..37f28fc413e --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/__init__.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 ._operation_operations_async import OperationOperations +from ._storage_sync_service_operations_async import StorageSyncServiceOperations +from ._sync_group_operations_async import SyncGroupOperations +from ._cloud_endpoint_operations_async import CloudEndpointOperations +from ._server_endpoint_operations_async import ServerEndpointOperations +from ._registered_server_operations_async import RegisteredServerOperations +from ._workflow_operations_async import WorkflowOperations +from ._operation_status_operations_async import OperationStatusOperations + +__all__ = [ + 'OperationOperations', + 'StorageSyncServiceOperations', + 'SyncGroupOperations', + 'CloudEndpointOperations', + 'ServerEndpointOperations', + 'RegisteredServerOperations', + 'WorkflowOperations', + 'OperationStatusOperations', +] diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_cloud_endpoint_operations_async.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_cloud_endpoint_operations_async.py new file mode 100644 index 00000000000..85fe4bd9964 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_cloud_endpoint_operations_async.py @@ -0,0 +1,1058 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CloudEndpointOperations: + """CloudEndpointOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + parameters: "models.CloudEndpointCreateParameters", + **kwargs + ) -> "models.CloudEndpoint": + cls: ClsType["models.CloudEndpoint"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._create_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'CloudEndpointCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('CloudEndpoint', pipeline_response) + + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Retry-After']=self._deserialize('str', response.headers.get('Retry-After')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} + + async def create( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + parameters: "models.CloudEndpointCreateParameters", + **kwargs + ) -> "models.CloudEndpoint": + """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: ~microsoft_storage_sync.models.CloudEndpointCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns CloudEndpoint + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.CloudEndpoint] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType["models.CloudEndpoint"] = kwargs.pop('cls', None ) + raw_result = await 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('CloudEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(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}'} + + async def get( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + **kwargs + ) -> "models.CloudEndpoint": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CloudEndpoint or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.CloudEndpoint + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.CloudEndpoint"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('CloudEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} + + async def _delete_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + **kwargs + ) -> None: + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._delete_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Retry-After']=self._deserialize('str', response.headers.get('Retry-After')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} + + async def delete( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + **kwargs + ) -> None: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType[None] = kwargs.pop('cls', None ) + raw_result = await 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(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: str, + storage_sync_service_name: str, + sync_group_name: str, + **kwargs + ) -> "models.CloudEndpointArray": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CloudEndpointArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.CloudEndpointArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.CloudEndpointArray"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + 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='^[-\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) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CloudEndpointArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_sync_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints'} + + async def _pre_backup_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + parameters: "models.BackupRequest", + **kwargs + ) -> None: + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._pre_backup_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'BackupRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _pre_backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup'} + + async def pre_backup( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + parameters: "models.BackupRequest", + **kwargs + ) -> None: + """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 parameters: Body of Backup request. + :type parameters: ~microsoft_storage_sync.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType[None] = kwargs.pop('cls', None ) + raw_result = await 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, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(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'} + + async def _post_backup_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + parameters: "models.BackupRequest", + **kwargs + ) -> "models.PostBackupResponse": + cls: ClsType["models.PostBackupResponse"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._post_backup_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'BackupRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('PostBackupResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _post_backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup'} + + async def post_backup( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + parameters: "models.BackupRequest", + **kwargs + ) -> "models.PostBackupResponse": + """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 parameters: Body of Backup request. + :type parameters: ~microsoft_storage_sync.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns PostBackupResponse + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.PostBackupResponse] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType["models.PostBackupResponse"] = kwargs.pop('cls', None ) + raw_result = await 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, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('PostBackupResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(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'} + + async def _pre_restore_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + parameters: "models.PreRestoreRequest", + **kwargs + ) -> None: + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._pre_restore_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'PreRestoreRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _pre_restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore'} + + async def pre_restore( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + parameters: "models.PreRestoreRequest", + **kwargs + ) -> None: + """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: ~microsoft_storage_sync.models.PreRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType[None] = kwargs.pop('cls', None ) + raw_result = await 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(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'} + + async def restoreheartbeat( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + **kwargs + ) -> None: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + restoreheartbeat.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/restoreheartbeat'} + + async def _post_restore_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + parameters: "models.PostRestoreRequest", + **kwargs + ) -> None: + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._post_restore_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'PostRestoreRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _post_restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore'} + + async def post_restore( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + parameters: "models.PostRestoreRequest", + **kwargs + ) -> None: + """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: ~microsoft_storage_sync.models.PostRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType[None] = kwargs.pop('cls', None ) + raw_result = await 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(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'} + + async def _trigger_change_detection_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + parameters: "models.TriggerChangeDetectionParameters", + **kwargs + ) -> None: + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._trigger_change_detection_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'TriggerChangeDetectionParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _trigger_change_detection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/triggerChangeDetection'} + + async def trigger_change_detection( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + cloud_endpoint_name: str, + parameters: "models.TriggerChangeDetectionParameters", + **kwargs + ) -> None: + """Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud 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 cloud_endpoint_name: Name of Cloud Endpoint object. + :type cloud_endpoint_name: str + :param parameters: Trigger Change Detection Action parameters. + :type parameters: ~microsoft_storage_sync.models.TriggerChangeDetectionParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType[None] = kwargs.pop('cls', None ) + raw_result = await self._trigger_change_detection_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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + trigger_change_detection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/triggerChangeDetection'} diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_operation_operations_async.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_operation_operations_async.py new file mode 100644 index 00000000000..d1381bbeba1 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_operation_operations_async.py @@ -0,0 +1,98 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations: + """OperationOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> "models.OperationEntityListResult": + """Lists all of the available Storage Sync Rest API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationEntityListResult or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.OperationEntityListResult + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.OperationEntityListResult"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationEntityListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.StorageSync/operations'} diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_operation_status_operations_async.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_operation_status_operations_async.py new file mode 100644 index 00000000000..5e6d80aa252 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_operation_status_operations_async.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationStatusOperations: + """OperationStatusOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + location_name: str, + workflow_id: str, + operation_id: str, + **kwargs + ) -> "models.OperationStatus": + """Get Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param location_name: The desired region for the name check. + :type location_name: str + :param workflow_id: workflow Id. + :type workflow_id: str + :param operation_id: operation Id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.OperationStatus + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.OperationStatus"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\w\._\(\)]+$'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'workflowId': self._serialize.url("workflow_id", workflow_id, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/locations/{locationName}/workflows/{workflowId}/operations/{operationId}'} diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_registered_server_operations_async.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_registered_server_operations_async.py new file mode 100644 index 00000000000..ad500007761 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_registered_server_operations_async.py @@ -0,0 +1,504 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RegisteredServerOperations: + """RegisteredServerOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_storage_sync_service( + self, + resource_group_name: str, + storage_sync_service_name: str, + **kwargs + ) -> "models.RegisteredServerArray": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegisteredServerArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.RegisteredServerArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.RegisteredServerArray"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_storage_sync_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\w\._\(\)]+$'), + 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RegisteredServerArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers'} + + async def get( + self, + resource_group_name: str, + storage_sync_service_name: str, + server_id: str, + **kwargs + ) -> "models.RegisteredServer": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegisteredServer or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.RegisteredServer + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.RegisteredServer"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('RegisteredServer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + + async def _create_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + server_id: str, + parameters: "models.RegisteredServerCreateParameters", + **kwargs + ) -> "models.RegisteredServer": + cls: ClsType["models.RegisteredServer"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._create_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'RegisteredServerCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('RegisteredServer', pipeline_response) + + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + + async def create( + self, + resource_group_name: str, + storage_sync_service_name: str, + server_id: str, + parameters: "models.RegisteredServerCreateParameters", + **kwargs + ) -> "models.RegisteredServer": + """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: ~microsoft_storage_sync.models.RegisteredServerCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns RegisteredServer + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.RegisteredServer] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType["models.RegisteredServer"] = kwargs.pop('cls', None ) + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + server_id=server_id, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('RegisteredServer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + + async def _delete_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + server_id: str, + **kwargs + ) -> None: + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._delete_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + + async def delete( + self, + resource_group_name: str, + storage_sync_service_name: str, + server_id: str, + **kwargs + ) -> None: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType[None] = kwargs.pop('cls', None ) + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + server_id=server_id, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + + async def _trigger_rollover_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + server_id: str, + parameters: "models.TriggerRolloverRequest", + **kwargs + ) -> None: + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._trigger_rollover_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'TriggerRolloverRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _trigger_rollover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover'} + + async def trigger_rollover( + self, + resource_group_name: str, + storage_sync_service_name: str, + server_id: str, + parameters: "models.TriggerRolloverRequest", + **kwargs + ) -> None: + """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: GUID identifying the on-premises server. + :type server_id: str + :param parameters: Body of Trigger Rollover request. + :type parameters: ~microsoft_storage_sync.models.TriggerRolloverRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType[None] = kwargs.pop('cls', None ) + raw_result = await self._trigger_rollover_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + server_id=server_id, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(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/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_server_endpoint_operations_async.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_server_endpoint_operations_async.py new file mode 100644 index 00000000000..598ad3d68f9 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_server_endpoint_operations_async.py @@ -0,0 +1,660 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ServerEndpointOperations: + """ServerEndpointOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + server_endpoint_name: str, + parameters: "models.ServerEndpointCreateParameters", + **kwargs + ) -> "models.ServerEndpoint": + cls: ClsType["models.ServerEndpoint"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._create_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'ServerEndpointCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('ServerEndpoint', pipeline_response) + + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + + async def create( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + server_endpoint_name: str, + parameters: "models.ServerEndpointCreateParameters", + **kwargs + ) -> "models.ServerEndpoint": + """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: ~microsoft_storage_sync.models.ServerEndpointCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns ServerEndpoint + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.ServerEndpoint] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType["models.ServerEndpoint"] = kwargs.pop('cls', None ) + raw_result = await 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('ServerEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(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}'} + + async def _update_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + server_endpoint_name: str, + parameters: Optional["models.ServerEndpointUpdateParameters"] = None, + **kwargs + ) -> "models.ServerEndpoint": + cls: ClsType["models.ServerEndpoint"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._update_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # 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) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('ServerEndpoint', pipeline_response) + + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + + async def update( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + server_endpoint_name: str, + parameters: Optional["models.ServerEndpointUpdateParameters"] = None, + **kwargs + ) -> "models.ServerEndpoint": + """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: ~microsoft_storage_sync.models.ServerEndpointUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns ServerEndpoint + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.ServerEndpoint] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType["models.ServerEndpoint"] = kwargs.pop('cls', None ) + raw_result = await 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('ServerEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(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}'} + + async def get( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + server_endpoint_name: str, + **kwargs + ) -> "models.ServerEndpoint": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServerEndpoint or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.ServerEndpoint + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.ServerEndpoint"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('ServerEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + + async def _delete_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + server_endpoint_name: str, + **kwargs + ) -> None: + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._delete_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + + async def delete( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + server_endpoint_name: str, + **kwargs + ) -> None: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType[None] = kwargs.pop('cls', None ) + raw_result = await 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(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: str, + storage_sync_service_name: str, + sync_group_name: str, + **kwargs + ) -> "models.ServerEndpointArray": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServerEndpointArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.ServerEndpointArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.ServerEndpointArray"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + 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='^[-\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) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ServerEndpointArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_sync_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints'} + + async def _recall_action_initial( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + server_endpoint_name: str, + parameters: "models.RecallActionParameters", + **kwargs + ) -> None: + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._recall_action_initial.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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'RecallActionParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _recall_action_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction'} + + async def recall_action( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + server_endpoint_name: str, + parameters: "models.RecallActionParameters", + **kwargs + ) -> None: + """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 parameters: Body of Recall Action object. + :type parameters: ~microsoft_storage_sync.models.RecallActionParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True) + cls: ClsType[None] = kwargs.pop('cls', None ) + raw_result = await 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, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(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/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_storage_sync_service_operations_async.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_storage_sync_service_operations_async.py new file mode 100644 index 00000000000..7b8986a0e7e --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_storage_sync_service_operations_async.py @@ -0,0 +1,470 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StorageSyncServiceOperations: + """StorageSyncServiceOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def check_name_availability( + self, + location_name: str, + parameters: "models.CheckNameAvailabilityParameters", + **kwargs + ) -> "models.CheckNameAvailabilityResult": + """Check the give namespace name availability. + + :param location_name: The desired region for the name check. + :type location_name: str + :param parameters: Parameters to check availability of the given namespace name. + :type parameters: ~microsoft_storage_sync.models.CheckNameAvailabilityParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.CheckNameAvailabilityResult + :raises: ~azure.core.HttpResponseError + """ + cls: ClsType["models.CheckNameAvailabilityResult"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/checkNameAvailability'} + + async def create( + self, + resource_group_name: str, + storage_sync_service_name: str, + parameters: "models.StorageSyncServiceCreateParameters", + **kwargs + ) -> "models.StorageSyncService": + """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: ~microsoft_storage_sync.models.StorageSyncServiceCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageSyncService or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncService + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.StorageSyncService"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'StorageSyncServiceCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + deserialized = self._deserialize('StorageSyncService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + + async def get( + self, + resource_group_name: str, + storage_sync_service_name: str, + **kwargs + ) -> "models.StorageSyncService": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageSyncService or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncService + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.StorageSyncService"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('StorageSyncService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + + async def update( + self, + resource_group_name: str, + storage_sync_service_name: str, + parameters: Optional["models.StorageSyncServiceUpdateParameters"] = None, + **kwargs + ) -> "models.StorageSyncService": + """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 parameters: Storage Sync Service resource. + :type parameters: ~microsoft_storage_sync.models.StorageSyncServiceUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageSyncService or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncService + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.StorageSyncService"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # 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) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('StorageSyncService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + + async def delete( + self, + resource_group_name: str, + storage_sync_service_name: str, + **kwargs + ) -> None: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> "models.StorageSyncServiceArray": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageSyncServiceArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncServiceArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.StorageSyncServiceArray"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + 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='^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StorageSyncServiceArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices'} + + def list_by_subscription( + self, + **kwargs + ) -> "models.StorageSyncServiceArray": + """Get a StorageSyncService list by subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageSyncServiceArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncServiceArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.StorageSyncServiceArray"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + 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) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StorageSyncServiceArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/storageSyncServices'} diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_sync_group_operations_async.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_sync_group_operations_async.py new file mode 100644 index 00000000000..e649b3f008d --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_sync_group_operations_async.py @@ -0,0 +1,301 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SyncGroupOperations: + """SyncGroupOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_storage_sync_service( + self, + resource_group_name: str, + storage_sync_service_name: str, + **kwargs + ) -> "models.SyncGroupArray": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SyncGroupArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.SyncGroupArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.SyncGroupArray"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_storage_sync_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\w\._\(\)]+$'), + 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SyncGroupArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups'} + + async def create( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + parameters: "models.SyncGroupCreateParameters", + **kwargs + ) -> "models.SyncGroup": + """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 parameters: Sync Group Body. + :type parameters: ~microsoft_storage_sync.models.SyncGroupCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SyncGroup or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.SyncGroup + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.SyncGroup"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'SyncGroupCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('SyncGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} + + async def get( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + **kwargs + ) -> "models.SyncGroup": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SyncGroup or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.SyncGroup + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.SyncGroup"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('SyncGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} + + async def delete( + self, + resource_group_name: str, + storage_sync_service_name: str, + sync_group_name: str, + **kwargs + ) -> None: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_workflow_operations_async.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_workflow_operations_async.py new file mode 100644 index 00000000000..334bd8f71a9 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_workflow_operations_async.py @@ -0,0 +1,231 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowOperations: + """WorkflowOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_storage_sync_service( + self, + resource_group_name: str, + storage_sync_service_name: str, + **kwargs + ) -> "models.WorkflowArray": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.WorkflowArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.WorkflowArray"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_storage_sync_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\w\._\(\)]+$'), + 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows'} + + async def get( + self, + resource_group_name: str, + storage_sync_service_name: str, + workflow_id: str, + **kwargs + ) -> "models.Workflow": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workflow or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.Workflow + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType["models.Workflow"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('Workflow', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}'} + + async def abort( + self, + resource_group_name: str, + storage_sync_service_name: str, + workflow_id: str, + **kwargs + ) -> None: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + abort.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}/abort'} diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/__init__.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/__init__.py new file mode 100644 index 00000000000..d8663bb9aa1 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/__init__.py @@ -0,0 +1,247 @@ +# 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 ._models_py3 import AzureEntityResource + from ._models_py3 import BackupRequest + from ._models_py3 import CheckNameAvailabilityParameters + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CloudEndpoint + from ._models_py3 import CloudEndpointArray + from ._models_py3 import CloudEndpointCreateParameters + from ._models_py3 import CloudEndpointCreateParametersProperties + from ._models_py3 import CloudEndpointProperties + from ._models_py3 import CloudTieringCachePerformance + from ._models_py3 import CloudTieringDatePolicyStatus + from ._models_py3 import CloudTieringFilesNotTiering + from ._models_py3 import CloudTieringSpaceSavings + from ._models_py3 import CloudTieringVolumeFreeSpacePolicyStatus + from ._models_py3 import FilesNotTieringError + from ._models_py3 import OperationDisplayInfo + from ._models_py3 import OperationDisplayResource + from ._models_py3 import OperationEntity + from ._models_py3 import OperationEntityListResult + from ._models_py3 import OperationStatus + from ._models_py3 import PostBackupResponse + from ._models_py3 import PostBackupResponseProperties + from ._models_py3 import PostRestoreRequest + from ._models_py3 import PreRestoreRequest + from ._models_py3 import ProxyResource + from ._models_py3 import RecallActionParameters + from ._models_py3 import RegisteredServer + from ._models_py3 import RegisteredServerArray + from ._models_py3 import RegisteredServerCreateParameters + from ._models_py3 import RegisteredServerCreateParametersProperties + from ._models_py3 import RegisteredServerProperties + from ._models_py3 import Resource + from ._models_py3 import ResourcesMoveInfo + from ._models_py3 import RestoreFileSpec + from ._models_py3 import ServerEndpoint + from ._models_py3 import ServerEndpointArray + from ._models_py3 import ServerEndpointCloudTieringStatus + from ._models_py3 import ServerEndpointCreateParameters + from ._models_py3 import ServerEndpointCreateParametersProperties + from ._models_py3 import ServerEndpointFilesNotSyncingError + from ._models_py3 import ServerEndpointProperties + from ._models_py3 import ServerEndpointRecallError + from ._models_py3 import ServerEndpointRecallStatus + from ._models_py3 import ServerEndpointSyncActivityStatus + from ._models_py3 import ServerEndpointSyncSessionStatus + from ._models_py3 import ServerEndpointSyncStatus + from ._models_py3 import ServerEndpointUpdateParameters + from ._models_py3 import ServerEndpointUpdateProperties + from ._models_py3 import StorageSyncApiError + from ._models_py3 import StorageSyncError, StorageSyncErrorException + from ._models_py3 import StorageSyncErrorDetails + from ._models_py3 import StorageSyncService + from ._models_py3 import StorageSyncServiceArray + from ._models_py3 import StorageSyncServiceCreateParameters + from ._models_py3 import StorageSyncServiceProperties + from ._models_py3 import StorageSyncServiceUpdateParameters + from ._models_py3 import StorageSyncServiceUpdateProperties + from ._models_py3 import SubscriptionState + from ._models_py3 import SubscriptionStateProperties + from ._models_py3 import SyncGroup + from ._models_py3 import SyncGroupArray + from ._models_py3 import SyncGroupCreateParameters + from ._models_py3 import SyncGroupCreateParametersProperties + from ._models_py3 import SyncGroupProperties + from ._models_py3 import TrackedResource + from ._models_py3 import TriggerChangeDetectionParameters + from ._models_py3 import TriggerRolloverRequest + from ._models_py3 import Workflow + from ._models_py3 import WorkflowArray + from ._models_py3 import WorkflowProperties +except (SyntaxError, ImportError): + from ._models import AzureEntityResource # type: ignore + from ._models import BackupRequest # type: ignore + from ._models import CheckNameAvailabilityParameters # type: ignore + from ._models import CheckNameAvailabilityResult # type: ignore + from ._models import CloudEndpoint # type: ignore + from ._models import CloudEndpointArray # type: ignore + from ._models import CloudEndpointCreateParameters # type: ignore + from ._models import CloudEndpointCreateParametersProperties # type: ignore + from ._models import CloudEndpointProperties # type: ignore + from ._models import CloudTieringCachePerformance # type: ignore + from ._models import CloudTieringDatePolicyStatus # type: ignore + from ._models import CloudTieringFilesNotTiering # type: ignore + from ._models import CloudTieringSpaceSavings # type: ignore + from ._models import CloudTieringVolumeFreeSpacePolicyStatus # type: ignore + from ._models import FilesNotTieringError # type: ignore + from ._models import OperationDisplayInfo # type: ignore + from ._models import OperationDisplayResource # type: ignore + from ._models import OperationEntity # type: ignore + from ._models import OperationEntityListResult # type: ignore + from ._models import OperationStatus # type: ignore + from ._models import PostBackupResponse # type: ignore + from ._models import PostBackupResponseProperties # type: ignore + from ._models import PostRestoreRequest # type: ignore + from ._models import PreRestoreRequest # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import RecallActionParameters # type: ignore + from ._models import RegisteredServer # type: ignore + from ._models import RegisteredServerArray # type: ignore + from ._models import RegisteredServerCreateParameters # type: ignore + from ._models import RegisteredServerCreateParametersProperties # type: ignore + from ._models import RegisteredServerProperties # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourcesMoveInfo # type: ignore + from ._models import RestoreFileSpec # type: ignore + from ._models import ServerEndpoint # type: ignore + from ._models import ServerEndpointArray # type: ignore + from ._models import ServerEndpointCloudTieringStatus # type: ignore + from ._models import ServerEndpointCreateParameters # type: ignore + from ._models import ServerEndpointCreateParametersProperties # type: ignore + from ._models import ServerEndpointFilesNotSyncingError # type: ignore + from ._models import ServerEndpointProperties # type: ignore + from ._models import ServerEndpointRecallError # type: ignore + from ._models import ServerEndpointRecallStatus # type: ignore + from ._models import ServerEndpointSyncActivityStatus # type: ignore + from ._models import ServerEndpointSyncSessionStatus # type: ignore + from ._models import ServerEndpointSyncStatus # type: ignore + from ._models import ServerEndpointUpdateParameters # type: ignore + from ._models import ServerEndpointUpdateProperties # type: ignore + from ._models import StorageSyncApiError # type: ignore + from ._models import StorageSyncError, StorageSyncErrorException # type: ignore + from ._models import StorageSyncErrorDetails # type: ignore + from ._models import StorageSyncService # type: ignore + from ._models import StorageSyncServiceArray # type: ignore + from ._models import StorageSyncServiceCreateParameters # type: ignore + from ._models import StorageSyncServiceProperties # type: ignore + from ._models import StorageSyncServiceUpdateParameters # type: ignore + from ._models import StorageSyncServiceUpdateProperties # type: ignore + from ._models import SubscriptionState # type: ignore + from ._models import SubscriptionStateProperties # type: ignore + from ._models import SyncGroup # type: ignore + from ._models import SyncGroupArray # type: ignore + from ._models import SyncGroupCreateParameters # type: ignore + from ._models import SyncGroupCreateParametersProperties # type: ignore + from ._models import SyncGroupProperties # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import TriggerChangeDetectionParameters # type: ignore + from ._models import TriggerRolloverRequest # type: ignore + from ._models import Workflow # type: ignore + from ._models import WorkflowArray # type: ignore + from ._models import WorkflowProperties # type: ignore +from ._microsoft_storage_sync_enums import ( + ChangeDetectionMode, + FeatureStatus, + NameAvailabilityReason, + OperationDirection, + ProgressType, + Reason, + ServerEndpointCloudTieringHealthState, + ServerEndpointOfflineDataTransferState, + ServerEndpointSyncActivityState, + ServerEndpointSyncHealthState, + WorkflowStatus, +) + +__all__ = [ + 'AzureEntityResource', + 'BackupRequest', + 'CheckNameAvailabilityParameters', + 'CheckNameAvailabilityResult', + 'CloudEndpoint', + 'CloudEndpointArray', + 'CloudEndpointCreateParameters', + 'CloudEndpointCreateParametersProperties', + 'CloudEndpointProperties', + 'CloudTieringCachePerformance', + 'CloudTieringDatePolicyStatus', + 'CloudTieringFilesNotTiering', + 'CloudTieringSpaceSavings', + 'CloudTieringVolumeFreeSpacePolicyStatus', + 'FilesNotTieringError', + 'OperationDisplayInfo', + 'OperationDisplayResource', + 'OperationEntity', + 'OperationEntityListResult', + 'OperationStatus', + 'PostBackupResponse', + 'PostBackupResponseProperties', + 'PostRestoreRequest', + 'PreRestoreRequest', + 'ProxyResource', + 'RecallActionParameters', + 'RegisteredServer', + 'RegisteredServerArray', + 'RegisteredServerCreateParameters', + 'RegisteredServerCreateParametersProperties', + 'RegisteredServerProperties', + 'Resource', + 'ResourcesMoveInfo', + 'RestoreFileSpec', + 'ServerEndpoint', + 'ServerEndpointArray', + 'ServerEndpointCloudTieringStatus', + 'ServerEndpointCreateParameters', + 'ServerEndpointCreateParametersProperties', + 'ServerEndpointFilesNotSyncingError', + 'ServerEndpointProperties', + 'ServerEndpointRecallError', + 'ServerEndpointRecallStatus', + 'ServerEndpointSyncActivityStatus', + 'ServerEndpointSyncSessionStatus', + 'ServerEndpointSyncStatus', + 'ServerEndpointUpdateParameters', + 'ServerEndpointUpdateProperties', + 'StorageSyncApiError', + 'StorageSyncError', 'StorageSyncErrorException', + 'StorageSyncErrorDetails', + 'StorageSyncService', + 'StorageSyncServiceArray', + 'StorageSyncServiceCreateParameters', + 'StorageSyncServiceProperties', + 'StorageSyncServiceUpdateParameters', + 'StorageSyncServiceUpdateProperties', + 'SubscriptionState', + 'SubscriptionStateProperties', + 'SyncGroup', + 'SyncGroupArray', + 'SyncGroupCreateParameters', + 'SyncGroupCreateParametersProperties', + 'SyncGroupProperties', + 'TrackedResource', + 'TriggerChangeDetectionParameters', + 'TriggerRolloverRequest', + 'Workflow', + 'WorkflowArray', + 'WorkflowProperties', + 'ChangeDetectionMode', + 'FeatureStatus', + 'NameAvailabilityReason', + 'OperationDirection', + 'ProgressType', + 'Reason', + 'ServerEndpointCloudTieringHealthState', + 'ServerEndpointOfflineDataTransferState', + 'ServerEndpointSyncActivityState', + 'ServerEndpointSyncHealthState', + 'WorkflowStatus', +] diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_microsoft_storage_sync_enums.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_microsoft_storage_sync_enums.py new file mode 100644 index 00000000000..3e65ecec8d2 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_microsoft_storage_sync_enums.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 enum import Enum + +class FeatureStatus(str, Enum): + + on = "on" + off = "off" + +class ServerEndpointSyncHealthState(str, Enum): + + healthy = "Healthy" + error = "Error" + sync_blocked_for_restore = "SyncBlockedForRestore" + sync_blocked_for_change_detection_post_restore = "SyncBlockedForChangeDetectionPostRestore" + no_activity = "NoActivity" + +class ServerEndpointSyncActivityState(str, Enum): + + upload = "Upload" + download = "Download" + upload_and_download = "UploadAndDownload" + +class ServerEndpointOfflineDataTransferState(str, Enum): + + in_progress = "InProgress" + stopping = "Stopping" + not_running = "NotRunning" + complete = "Complete" + +class ServerEndpointCloudTieringHealthState(str, Enum): + + healthy = "Healthy" + error = "Error" + +class WorkflowStatus(str, Enum): + + active = "active" + expired = "expired" + succeeded = "succeeded" + aborted = "aborted" + failed = "failed" + +class OperationDirection(str, Enum): + + do = "do" + undo = "undo" + cancel = "cancel" + +class ChangeDetectionMode(str, Enum): + + default = "Default" + recursive = "Recursive" + +class Reason(str, Enum): + + registered = "Registered" + unregistered = "Unregistered" + warned = "Warned" + suspended = "Suspended" + deleted = "Deleted" + +class ProgressType(str, Enum): + + none = "none" + initialize = "initialize" + download = "download" + upload = "upload" + recall = "recall" + +class NameAvailabilityReason(str, Enum): + + invalid = "Invalid" + already_exists = "AlreadyExists" diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models.py new file mode 100644 index 00000000000..fe2bb2314f4 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models.py @@ -0,0 +1,2845 @@ +# 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 azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Resource(msrest.serialization.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 + + +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 + + +class BackupRequest(msrest.serialization.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) + + +class CheckNameAvailabilityParameters(msrest.serialization.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) + + +class CheckNameAvailabilityResult(msrest.serialization.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 ~microsoft_storage_sync.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': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +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) + + +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) + + +class CloudEndpointArray(msrest.serialization.Model): + """Array of CloudEndpoint. + + :param value: Collection of CloudEndpoint. + :type value: list[~microsoft_storage_sync.models.CloudEndpoint] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CloudEndpoint]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudEndpointArray, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +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 + :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'}, + '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'}, + 'friendly_name': {'key': 'properties.friendlyName', '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) + self.friendly_name = kwargs.get('friendly_name', None) + + +class CloudEndpointCreateParametersProperties(msrest.serialization.Model): + """CloudEndpoint Properties object. + + :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 friendly_name: Friendly Name. + :type friendly_name: str + """ + + _attribute_map = { + 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, + 'azure_file_share_name': {'key': 'azureFileShareName', 'type': 'str'}, + 'storage_account_tenant_id': {'key': 'storageAccountTenantId', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudEndpointCreateParametersProperties, 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.friendly_name = kwargs.get('friendly_name', None) + + +class CloudEndpointProperties(msrest.serialization.Model): + """CloudEndpoint Properties object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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 = { + 'backup_enabled': {'readonly': True}, + } + + _attribute_map = { + 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, + 'azure_file_share_name': {'key': 'azureFileShareName', 'type': 'str'}, + 'storage_account_tenant_id': {'key': 'storageAccountTenantId', 'type': 'str'}, + 'partnership_id': {'key': 'partnershipId', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_enabled': {'key': 'backupEnabled', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'last_workflow_id': {'key': 'lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'lastOperationName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudEndpointProperties, 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) + + +class CloudTieringCachePerformance(msrest.serialization.Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar cache_hit_bytes: Count of bytes that were served from the local server. + :vartype cache_hit_bytes: long + :ivar cache_miss_bytes: Count of bytes that were served from the cloud. + :vartype cache_miss_bytes: long + :ivar cache_hit_bytes_percent: Percentage of total bytes (hit + miss) that were served from the + local server. + :vartype cache_hit_bytes_percent: int + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'cache_hit_bytes': {'readonly': True, 'minimum': 0}, + 'cache_miss_bytes': {'readonly': True, 'minimum': 0}, + 'cache_hit_bytes_percent': {'readonly': True, 'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'cache_hit_bytes': {'key': 'cacheHitBytes', 'type': 'long'}, + 'cache_miss_bytes': {'key': 'cacheMissBytes', 'type': 'long'}, + 'cache_hit_bytes_percent': {'key': 'cacheHitBytesPercent', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudTieringCachePerformance, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.cache_hit_bytes = None + self.cache_miss_bytes = None + self.cache_hit_bytes_percent = None + + +class CloudTieringDatePolicyStatus(msrest.serialization.Model): + """Status of the date policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar tiered_files_most_recent_access_timestamp: Most recent access time of tiered files. + :vartype tiered_files_most_recent_access_timestamp: ~datetime.datetime + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'tiered_files_most_recent_access_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'tiered_files_most_recent_access_timestamp': {'key': 'tieredFilesMostRecentAccessTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudTieringDatePolicyStatus, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.tiered_files_most_recent_access_timestamp = None + + +class CloudTieringFilesNotTiering(msrest.serialization.Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar total_file_count: Last cloud tiering result (HResult). + :vartype total_file_count: long + :ivar errors: Array of tiering errors. + :vartype errors: list[~microsoft_storage_sync.models.FilesNotTieringError] + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'total_file_count': {'readonly': True, 'minimum': 0}, + 'errors': {'readonly': True}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'total_file_count': {'key': 'totalFileCount', 'type': 'long'}, + 'errors': {'key': 'errors', 'type': '[FilesNotTieringError]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudTieringFilesNotTiering, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.total_file_count = None + self.errors = None + + +class CloudTieringSpaceSavings(msrest.serialization.Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar volume_size_bytes: Volume size. + :vartype volume_size_bytes: long + :ivar total_size_cloud_bytes: Total size of content in the azure file share. + :vartype total_size_cloud_bytes: long + :ivar cached_size_bytes: Cached content size on the server. + :vartype cached_size_bytes: long + :ivar space_savings_percent: Percentage of cached size over total size. + :vartype space_savings_percent: int + :ivar space_savings_bytes: Count of bytes saved on the server. + :vartype space_savings_bytes: long + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'volume_size_bytes': {'readonly': True, 'minimum': 0}, + 'total_size_cloud_bytes': {'readonly': True, 'minimum': 0}, + 'cached_size_bytes': {'readonly': True, 'minimum': 0}, + 'space_savings_percent': {'readonly': True, 'maximum': 100, 'minimum': 0}, + 'space_savings_bytes': {'readonly': True, 'minimum': 0}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'volume_size_bytes': {'key': 'volumeSizeBytes', 'type': 'long'}, + 'total_size_cloud_bytes': {'key': 'totalSizeCloudBytes', 'type': 'long'}, + 'cached_size_bytes': {'key': 'cachedSizeBytes', 'type': 'long'}, + 'space_savings_percent': {'key': 'spaceSavingsPercent', 'type': 'int'}, + 'space_savings_bytes': {'key': 'spaceSavingsBytes', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudTieringSpaceSavings, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.volume_size_bytes = None + self.total_size_cloud_bytes = None + self.cached_size_bytes = None + self.space_savings_percent = None + self.space_savings_bytes = None + + +class CloudTieringVolumeFreeSpacePolicyStatus(msrest.serialization.Model): + """Status of the volume free space policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar effective_volume_free_space_policy: In the case where multiple server endpoints are + present in a volume, an effective free space policy is applied. + :vartype effective_volume_free_space_policy: int + :ivar current_volume_free_space_percent: Current volume free space percentage. + :vartype current_volume_free_space_percent: int + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'effective_volume_free_space_policy': {'readonly': True, 'maximum': 100, 'minimum': 0}, + 'current_volume_free_space_percent': {'readonly': True, 'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'effective_volume_free_space_policy': {'key': 'effectiveVolumeFreeSpacePolicy', 'type': 'int'}, + 'current_volume_free_space_percent': {'key': 'currentVolumeFreeSpacePercent', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudTieringVolumeFreeSpacePolicyStatus, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.effective_volume_free_space_policy = None + self.current_volume_free_space_percent = None + + +class FilesNotTieringError(msrest.serialization.Model): + """Files not tiering error object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code (HResult). + :vartype error_code: int + :ivar file_count: Count of files with this error. + :vartype file_count: long + """ + + _validation = { + 'error_code': {'readonly': True}, + 'file_count': {'readonly': True, 'minimum': 0}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'file_count': {'key': 'fileCount', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(FilesNotTieringError, self).__init__(**kwargs) + self.error_code = None + self.file_count = None + + +class OperationDisplayInfo(msrest.serialization.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) + + +class OperationDisplayResource(msrest.serialization.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) + + +class OperationEntity(msrest.serialization.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: ~microsoft_storage_sync.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) + + +class OperationEntityListResult(msrest.serialization.Model): + """The list of storage sync operations. + + :param next_link: The link used to get the next page of operations. + :type next_link: str + :param value: The list of operations. + :type value: list[~microsoft_storage_sync.models.OperationEntity] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[OperationEntity]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationEntityListResult, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class OperationStatus(msrest.serialization.Model): + """Operation status object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation Id. + :vartype name: str + :ivar status: Operation status. + :vartype status: str + :ivar start_time: Start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time of the operation. + :vartype end_time: ~datetime.datetime + :ivar error: Error type. + :vartype error: ~microsoft_storage_sync.models.StorageSyncApiError + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'StorageSyncApiError'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatus, self).__init__(**kwargs) + self.name = None + self.status = None + self.start_time = None + self.end_time = None + self.error = None + + +class PostBackupResponse(msrest.serialization.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 + + +class PostBackupResponseProperties(msrest.serialization.Model): + """Post Backup Response Properties object. + + 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': 'cloudEndpointName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PostBackupResponseProperties, self).__init__(**kwargs) + self.cloud_endpoint_name = None + + +class PostRestoreRequest(msrest.serialization.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[~microsoft_storage_sync.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) + + +class PreRestoreRequest(msrest.serialization.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[~microsoft_storage_sync.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) + + +class RecallActionParameters(msrest.serialization.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) + + +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) + + +class RegisteredServerArray(msrest.serialization.Model): + """Array of RegisteredServer. + + :param value: Collection of Registered Server. + :type value: list[~microsoft_storage_sync.models.RegisteredServer] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RegisteredServer]'}, + } + + def __init__( + self, + **kwargs + ): + super(RegisteredServerArray, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +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) + + +class RegisteredServerCreateParametersProperties(msrest.serialization.Model): + """RegisteredServerCreateParametersProperties. + + :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 + """ + + _attribute_map = { + 'server_certificate': {'key': 'serverCertificate', 'type': 'str'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'server_os_version': {'key': 'serverOSVersion', 'type': 'str'}, + 'last_heart_beat': {'key': 'lastHeartBeat', 'type': 'str'}, + 'server_role': {'key': 'serverRole', 'type': 'str'}, + 'cluster_id': {'key': 'clusterId', 'type': 'str'}, + 'cluster_name': {'key': 'clusterName', 'type': 'str'}, + 'server_id': {'key': 'serverId', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RegisteredServerCreateParametersProperties, 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) + + +class RegisteredServerProperties(msrest.serialization.Model): + """RegisteredServer Properties object. + + :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 + """ + + _attribute_map = { + 'server_certificate': {'key': 'serverCertificate', 'type': 'str'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'server_os_version': {'key': 'serverOSVersion', 'type': 'str'}, + 'server_management_error_code': {'key': 'serverManagementErrorCode', 'type': 'int'}, + 'last_heart_beat': {'key': 'lastHeartBeat', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'server_role': {'key': 'serverRole', 'type': 'str'}, + 'cluster_id': {'key': 'clusterId', 'type': 'str'}, + 'cluster_name': {'key': 'clusterName', 'type': 'str'}, + 'server_id': {'key': 'serverId', 'type': 'str'}, + 'storage_sync_service_uid': {'key': 'storageSyncServiceUid', 'type': 'str'}, + 'last_workflow_id': {'key': 'lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'lastOperationName', 'type': 'str'}, + 'discovery_endpoint_uri': {'key': 'discoveryEndpointUri', 'type': 'str'}, + 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, + 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'management_endpoint_uri': {'key': 'managementEndpointUri', 'type': 'str'}, + 'monitoring_configuration': {'key': 'monitoringConfiguration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RegisteredServerProperties, 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) + + +class ResourcesMoveInfo(msrest.serialization.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) + + +class RestoreFileSpec(msrest.serialization.Model): + """Restore file spec. + + :param path: Restore file spec path. + :type path: str + :param isdir: Restore file spec isdir. + :type isdir: bool + """ + + _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 = kwargs.get('isdir', None) + + +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 folder used for data synchronization. + :type server_local_path: str + :param cloud_tiering: Type of the Feature Status. Possible values include: 'on', 'off'. + :type cloud_tiering: str or ~microsoft_storage_sync.models.FeatureStatus + :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it + is enabled. + :type volume_free_space_percent: int + :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: Arm resource identifier. + :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: ~microsoft_storage_sync.models.ServerEndpointSyncStatus + :param offline_data_transfer: Type of the Feature Status. Possible values include: 'on', 'off'. + :type offline_data_transfer: str or ~microsoft_storage_sync.models.FeatureStatus + :ivar offline_data_transfer_storage_account_resource_id: Offline data transfer storage account + resource ID. + :vartype offline_data_transfer_storage_account_resource_id: str + :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 + :ivar cloud_tiering_status: Server endpoint cloud tiering status object. + :vartype cloud_tiering_status: ~microsoft_storage_sync.models.ServerEndpointCloudTieringStatus + :ivar recall_status: Server endpoint recall status object. + :vartype recall_status: ~microsoft_storage_sync.models.ServerEndpointRecallStatus + """ + + _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}, + 'cloud_tiering_status': {'readonly': True}, + 'recall_status': {'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'}, + 'cloud_tiering_status': {'key': 'properties.cloudTieringStatus', 'type': 'ServerEndpointCloudTieringStatus'}, + 'recall_status': {'key': 'properties.recallStatus', 'type': 'ServerEndpointRecallStatus'}, + } + + 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) + self.cloud_tiering_status = None + self.recall_status = None + + +class ServerEndpointArray(msrest.serialization.Model): + """Array of ServerEndpoint. + + :param value: Collection of ServerEndpoint. + :type value: list[~microsoft_storage_sync.models.ServerEndpoint] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServerEndpoint]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerEndpointArray, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ServerEndpointCloudTieringStatus(msrest.serialization.Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar health: Type of the cloud tiering health state. Possible values include: 'Healthy', + 'Error'. + :vartype health: str or ~microsoft_storage_sync.models.ServerEndpointCloudTieringHealthState + :ivar health_last_updated_timestamp: The last updated timestamp of health state. + :vartype health_last_updated_timestamp: ~datetime.datetime + :ivar last_cloud_tiering_result: Last cloud tiering result (HResult). + :vartype last_cloud_tiering_result: int + :ivar last_success_timestamp: Last cloud tiering success timestamp. + :vartype last_success_timestamp: ~datetime.datetime + :ivar space_savings: Server endpoint cloud tiering status object. + :vartype space_savings: ~microsoft_storage_sync.models.CloudTieringSpaceSavings + :ivar cache_performance: Server endpoint cloud tiering status object. + :vartype cache_performance: ~microsoft_storage_sync.models.CloudTieringCachePerformance + :ivar files_not_tiering: Server endpoint cloud tiering status object. + :vartype files_not_tiering: ~microsoft_storage_sync.models.CloudTieringFilesNotTiering + :ivar volume_free_space_policy_status: Status of the volume free space policy. + :vartype volume_free_space_policy_status: + ~microsoft_storage_sync.models.CloudTieringVolumeFreeSpacePolicyStatus + :ivar date_policy_status: Status of the date policy. + :vartype date_policy_status: ~microsoft_storage_sync.models.CloudTieringDatePolicyStatus + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'health': {'readonly': True}, + 'health_last_updated_timestamp': {'readonly': True}, + 'last_cloud_tiering_result': {'readonly': True}, + 'last_success_timestamp': {'readonly': True}, + 'space_savings': {'readonly': True}, + 'cache_performance': {'readonly': True}, + 'files_not_tiering': {'readonly': True}, + 'volume_free_space_policy_status': {'readonly': True}, + 'date_policy_status': {'readonly': True}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'health': {'key': 'health', 'type': 'str'}, + 'health_last_updated_timestamp': {'key': 'healthLastUpdatedTimestamp', 'type': 'iso-8601'}, + 'last_cloud_tiering_result': {'key': 'lastCloudTieringResult', 'type': 'int'}, + 'last_success_timestamp': {'key': 'lastSuccessTimestamp', 'type': 'iso-8601'}, + 'space_savings': {'key': 'spaceSavings', 'type': 'CloudTieringSpaceSavings'}, + 'cache_performance': {'key': 'cachePerformance', 'type': 'CloudTieringCachePerformance'}, + 'files_not_tiering': {'key': 'filesNotTiering', 'type': 'CloudTieringFilesNotTiering'}, + 'volume_free_space_policy_status': {'key': 'volumeFreeSpacePolicyStatus', 'type': 'CloudTieringVolumeFreeSpacePolicyStatus'}, + 'date_policy_status': {'key': 'datePolicyStatus', 'type': 'CloudTieringDatePolicyStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerEndpointCloudTieringStatus, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.health = None + self.health_last_updated_timestamp = None + self.last_cloud_tiering_result = None + self.last_success_timestamp = None + self.space_savings = None + self.cache_performance = None + self.files_not_tiering = None + self.volume_free_space_policy_status = None + self.date_policy_status = None + + +class ServerEndpointCreateParameters(ProxyResource): + """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 folder used for data synchronization. + :type server_local_path: str + :param cloud_tiering: Type of the Feature Status. Possible values include: 'on', 'off'. + :type cloud_tiering: str or ~microsoft_storage_sync.models.FeatureStatus + :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it + is enabled. + :type volume_free_space_percent: int + :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: Arm resource identifier. + :type server_resource_id: str + :param offline_data_transfer: Type of the Feature Status. Possible values include: 'on', 'off'. + :type offline_data_transfer: str or ~microsoft_storage_sync.models.FeatureStatus + :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) + + +class ServerEndpointCreateParametersProperties(msrest.serialization.Model): + """ServerEndpoint Properties object. + + :param server_local_path: Server folder used for data synchronization. + :type server_local_path: str + :param cloud_tiering: Type of the Feature Status. Possible values include: 'on', 'off'. + :type cloud_tiering: str or ~microsoft_storage_sync.models.FeatureStatus + :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it + is enabled. + :type volume_free_space_percent: int + :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: Arm resource identifier. + :type server_resource_id: str + :param offline_data_transfer: Type of the Feature Status. Possible values include: 'on', 'off'. + :type offline_data_transfer: str or ~microsoft_storage_sync.models.FeatureStatus + :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 = { + 'server_local_path': {'key': 'serverLocalPath', 'type': 'str'}, + 'cloud_tiering': {'key': 'cloudTiering', 'type': 'str'}, + 'volume_free_space_percent': {'key': 'volumeFreeSpacePercent', 'type': 'int'}, + 'tier_files_older_than_days': {'key': 'tierFilesOlderThanDays', 'type': 'int'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'server_resource_id': {'key': 'serverResourceId', 'type': 'str'}, + 'offline_data_transfer': {'key': 'offlineDataTransfer', 'type': 'str'}, + 'offline_data_transfer_share_name': {'key': 'offlineDataTransferShareName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerEndpointCreateParametersProperties, 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) + + +class ServerEndpointFilesNotSyncingError(msrest.serialization.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, 'minimum': 0}, + 'transient_count': {'readonly': True, 'minimum': 0}, + } + + _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(ServerEndpointFilesNotSyncingError, self).__init__(**kwargs) + self.error_code = None + self.persistent_count = None + self.transient_count = None + + +class ServerEndpointProperties(msrest.serialization.Model): + """ServerEndpoint Properties object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param server_local_path: Server folder used for data synchronization. + :type server_local_path: str + :param cloud_tiering: Type of the Feature Status. Possible values include: 'on', 'off'. + :type cloud_tiering: str or ~microsoft_storage_sync.models.FeatureStatus + :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it + is enabled. + :type volume_free_space_percent: int + :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: Arm resource identifier. + :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: ~microsoft_storage_sync.models.ServerEndpointSyncStatus + :param offline_data_transfer: Type of the Feature Status. Possible values include: 'on', 'off'. + :type offline_data_transfer: str or ~microsoft_storage_sync.models.FeatureStatus + :ivar offline_data_transfer_storage_account_resource_id: Offline data transfer storage account + resource ID. + :vartype offline_data_transfer_storage_account_resource_id: str + :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 + :ivar cloud_tiering_status: Server endpoint cloud tiering status object. + :vartype cloud_tiering_status: ~microsoft_storage_sync.models.ServerEndpointCloudTieringStatus + :ivar recall_status: Server endpoint recall status object. + :vartype recall_status: ~microsoft_storage_sync.models.ServerEndpointRecallStatus + """ + + _validation = { + '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}, + 'cloud_tiering_status': {'readonly': True}, + 'recall_status': {'readonly': True}, + } + + _attribute_map = { + 'server_local_path': {'key': 'serverLocalPath', 'type': 'str'}, + 'cloud_tiering': {'key': 'cloudTiering', 'type': 'str'}, + 'volume_free_space_percent': {'key': 'volumeFreeSpacePercent', 'type': 'int'}, + 'tier_files_older_than_days': {'key': 'tierFilesOlderThanDays', 'type': 'int'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'server_resource_id': {'key': 'serverResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'last_workflow_id': {'key': 'lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'lastOperationName', 'type': 'str'}, + 'sync_status': {'key': 'syncStatus', 'type': 'ServerEndpointSyncStatus'}, + 'offline_data_transfer': {'key': 'offlineDataTransfer', 'type': 'str'}, + 'offline_data_transfer_storage_account_resource_id': {'key': 'offlineDataTransferStorageAccountResourceId', 'type': 'str'}, + 'offline_data_transfer_storage_account_tenant_id': {'key': 'offlineDataTransferStorageAccountTenantId', 'type': 'str'}, + 'offline_data_transfer_share_name': {'key': 'offlineDataTransferShareName', 'type': 'str'}, + 'cloud_tiering_status': {'key': 'cloudTieringStatus', 'type': 'ServerEndpointCloudTieringStatus'}, + 'recall_status': {'key': 'recallStatus', 'type': 'ServerEndpointRecallStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerEndpointProperties, 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) + self.cloud_tiering_status = None + self.recall_status = None + + +class ServerEndpointRecallError(msrest.serialization.Model): + """Server endpoint recall 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 count: Count of occurences of the error. + :vartype count: long + """ + + _validation = { + 'error_code': {'readonly': True}, + 'count': {'readonly': True, 'minimum': 0}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerEndpointRecallError, self).__init__(**kwargs) + self.error_code = None + self.count = None + + +class ServerEndpointRecallStatus(msrest.serialization.Model): + """Server endpoint recall status object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar total_recall_errors_count: Total count of recall errors. + :vartype total_recall_errors_count: long + :ivar recall_errors: Array of recall errors. + :vartype recall_errors: list[~microsoft_storage_sync.models.ServerEndpointRecallError] + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'total_recall_errors_count': {'readonly': True, 'minimum': 0}, + 'recall_errors': {'readonly': True}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'total_recall_errors_count': {'key': 'totalRecallErrorsCount', 'type': 'long'}, + 'recall_errors': {'key': 'recallErrors', 'type': '[ServerEndpointRecallError]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerEndpointRecallStatus, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.total_recall_errors_count = None + self.recall_errors = None + + +class ServerEndpointSyncActivityStatus(msrest.serialization.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.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, 'minimum': 0}, + 'applied_item_count': {'readonly': True, 'minimum': 0}, + 'total_item_count': {'readonly': True, 'minimum': 0}, + 'applied_bytes': {'readonly': True, 'minimum': 0}, + 'total_bytes': {'readonly': True, 'minimum': 0}, + } + + _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(ServerEndpointSyncActivityStatus, 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 + + +class ServerEndpointSyncSessionStatus(msrest.serialization.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.datetime + :ivar last_sync_success_timestamp: Last sync success timestamp. + :vartype last_sync_success_timestamp: ~datetime.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. + :vartype persistent_files_not_syncing_count: long + :ivar transient_files_not_syncing_count: Count of transient files not syncing. + :vartype transient_files_not_syncing_count: long + :ivar files_not_syncing_errors: Array of per-item errors coming from the last sync session. + :vartype files_not_syncing_errors: + list[~microsoft_storage_sync.models.ServerEndpointFilesNotSyncingError] + """ + + _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, 'minimum': 0}, + 'persistent_files_not_syncing_count': {'readonly': True, 'minimum': 0}, + 'transient_files_not_syncing_count': {'readonly': True, 'minimum': 0}, + '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': '[ServerEndpointFilesNotSyncingError]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerEndpointSyncSessionStatus, 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 + + +class ServerEndpointSyncStatus(msrest.serialization.Model): + """Server Endpoint sync status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar download_health: Type of the sync health state. Possible values include: 'Healthy', + 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity'. + :vartype download_health: str or ~microsoft_storage_sync.models.ServerEndpointSyncHealthState + :ivar upload_health: Type of the sync health state. Possible values include: 'Healthy', + 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity'. + :vartype upload_health: str or ~microsoft_storage_sync.models.ServerEndpointSyncHealthState + :ivar combined_health: Type of the sync health state. Possible values include: 'Healthy', + 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity'. + :vartype combined_health: str or ~microsoft_storage_sync.models.ServerEndpointSyncHealthState + :ivar sync_activity: Type of the sync activity state. Possible values include: 'Upload', + 'Download', 'UploadAndDownload'. + :vartype sync_activity: str or ~microsoft_storage_sync.models.ServerEndpointSyncActivityState + :ivar total_persistent_files_not_syncing_count: Total count of persistent files not syncing + (combined upload + download). + :vartype total_persistent_files_not_syncing_count: long + :ivar last_updated_timestamp: Last Updated Timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar upload_status: Sync Session status object. + :vartype upload_status: ~microsoft_storage_sync.models.ServerEndpointSyncSessionStatus + :ivar download_status: Sync Session status object. + :vartype download_status: ~microsoft_storage_sync.models.ServerEndpointSyncSessionStatus + :ivar upload_activity: Sync Session status object. + :vartype upload_activity: ~microsoft_storage_sync.models.ServerEndpointSyncActivityStatus + :ivar download_activity: Sync Session status object. + :vartype download_activity: ~microsoft_storage_sync.models.ServerEndpointSyncActivityStatus + :ivar offline_data_transfer_status: Type of the Health state. Possible values include: + 'InProgress', 'Stopping', 'NotRunning', 'Complete'. + :vartype offline_data_transfer_status: str or + ~microsoft_storage_sync.models.ServerEndpointOfflineDataTransferState + """ + + _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, 'minimum': 0}, + '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': 'ServerEndpointSyncSessionStatus'}, + 'download_status': {'key': 'downloadStatus', 'type': 'ServerEndpointSyncSessionStatus'}, + 'upload_activity': {'key': 'uploadActivity', 'type': 'ServerEndpointSyncActivityStatus'}, + 'download_activity': {'key': 'downloadActivity', 'type': 'ServerEndpointSyncActivityStatus'}, + '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 + + +class ServerEndpointUpdateParameters(msrest.serialization.Model): + """Parameters for updating an Server Endpoint. + + :param cloud_tiering: Type of the Feature Status. Possible values include: 'on', 'off'. + :type cloud_tiering: str or ~microsoft_storage_sync.models.FeatureStatus + :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it + is enabled. + :type volume_free_space_percent: int + :param tier_files_older_than_days: Tier files older than days. + :type tier_files_older_than_days: int + :param offline_data_transfer: Type of the Feature Status. Possible values include: 'on', 'off'. + :type offline_data_transfer: str or ~microsoft_storage_sync.models.FeatureStatus + :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) + + +class ServerEndpointUpdateProperties(msrest.serialization.Model): + """ServerEndpoint Update Properties object. + + :param cloud_tiering: Type of the Feature Status. Possible values include: 'on', 'off'. + :type cloud_tiering: str or ~microsoft_storage_sync.models.FeatureStatus + :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it + is enabled. + :type volume_free_space_percent: int + :param tier_files_older_than_days: Tier files older than days. + :type tier_files_older_than_days: int + :param offline_data_transfer: Type of the Feature Status. Possible values include: 'on', 'off'. + :type offline_data_transfer: str or ~microsoft_storage_sync.models.FeatureStatus + :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': 'cloudTiering', 'type': 'str'}, + 'volume_free_space_percent': {'key': 'volumeFreeSpacePercent', 'type': 'int'}, + 'tier_files_older_than_days': {'key': 'tierFilesOlderThanDays', 'type': 'int'}, + 'offline_data_transfer': {'key': 'offlineDataTransfer', 'type': 'str'}, + 'offline_data_transfer_share_name': {'key': 'offlineDataTransferShareName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerEndpointUpdateProperties, 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) + + +class StorageSyncApiError(msrest.serialization.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 object. + :type details: ~microsoft_storage_sync.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) + + +class StorageSyncErrorException(HttpResponseError): + """Server responded with exception of type: 'StorageSyncError'. + + :param response: Server response to be deserialized. + :param error_model: A deserialized model of the response body as model. + """ + + def __init__(self, response, error_model): + self.error = error_model + super(StorageSyncErrorException, self).__init__(response=response, error_model=error_model) + + @classmethod + def from_response(cls, response, deserialize): + """Deserialize this response as this exception, or a subclass of this exception. + + :param response: Server response to be deserialized. + :param deserialize: A deserializer + """ + model_name = 'StorageSyncError' + error = deserialize(model_name, response) + if error is None: + error = deserialize.dependencies[model_name]() + return error._EXCEPTION_TYPE(response, error) + + +class StorageSyncError(msrest.serialization.Model): + """Error type. + + :param error: Error type. + :type error: ~microsoft_storage_sync.models.StorageSyncApiError + :param innererror: Error type. + :type innererror: ~microsoft_storage_sync.models.StorageSyncApiError + """ + _EXCEPTION_TYPE = StorageSyncErrorException + + _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 StorageSyncErrorDetails(msrest.serialization.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) + + +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: A set of 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) + + +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: A set of 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 + + +class StorageSyncServiceArray(msrest.serialization.Model): + """Array of StorageSyncServices. + + :param value: Collection of StorageSyncServices. + :type value: list[~microsoft_storage_sync.models.StorageSyncService] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageSyncService]'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageSyncServiceArray, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class StorageSyncServiceCreateParameters(msrest.serialization.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: A set of 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: Any object. + :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) + + +class StorageSyncServiceProperties(msrest.serialization.Model): + """Storage Sync Service Properties object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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 = { + 'storage_sync_service_status': {'readonly': True}, + 'storage_sync_service_uid': {'readonly': True}, + } + + _attribute_map = { + 'storage_sync_service_status': {'key': 'storageSyncServiceStatus', 'type': 'int'}, + 'storage_sync_service_uid': {'key': 'storageSyncServiceUid', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageSyncServiceProperties, self).__init__(**kwargs) + self.storage_sync_service_status = None + self.storage_sync_service_uid = None + + +class StorageSyncServiceUpdateParameters(msrest.serialization.Model): + """Parameters for updating an Storage sync service. + + :param tags: A set of tags. The user-specified tags associated with the storage sync service. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageSyncServiceUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class StorageSyncServiceUpdateProperties(msrest.serialization.Model): + """Storage Sync Service Update Properties object. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(StorageSyncServiceUpdateProperties, self).__init__(**kwargs) + + +class SubscriptionState(msrest.serialization.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 ~microsoft_storage_sync.models.Reason + :ivar istransitioning: Is Transitioning. + :vartype istransitioning: bool + """ + + _validation = { + 'istransitioning': {'readonly': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'istransitioning': {'key': 'istransitioning', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionState, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.istransitioning = None + + +class SubscriptionStateProperties(msrest.serialization.Model): + """Subscription State properties. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionStateProperties, self).__init__(**kwargs) + + +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 + :ivar unique_id: Unique Id. + :vartype 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}, + 'unique_id': {'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 = None + self.sync_group_status = None + + +class SyncGroupArray(msrest.serialization.Model): + """Array of SyncGroup. + + :param value: Collection of SyncGroup. + :type value: list[~microsoft_storage_sync.models.SyncGroup] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SyncGroup]'}, + } + + def __init__( + self, + **kwargs + ): + super(SyncGroupArray, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +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 + """ + + _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(SyncGroupCreateParameters, self).__init__(**kwargs) + + +class SyncGroupCreateParametersProperties(msrest.serialization.Model): + """Sync Group Create Properties object. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(SyncGroupCreateParametersProperties, self).__init__(**kwargs) + + +class SyncGroupProperties(msrest.serialization.Model): + """SyncGroup Properties object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unique_id: Unique Id. + :vartype unique_id: str + :ivar sync_group_status: Sync group status. + :vartype sync_group_status: str + """ + + _validation = { + 'unique_id': {'readonly': True}, + 'sync_group_status': {'readonly': True}, + } + + _attribute_map = { + 'unique_id': {'key': 'uniqueId', 'type': 'str'}, + 'sync_group_status': {'key': 'syncGroupStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SyncGroupProperties, self).__init__(**kwargs) + self.unique_id = None + self.sync_group_status = None + + +class TriggerChangeDetectionParameters(msrest.serialization.Model): + """The parameters used when calling trigger change detection action on cloud endpoint. + + :param directory_path: Relative path to a directory Azure File share for which change detection + is to be performed. + :type directory_path: str + :param change_detection_mode: Change Detection Mode. Applies to a directory specified in + directoryPath parameter. Possible values include: 'Default', 'Recursive'. + :type change_detection_mode: str or ~microsoft_storage_sync.models.ChangeDetectionMode + :param paths: Array of relative paths on the Azure File share to be included in the change + detection. Can be files and directories. + :type paths: list[str] + """ + + _attribute_map = { + 'directory_path': {'key': 'directoryPath', 'type': 'str'}, + 'change_detection_mode': {'key': 'changeDetectionMode', 'type': 'str'}, + 'paths': {'key': 'paths', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggerChangeDetectionParameters, self).__init__(**kwargs) + self.directory_path = kwargs.get('directory_path', None) + self.change_detection_mode = kwargs.get('change_detection_mode', None) + self.paths = kwargs.get('paths', None) + + +class TriggerRolloverRequest(msrest.serialization.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) + + +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: Type of the Workflow Status. Possible values include: 'active', 'expired', + 'succeeded', 'aborted', 'failed'. + :type status: str or ~microsoft_storage_sync.models.WorkflowStatus + :param operation: Type of the Operation Direction. Possible values include: 'do', 'undo', + 'cancel'. + :type operation: str or ~microsoft_storage_sync.models.OperationDirection + :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) + + +class WorkflowArray(msrest.serialization.Model): + """Array of Workflow. + + :param value: Collection of workflow items. + :type value: list[~microsoft_storage_sync.models.Workflow] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Workflow]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowArray, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class WorkflowProperties(msrest.serialization.Model): + """Workflow Properties object. + + :param last_step_name: last step name. + :type last_step_name: str + :param status: Type of the Workflow Status. Possible values include: 'active', 'expired', + 'succeeded', 'aborted', 'failed'. + :type status: str or ~microsoft_storage_sync.models.WorkflowStatus + :param operation: Type of the Operation Direction. Possible values include: 'do', 'undo', + 'cancel'. + :type operation: str or ~microsoft_storage_sync.models.OperationDirection + :param steps: workflow steps. + :type steps: str + :param last_operation_id: workflow last operation identifier. + :type last_operation_id: str + """ + + _attribute_map = { + 'last_step_name': {'key': 'lastStepName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'steps': {'key': 'steps', 'type': 'str'}, + 'last_operation_id': {'key': 'lastOperationId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowProperties, 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/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models_py3.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models_py3.py new file mode 100644 index 00000000000..97cbbde3a68 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models_py3.py @@ -0,0 +1,3088 @@ +# 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 typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Resource(msrest.serialization.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 + + +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 + + +class BackupRequest(msrest.serialization.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: Optional[str] = None, + **kwargs + ): + super(BackupRequest, self).__init__(**kwargs) + self.azure_file_share = azure_file_share + + +class CheckNameAvailabilityParameters(msrest.serialization.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 + ): + super(CheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class CheckNameAvailabilityResult(msrest.serialization.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 ~microsoft_storage_sync.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': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +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) + + +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: Optional[str] = None, + azure_file_share_name: Optional[str] = None, + storage_account_tenant_id: Optional[str] = None, + partnership_id: Optional[str] = None, + friendly_name: Optional[str] = None, + provisioning_state: Optional[str] = None, + last_workflow_id: Optional[str] = None, + last_operation_name: Optional[str] = None, + **kwargs + ): + 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 + + +class CloudEndpointArray(msrest.serialization.Model): + """Array of CloudEndpoint. + + :param value: Collection of CloudEndpoint. + :type value: list[~microsoft_storage_sync.models.CloudEndpoint] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CloudEndpoint]'}, + } + + def __init__( + self, + *, + value: Optional[List["CloudEndpoint"]] = None, + **kwargs + ): + super(CloudEndpointArray, self).__init__(**kwargs) + self.value = value + + +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 + :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'}, + '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'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_resource_id: Optional[str] = None, + azure_file_share_name: Optional[str] = None, + storage_account_tenant_id: Optional[str] = None, + friendly_name: Optional[str] = None, + **kwargs + ): + 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 + self.friendly_name = friendly_name + + +class CloudEndpointCreateParametersProperties(msrest.serialization.Model): + """CloudEndpoint Properties object. + + :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 friendly_name: Friendly Name. + :type friendly_name: str + """ + + _attribute_map = { + 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, + 'azure_file_share_name': {'key': 'azureFileShareName', 'type': 'str'}, + 'storage_account_tenant_id': {'key': 'storageAccountTenantId', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_resource_id: Optional[str] = None, + azure_file_share_name: Optional[str] = None, + storage_account_tenant_id: Optional[str] = None, + friendly_name: Optional[str] = None, + **kwargs + ): + super(CloudEndpointCreateParametersProperties, 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.friendly_name = friendly_name + + +class CloudEndpointProperties(msrest.serialization.Model): + """CloudEndpoint Properties object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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 = { + 'backup_enabled': {'readonly': True}, + } + + _attribute_map = { + 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, + 'azure_file_share_name': {'key': 'azureFileShareName', 'type': 'str'}, + 'storage_account_tenant_id': {'key': 'storageAccountTenantId', 'type': 'str'}, + 'partnership_id': {'key': 'partnershipId', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_enabled': {'key': 'backupEnabled', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'last_workflow_id': {'key': 'lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'lastOperationName', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_resource_id: Optional[str] = None, + azure_file_share_name: Optional[str] = None, + storage_account_tenant_id: Optional[str] = None, + partnership_id: Optional[str] = None, + friendly_name: Optional[str] = None, + provisioning_state: Optional[str] = None, + last_workflow_id: Optional[str] = None, + last_operation_name: Optional[str] = None, + **kwargs + ): + super(CloudEndpointProperties, 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 + + +class CloudTieringCachePerformance(msrest.serialization.Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar cache_hit_bytes: Count of bytes that were served from the local server. + :vartype cache_hit_bytes: long + :ivar cache_miss_bytes: Count of bytes that were served from the cloud. + :vartype cache_miss_bytes: long + :ivar cache_hit_bytes_percent: Percentage of total bytes (hit + miss) that were served from the + local server. + :vartype cache_hit_bytes_percent: int + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'cache_hit_bytes': {'readonly': True, 'minimum': 0}, + 'cache_miss_bytes': {'readonly': True, 'minimum': 0}, + 'cache_hit_bytes_percent': {'readonly': True, 'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'cache_hit_bytes': {'key': 'cacheHitBytes', 'type': 'long'}, + 'cache_miss_bytes': {'key': 'cacheMissBytes', 'type': 'long'}, + 'cache_hit_bytes_percent': {'key': 'cacheHitBytesPercent', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudTieringCachePerformance, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.cache_hit_bytes = None + self.cache_miss_bytes = None + self.cache_hit_bytes_percent = None + + +class CloudTieringDatePolicyStatus(msrest.serialization.Model): + """Status of the date policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar tiered_files_most_recent_access_timestamp: Most recent access time of tiered files. + :vartype tiered_files_most_recent_access_timestamp: ~datetime.datetime + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'tiered_files_most_recent_access_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'tiered_files_most_recent_access_timestamp': {'key': 'tieredFilesMostRecentAccessTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudTieringDatePolicyStatus, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.tiered_files_most_recent_access_timestamp = None + + +class CloudTieringFilesNotTiering(msrest.serialization.Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar total_file_count: Last cloud tiering result (HResult). + :vartype total_file_count: long + :ivar errors: Array of tiering errors. + :vartype errors: list[~microsoft_storage_sync.models.FilesNotTieringError] + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'total_file_count': {'readonly': True, 'minimum': 0}, + 'errors': {'readonly': True}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'total_file_count': {'key': 'totalFileCount', 'type': 'long'}, + 'errors': {'key': 'errors', 'type': '[FilesNotTieringError]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudTieringFilesNotTiering, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.total_file_count = None + self.errors = None + + +class CloudTieringSpaceSavings(msrest.serialization.Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar volume_size_bytes: Volume size. + :vartype volume_size_bytes: long + :ivar total_size_cloud_bytes: Total size of content in the azure file share. + :vartype total_size_cloud_bytes: long + :ivar cached_size_bytes: Cached content size on the server. + :vartype cached_size_bytes: long + :ivar space_savings_percent: Percentage of cached size over total size. + :vartype space_savings_percent: int + :ivar space_savings_bytes: Count of bytes saved on the server. + :vartype space_savings_bytes: long + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'volume_size_bytes': {'readonly': True, 'minimum': 0}, + 'total_size_cloud_bytes': {'readonly': True, 'minimum': 0}, + 'cached_size_bytes': {'readonly': True, 'minimum': 0}, + 'space_savings_percent': {'readonly': True, 'maximum': 100, 'minimum': 0}, + 'space_savings_bytes': {'readonly': True, 'minimum': 0}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'volume_size_bytes': {'key': 'volumeSizeBytes', 'type': 'long'}, + 'total_size_cloud_bytes': {'key': 'totalSizeCloudBytes', 'type': 'long'}, + 'cached_size_bytes': {'key': 'cachedSizeBytes', 'type': 'long'}, + 'space_savings_percent': {'key': 'spaceSavingsPercent', 'type': 'int'}, + 'space_savings_bytes': {'key': 'spaceSavingsBytes', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudTieringSpaceSavings, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.volume_size_bytes = None + self.total_size_cloud_bytes = None + self.cached_size_bytes = None + self.space_savings_percent = None + self.space_savings_bytes = None + + +class CloudTieringVolumeFreeSpacePolicyStatus(msrest.serialization.Model): + """Status of the volume free space policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar effective_volume_free_space_policy: In the case where multiple server endpoints are + present in a volume, an effective free space policy is applied. + :vartype effective_volume_free_space_policy: int + :ivar current_volume_free_space_percent: Current volume free space percentage. + :vartype current_volume_free_space_percent: int + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'effective_volume_free_space_policy': {'readonly': True, 'maximum': 100, 'minimum': 0}, + 'current_volume_free_space_percent': {'readonly': True, 'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'effective_volume_free_space_policy': {'key': 'effectiveVolumeFreeSpacePolicy', 'type': 'int'}, + 'current_volume_free_space_percent': {'key': 'currentVolumeFreeSpacePercent', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudTieringVolumeFreeSpacePolicyStatus, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.effective_volume_free_space_policy = None + self.current_volume_free_space_percent = None + + +class FilesNotTieringError(msrest.serialization.Model): + """Files not tiering error object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code (HResult). + :vartype error_code: int + :ivar file_count: Count of files with this error. + :vartype file_count: long + """ + + _validation = { + 'error_code': {'readonly': True}, + 'file_count': {'readonly': True, 'minimum': 0}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'file_count': {'key': 'fileCount', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(FilesNotTieringError, self).__init__(**kwargs) + self.error_code = None + self.file_count = None + + +class OperationDisplayInfo(msrest.serialization.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: Optional[str] = None, + operation: Optional[str] = None, + provider: Optional[str] = None, + resource: Optional[str] = None, + **kwargs + ): + super(OperationDisplayInfo, self).__init__(**kwargs) + self.description = description + self.operation = operation + self.provider = provider + self.resource = resource + + +class OperationDisplayResource(msrest.serialization.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: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplayResource, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationEntity(msrest.serialization.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: ~microsoft_storage_sync.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: Optional[str] = None, + display: Optional["OperationDisplayInfo"] = None, + origin: Optional[str] = None, + **kwargs + ): + super(OperationEntity, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + + +class OperationEntityListResult(msrest.serialization.Model): + """The list of storage sync operations. + + :param next_link: The link used to get the next page of operations. + :type next_link: str + :param value: The list of operations. + :type value: list[~microsoft_storage_sync.models.OperationEntity] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[OperationEntity]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["OperationEntity"]] = None, + **kwargs + ): + super(OperationEntityListResult, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class OperationStatus(msrest.serialization.Model): + """Operation status object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation Id. + :vartype name: str + :ivar status: Operation status. + :vartype status: str + :ivar start_time: Start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time of the operation. + :vartype end_time: ~datetime.datetime + :ivar error: Error type. + :vartype error: ~microsoft_storage_sync.models.StorageSyncApiError + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'StorageSyncApiError'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatus, self).__init__(**kwargs) + self.name = None + self.status = None + self.start_time = None + self.end_time = None + self.error = None + + +class PostBackupResponse(msrest.serialization.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 + + +class PostBackupResponseProperties(msrest.serialization.Model): + """Post Backup Response Properties object. + + 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': 'cloudEndpointName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PostBackupResponseProperties, self).__init__(**kwargs) + self.cloud_endpoint_name = None + + +class PostRestoreRequest(msrest.serialization.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[~microsoft_storage_sync.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: Optional[str] = None, + replica_group: Optional[str] = None, + request_id: Optional[str] = None, + azure_file_share_uri: Optional[str] = None, + status: Optional[str] = None, + source_azure_file_share_uri: Optional[str] = None, + failed_file_list: Optional[str] = None, + restore_file_spec: Optional[List["RestoreFileSpec"]] = None, + **kwargs + ): + 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 + + +class PreRestoreRequest(msrest.serialization.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[~microsoft_storage_sync.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: Optional[str] = None, + replica_group: Optional[str] = None, + request_id: Optional[str] = None, + azure_file_share_uri: Optional[str] = None, + status: Optional[str] = None, + source_azure_file_share_uri: Optional[str] = None, + backup_metadata_property_bag: Optional[str] = None, + restore_file_spec: Optional[List["RestoreFileSpec"]] = None, + pause_wait_for_sync_drain_time_period_in_seconds: Optional[int] = None, + **kwargs + ): + 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 + + +class RecallActionParameters(msrest.serialization.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: Optional[str] = None, + recall_path: Optional[str] = None, + **kwargs + ): + super(RecallActionParameters, self).__init__(**kwargs) + self.pattern = pattern + self.recall_path = recall_path + + +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: Optional[str] = None, + agent_version: Optional[str] = None, + server_os_version: Optional[str] = None, + server_management_error_code: Optional[int] = None, + last_heart_beat: Optional[str] = None, + provisioning_state: Optional[str] = None, + server_role: Optional[str] = None, + cluster_id: Optional[str] = None, + cluster_name: Optional[str] = None, + server_id: Optional[str] = None, + storage_sync_service_uid: Optional[str] = None, + last_workflow_id: Optional[str] = None, + last_operation_name: Optional[str] = None, + discovery_endpoint_uri: Optional[str] = None, + resource_location: Optional[str] = None, + service_location: Optional[str] = None, + friendly_name: Optional[str] = None, + management_endpoint_uri: Optional[str] = None, + monitoring_configuration: Optional[str] = None, + **kwargs + ): + 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 + + +class RegisteredServerArray(msrest.serialization.Model): + """Array of RegisteredServer. + + :param value: Collection of Registered Server. + :type value: list[~microsoft_storage_sync.models.RegisteredServer] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RegisteredServer]'}, + } + + def __init__( + self, + *, + value: Optional[List["RegisteredServer"]] = None, + **kwargs + ): + super(RegisteredServerArray, self).__init__(**kwargs) + self.value = value + + +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: Optional[str] = None, + agent_version: Optional[str] = None, + server_os_version: Optional[str] = None, + last_heart_beat: Optional[str] = None, + server_role: Optional[str] = None, + cluster_id: Optional[str] = None, + cluster_name: Optional[str] = None, + server_id: Optional[str] = None, + friendly_name: Optional[str] = None, + **kwargs + ): + 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 + + +class RegisteredServerCreateParametersProperties(msrest.serialization.Model): + """RegisteredServerCreateParametersProperties. + + :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 + """ + + _attribute_map = { + 'server_certificate': {'key': 'serverCertificate', 'type': 'str'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'server_os_version': {'key': 'serverOSVersion', 'type': 'str'}, + 'last_heart_beat': {'key': 'lastHeartBeat', 'type': 'str'}, + 'server_role': {'key': 'serverRole', 'type': 'str'}, + 'cluster_id': {'key': 'clusterId', 'type': 'str'}, + 'cluster_name': {'key': 'clusterName', 'type': 'str'}, + 'server_id': {'key': 'serverId', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + } + + def __init__( + self, + *, + server_certificate: Optional[str] = None, + agent_version: Optional[str] = None, + server_os_version: Optional[str] = None, + last_heart_beat: Optional[str] = None, + server_role: Optional[str] = None, + cluster_id: Optional[str] = None, + cluster_name: Optional[str] = None, + server_id: Optional[str] = None, + friendly_name: Optional[str] = None, + **kwargs + ): + super(RegisteredServerCreateParametersProperties, 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 + + +class RegisteredServerProperties(msrest.serialization.Model): + """RegisteredServer Properties object. + + :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 + """ + + _attribute_map = { + 'server_certificate': {'key': 'serverCertificate', 'type': 'str'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'server_os_version': {'key': 'serverOSVersion', 'type': 'str'}, + 'server_management_error_code': {'key': 'serverManagementErrorCode', 'type': 'int'}, + 'last_heart_beat': {'key': 'lastHeartBeat', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'server_role': {'key': 'serverRole', 'type': 'str'}, + 'cluster_id': {'key': 'clusterId', 'type': 'str'}, + 'cluster_name': {'key': 'clusterName', 'type': 'str'}, + 'server_id': {'key': 'serverId', 'type': 'str'}, + 'storage_sync_service_uid': {'key': 'storageSyncServiceUid', 'type': 'str'}, + 'last_workflow_id': {'key': 'lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'lastOperationName', 'type': 'str'}, + 'discovery_endpoint_uri': {'key': 'discoveryEndpointUri', 'type': 'str'}, + 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, + 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'management_endpoint_uri': {'key': 'managementEndpointUri', 'type': 'str'}, + 'monitoring_configuration': {'key': 'monitoringConfiguration', 'type': 'str'}, + } + + def __init__( + self, + *, + server_certificate: Optional[str] = None, + agent_version: Optional[str] = None, + server_os_version: Optional[str] = None, + server_management_error_code: Optional[int] = None, + last_heart_beat: Optional[str] = None, + provisioning_state: Optional[str] = None, + server_role: Optional[str] = None, + cluster_id: Optional[str] = None, + cluster_name: Optional[str] = None, + server_id: Optional[str] = None, + storage_sync_service_uid: Optional[str] = None, + last_workflow_id: Optional[str] = None, + last_operation_name: Optional[str] = None, + discovery_endpoint_uri: Optional[str] = None, + resource_location: Optional[str] = None, + service_location: Optional[str] = None, + friendly_name: Optional[str] = None, + management_endpoint_uri: Optional[str] = None, + monitoring_configuration: Optional[str] = None, + **kwargs + ): + super(RegisteredServerProperties, 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 + + +class ResourcesMoveInfo(msrest.serialization.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: Optional[str] = None, + resources: Optional[List[str]] = None, + **kwargs + ): + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resources = resources + + +class RestoreFileSpec(msrest.serialization.Model): + """Restore file spec. + + :param path: Restore file spec path. + :type path: str + :param isdir: Restore file spec isdir. + :type isdir: bool + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'isdir': {'key': 'isdir', 'type': 'bool'}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + isdir: Optional[bool] = None, + **kwargs + ): + super(RestoreFileSpec, self).__init__(**kwargs) + self.path = path + self.isdir = isdir + + +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 folder used for data synchronization. + :type server_local_path: str + :param cloud_tiering: Type of the Feature Status. Possible values include: 'on', 'off'. + :type cloud_tiering: str or ~microsoft_storage_sync.models.FeatureStatus + :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it + is enabled. + :type volume_free_space_percent: int + :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: Arm resource identifier. + :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: ~microsoft_storage_sync.models.ServerEndpointSyncStatus + :param offline_data_transfer: Type of the Feature Status. Possible values include: 'on', 'off'. + :type offline_data_transfer: str or ~microsoft_storage_sync.models.FeatureStatus + :ivar offline_data_transfer_storage_account_resource_id: Offline data transfer storage account + resource ID. + :vartype offline_data_transfer_storage_account_resource_id: str + :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 + :ivar cloud_tiering_status: Server endpoint cloud tiering status object. + :vartype cloud_tiering_status: ~microsoft_storage_sync.models.ServerEndpointCloudTieringStatus + :ivar recall_status: Server endpoint recall status object. + :vartype recall_status: ~microsoft_storage_sync.models.ServerEndpointRecallStatus + """ + + _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}, + 'cloud_tiering_status': {'readonly': True}, + 'recall_status': {'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'}, + 'cloud_tiering_status': {'key': 'properties.cloudTieringStatus', 'type': 'ServerEndpointCloudTieringStatus'}, + 'recall_status': {'key': 'properties.recallStatus', 'type': 'ServerEndpointRecallStatus'}, + } + + def __init__( + self, + *, + server_local_path: Optional[str] = None, + cloud_tiering: Optional[Union[str, "FeatureStatus"]] = None, + volume_free_space_percent: Optional[int] = None, + tier_files_older_than_days: Optional[int] = None, + friendly_name: Optional[str] = None, + server_resource_id: Optional[str] = None, + offline_data_transfer: Optional[Union[str, "FeatureStatus"]] = None, + offline_data_transfer_share_name: Optional[str] = None, + **kwargs + ): + 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 + self.cloud_tiering_status = None + self.recall_status = None + + +class ServerEndpointArray(msrest.serialization.Model): + """Array of ServerEndpoint. + + :param value: Collection of ServerEndpoint. + :type value: list[~microsoft_storage_sync.models.ServerEndpoint] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServerEndpoint]'}, + } + + def __init__( + self, + *, + value: Optional[List["ServerEndpoint"]] = None, + **kwargs + ): + super(ServerEndpointArray, self).__init__(**kwargs) + self.value = value + + +class ServerEndpointCloudTieringStatus(msrest.serialization.Model): + """Server endpoint cloud tiering status object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar health: Type of the cloud tiering health state. Possible values include: 'Healthy', + 'Error'. + :vartype health: str or ~microsoft_storage_sync.models.ServerEndpointCloudTieringHealthState + :ivar health_last_updated_timestamp: The last updated timestamp of health state. + :vartype health_last_updated_timestamp: ~datetime.datetime + :ivar last_cloud_tiering_result: Last cloud tiering result (HResult). + :vartype last_cloud_tiering_result: int + :ivar last_success_timestamp: Last cloud tiering success timestamp. + :vartype last_success_timestamp: ~datetime.datetime + :ivar space_savings: Server endpoint cloud tiering status object. + :vartype space_savings: ~microsoft_storage_sync.models.CloudTieringSpaceSavings + :ivar cache_performance: Server endpoint cloud tiering status object. + :vartype cache_performance: ~microsoft_storage_sync.models.CloudTieringCachePerformance + :ivar files_not_tiering: Server endpoint cloud tiering status object. + :vartype files_not_tiering: ~microsoft_storage_sync.models.CloudTieringFilesNotTiering + :ivar volume_free_space_policy_status: Status of the volume free space policy. + :vartype volume_free_space_policy_status: + ~microsoft_storage_sync.models.CloudTieringVolumeFreeSpacePolicyStatus + :ivar date_policy_status: Status of the date policy. + :vartype date_policy_status: ~microsoft_storage_sync.models.CloudTieringDatePolicyStatus + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'health': {'readonly': True}, + 'health_last_updated_timestamp': {'readonly': True}, + 'last_cloud_tiering_result': {'readonly': True}, + 'last_success_timestamp': {'readonly': True}, + 'space_savings': {'readonly': True}, + 'cache_performance': {'readonly': True}, + 'files_not_tiering': {'readonly': True}, + 'volume_free_space_policy_status': {'readonly': True}, + 'date_policy_status': {'readonly': True}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'health': {'key': 'health', 'type': 'str'}, + 'health_last_updated_timestamp': {'key': 'healthLastUpdatedTimestamp', 'type': 'iso-8601'}, + 'last_cloud_tiering_result': {'key': 'lastCloudTieringResult', 'type': 'int'}, + 'last_success_timestamp': {'key': 'lastSuccessTimestamp', 'type': 'iso-8601'}, + 'space_savings': {'key': 'spaceSavings', 'type': 'CloudTieringSpaceSavings'}, + 'cache_performance': {'key': 'cachePerformance', 'type': 'CloudTieringCachePerformance'}, + 'files_not_tiering': {'key': 'filesNotTiering', 'type': 'CloudTieringFilesNotTiering'}, + 'volume_free_space_policy_status': {'key': 'volumeFreeSpacePolicyStatus', 'type': 'CloudTieringVolumeFreeSpacePolicyStatus'}, + 'date_policy_status': {'key': 'datePolicyStatus', 'type': 'CloudTieringDatePolicyStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerEndpointCloudTieringStatus, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.health = None + self.health_last_updated_timestamp = None + self.last_cloud_tiering_result = None + self.last_success_timestamp = None + self.space_savings = None + self.cache_performance = None + self.files_not_tiering = None + self.volume_free_space_policy_status = None + self.date_policy_status = None + + +class ServerEndpointCreateParameters(ProxyResource): + """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 folder used for data synchronization. + :type server_local_path: str + :param cloud_tiering: Type of the Feature Status. Possible values include: 'on', 'off'. + :type cloud_tiering: str or ~microsoft_storage_sync.models.FeatureStatus + :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it + is enabled. + :type volume_free_space_percent: int + :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: Arm resource identifier. + :type server_resource_id: str + :param offline_data_transfer: Type of the Feature Status. Possible values include: 'on', 'off'. + :type offline_data_transfer: str or ~microsoft_storage_sync.models.FeatureStatus + :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: Optional[str] = None, + cloud_tiering: Optional[Union[str, "FeatureStatus"]] = None, + volume_free_space_percent: Optional[int] = None, + tier_files_older_than_days: Optional[int] = None, + friendly_name: Optional[str] = None, + server_resource_id: Optional[str] = None, + offline_data_transfer: Optional[Union[str, "FeatureStatus"]] = None, + offline_data_transfer_share_name: Optional[str] = None, + **kwargs + ): + 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 + + +class ServerEndpointCreateParametersProperties(msrest.serialization.Model): + """ServerEndpoint Properties object. + + :param server_local_path: Server folder used for data synchronization. + :type server_local_path: str + :param cloud_tiering: Type of the Feature Status. Possible values include: 'on', 'off'. + :type cloud_tiering: str or ~microsoft_storage_sync.models.FeatureStatus + :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it + is enabled. + :type volume_free_space_percent: int + :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: Arm resource identifier. + :type server_resource_id: str + :param offline_data_transfer: Type of the Feature Status. Possible values include: 'on', 'off'. + :type offline_data_transfer: str or ~microsoft_storage_sync.models.FeatureStatus + :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 = { + 'server_local_path': {'key': 'serverLocalPath', 'type': 'str'}, + 'cloud_tiering': {'key': 'cloudTiering', 'type': 'str'}, + 'volume_free_space_percent': {'key': 'volumeFreeSpacePercent', 'type': 'int'}, + 'tier_files_older_than_days': {'key': 'tierFilesOlderThanDays', 'type': 'int'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'server_resource_id': {'key': 'serverResourceId', 'type': 'str'}, + 'offline_data_transfer': {'key': 'offlineDataTransfer', 'type': 'str'}, + 'offline_data_transfer_share_name': {'key': 'offlineDataTransferShareName', 'type': 'str'}, + } + + def __init__( + self, + *, + server_local_path: Optional[str] = None, + cloud_tiering: Optional[Union[str, "FeatureStatus"]] = None, + volume_free_space_percent: Optional[int] = None, + tier_files_older_than_days: Optional[int] = None, + friendly_name: Optional[str] = None, + server_resource_id: Optional[str] = None, + offline_data_transfer: Optional[Union[str, "FeatureStatus"]] = None, + offline_data_transfer_share_name: Optional[str] = None, + **kwargs + ): + super(ServerEndpointCreateParametersProperties, 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 + + +class ServerEndpointFilesNotSyncingError(msrest.serialization.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, 'minimum': 0}, + 'transient_count': {'readonly': True, 'minimum': 0}, + } + + _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(ServerEndpointFilesNotSyncingError, self).__init__(**kwargs) + self.error_code = None + self.persistent_count = None + self.transient_count = None + + +class ServerEndpointProperties(msrest.serialization.Model): + """ServerEndpoint Properties object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param server_local_path: Server folder used for data synchronization. + :type server_local_path: str + :param cloud_tiering: Type of the Feature Status. Possible values include: 'on', 'off'. + :type cloud_tiering: str or ~microsoft_storage_sync.models.FeatureStatus + :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it + is enabled. + :type volume_free_space_percent: int + :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: Arm resource identifier. + :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: ~microsoft_storage_sync.models.ServerEndpointSyncStatus + :param offline_data_transfer: Type of the Feature Status. Possible values include: 'on', 'off'. + :type offline_data_transfer: str or ~microsoft_storage_sync.models.FeatureStatus + :ivar offline_data_transfer_storage_account_resource_id: Offline data transfer storage account + resource ID. + :vartype offline_data_transfer_storage_account_resource_id: str + :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 + :ivar cloud_tiering_status: Server endpoint cloud tiering status object. + :vartype cloud_tiering_status: ~microsoft_storage_sync.models.ServerEndpointCloudTieringStatus + :ivar recall_status: Server endpoint recall status object. + :vartype recall_status: ~microsoft_storage_sync.models.ServerEndpointRecallStatus + """ + + _validation = { + '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}, + 'cloud_tiering_status': {'readonly': True}, + 'recall_status': {'readonly': True}, + } + + _attribute_map = { + 'server_local_path': {'key': 'serverLocalPath', 'type': 'str'}, + 'cloud_tiering': {'key': 'cloudTiering', 'type': 'str'}, + 'volume_free_space_percent': {'key': 'volumeFreeSpacePercent', 'type': 'int'}, + 'tier_files_older_than_days': {'key': 'tierFilesOlderThanDays', 'type': 'int'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'server_resource_id': {'key': 'serverResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'last_workflow_id': {'key': 'lastWorkflowId', 'type': 'str'}, + 'last_operation_name': {'key': 'lastOperationName', 'type': 'str'}, + 'sync_status': {'key': 'syncStatus', 'type': 'ServerEndpointSyncStatus'}, + 'offline_data_transfer': {'key': 'offlineDataTransfer', 'type': 'str'}, + 'offline_data_transfer_storage_account_resource_id': {'key': 'offlineDataTransferStorageAccountResourceId', 'type': 'str'}, + 'offline_data_transfer_storage_account_tenant_id': {'key': 'offlineDataTransferStorageAccountTenantId', 'type': 'str'}, + 'offline_data_transfer_share_name': {'key': 'offlineDataTransferShareName', 'type': 'str'}, + 'cloud_tiering_status': {'key': 'cloudTieringStatus', 'type': 'ServerEndpointCloudTieringStatus'}, + 'recall_status': {'key': 'recallStatus', 'type': 'ServerEndpointRecallStatus'}, + } + + def __init__( + self, + *, + server_local_path: Optional[str] = None, + cloud_tiering: Optional[Union[str, "FeatureStatus"]] = None, + volume_free_space_percent: Optional[int] = None, + tier_files_older_than_days: Optional[int] = None, + friendly_name: Optional[str] = None, + server_resource_id: Optional[str] = None, + offline_data_transfer: Optional[Union[str, "FeatureStatus"]] = None, + offline_data_transfer_share_name: Optional[str] = None, + **kwargs + ): + super(ServerEndpointProperties, 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 + self.cloud_tiering_status = None + self.recall_status = None + + +class ServerEndpointRecallError(msrest.serialization.Model): + """Server endpoint recall 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 count: Count of occurences of the error. + :vartype count: long + """ + + _validation = { + 'error_code': {'readonly': True}, + 'count': {'readonly': True, 'minimum': 0}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerEndpointRecallError, self).__init__(**kwargs) + self.error_code = None + self.count = None + + +class ServerEndpointRecallStatus(msrest.serialization.Model): + """Server endpoint recall status object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar last_updated_timestamp: Last updated timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar total_recall_errors_count: Total count of recall errors. + :vartype total_recall_errors_count: long + :ivar recall_errors: Array of recall errors. + :vartype recall_errors: list[~microsoft_storage_sync.models.ServerEndpointRecallError] + """ + + _validation = { + 'last_updated_timestamp': {'readonly': True}, + 'total_recall_errors_count': {'readonly': True, 'minimum': 0}, + 'recall_errors': {'readonly': True}, + } + + _attribute_map = { + 'last_updated_timestamp': {'key': 'lastUpdatedTimestamp', 'type': 'iso-8601'}, + 'total_recall_errors_count': {'key': 'totalRecallErrorsCount', 'type': 'long'}, + 'recall_errors': {'key': 'recallErrors', 'type': '[ServerEndpointRecallError]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerEndpointRecallStatus, self).__init__(**kwargs) + self.last_updated_timestamp = None + self.total_recall_errors_count = None + self.recall_errors = None + + +class ServerEndpointSyncActivityStatus(msrest.serialization.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.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, 'minimum': 0}, + 'applied_item_count': {'readonly': True, 'minimum': 0}, + 'total_item_count': {'readonly': True, 'minimum': 0}, + 'applied_bytes': {'readonly': True, 'minimum': 0}, + 'total_bytes': {'readonly': True, 'minimum': 0}, + } + + _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(ServerEndpointSyncActivityStatus, 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 + + +class ServerEndpointSyncSessionStatus(msrest.serialization.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.datetime + :ivar last_sync_success_timestamp: Last sync success timestamp. + :vartype last_sync_success_timestamp: ~datetime.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. + :vartype persistent_files_not_syncing_count: long + :ivar transient_files_not_syncing_count: Count of transient files not syncing. + :vartype transient_files_not_syncing_count: long + :ivar files_not_syncing_errors: Array of per-item errors coming from the last sync session. + :vartype files_not_syncing_errors: + list[~microsoft_storage_sync.models.ServerEndpointFilesNotSyncingError] + """ + + _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, 'minimum': 0}, + 'persistent_files_not_syncing_count': {'readonly': True, 'minimum': 0}, + 'transient_files_not_syncing_count': {'readonly': True, 'minimum': 0}, + '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': '[ServerEndpointFilesNotSyncingError]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerEndpointSyncSessionStatus, 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 + + +class ServerEndpointSyncStatus(msrest.serialization.Model): + """Server Endpoint sync status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar download_health: Type of the sync health state. Possible values include: 'Healthy', + 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity'. + :vartype download_health: str or ~microsoft_storage_sync.models.ServerEndpointSyncHealthState + :ivar upload_health: Type of the sync health state. Possible values include: 'Healthy', + 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity'. + :vartype upload_health: str or ~microsoft_storage_sync.models.ServerEndpointSyncHealthState + :ivar combined_health: Type of the sync health state. Possible values include: 'Healthy', + 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity'. + :vartype combined_health: str or ~microsoft_storage_sync.models.ServerEndpointSyncHealthState + :ivar sync_activity: Type of the sync activity state. Possible values include: 'Upload', + 'Download', 'UploadAndDownload'. + :vartype sync_activity: str or ~microsoft_storage_sync.models.ServerEndpointSyncActivityState + :ivar total_persistent_files_not_syncing_count: Total count of persistent files not syncing + (combined upload + download). + :vartype total_persistent_files_not_syncing_count: long + :ivar last_updated_timestamp: Last Updated Timestamp. + :vartype last_updated_timestamp: ~datetime.datetime + :ivar upload_status: Sync Session status object. + :vartype upload_status: ~microsoft_storage_sync.models.ServerEndpointSyncSessionStatus + :ivar download_status: Sync Session status object. + :vartype download_status: ~microsoft_storage_sync.models.ServerEndpointSyncSessionStatus + :ivar upload_activity: Sync Session status object. + :vartype upload_activity: ~microsoft_storage_sync.models.ServerEndpointSyncActivityStatus + :ivar download_activity: Sync Session status object. + :vartype download_activity: ~microsoft_storage_sync.models.ServerEndpointSyncActivityStatus + :ivar offline_data_transfer_status: Type of the Health state. Possible values include: + 'InProgress', 'Stopping', 'NotRunning', 'Complete'. + :vartype offline_data_transfer_status: str or + ~microsoft_storage_sync.models.ServerEndpointOfflineDataTransferState + """ + + _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, 'minimum': 0}, + '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': 'ServerEndpointSyncSessionStatus'}, + 'download_status': {'key': 'downloadStatus', 'type': 'ServerEndpointSyncSessionStatus'}, + 'upload_activity': {'key': 'uploadActivity', 'type': 'ServerEndpointSyncActivityStatus'}, + 'download_activity': {'key': 'downloadActivity', 'type': 'ServerEndpointSyncActivityStatus'}, + '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 + + +class ServerEndpointUpdateParameters(msrest.serialization.Model): + """Parameters for updating an Server Endpoint. + + :param cloud_tiering: Type of the Feature Status. Possible values include: 'on', 'off'. + :type cloud_tiering: str or ~microsoft_storage_sync.models.FeatureStatus + :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it + is enabled. + :type volume_free_space_percent: int + :param tier_files_older_than_days: Tier files older than days. + :type tier_files_older_than_days: int + :param offline_data_transfer: Type of the Feature Status. Possible values include: 'on', 'off'. + :type offline_data_transfer: str or ~microsoft_storage_sync.models.FeatureStatus + :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: Optional[Union[str, "FeatureStatus"]] = None, + volume_free_space_percent: Optional[int] = None, + tier_files_older_than_days: Optional[int] = None, + offline_data_transfer: Optional[Union[str, "FeatureStatus"]] = None, + offline_data_transfer_share_name: Optional[str] = None, + **kwargs + ): + 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 + + +class ServerEndpointUpdateProperties(msrest.serialization.Model): + """ServerEndpoint Update Properties object. + + :param cloud_tiering: Type of the Feature Status. Possible values include: 'on', 'off'. + :type cloud_tiering: str or ~microsoft_storage_sync.models.FeatureStatus + :param volume_free_space_percent: Level of free space to be maintained by Cloud Tiering if it + is enabled. + :type volume_free_space_percent: int + :param tier_files_older_than_days: Tier files older than days. + :type tier_files_older_than_days: int + :param offline_data_transfer: Type of the Feature Status. Possible values include: 'on', 'off'. + :type offline_data_transfer: str or ~microsoft_storage_sync.models.FeatureStatus + :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': 'cloudTiering', 'type': 'str'}, + 'volume_free_space_percent': {'key': 'volumeFreeSpacePercent', 'type': 'int'}, + 'tier_files_older_than_days': {'key': 'tierFilesOlderThanDays', 'type': 'int'}, + 'offline_data_transfer': {'key': 'offlineDataTransfer', 'type': 'str'}, + 'offline_data_transfer_share_name': {'key': 'offlineDataTransferShareName', 'type': 'str'}, + } + + def __init__( + self, + *, + cloud_tiering: Optional[Union[str, "FeatureStatus"]] = None, + volume_free_space_percent: Optional[int] = None, + tier_files_older_than_days: Optional[int] = None, + offline_data_transfer: Optional[Union[str, "FeatureStatus"]] = None, + offline_data_transfer_share_name: Optional[str] = None, + **kwargs + ): + super(ServerEndpointUpdateProperties, 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 + + +class StorageSyncApiError(msrest.serialization.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 object. + :type details: ~microsoft_storage_sync.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: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional["StorageSyncErrorDetails"] = None, + **kwargs + ): + super(StorageSyncApiError, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class StorageSyncErrorException(HttpResponseError): + """Server responded with exception of type: 'StorageSyncError'. + + :param response: Server response to be deserialized. + :param error_model: A deserialized model of the response body as model. + """ + + def __init__(self, response, error_model): + self.error = error_model + super(StorageSyncErrorException, self).__init__(response=response, error_model=error_model) + + @classmethod + def from_response(cls, response, deserialize): + """Deserialize this response as this exception, or a subclass of this exception. + + :param response: Server response to be deserialized. + :param deserialize: A deserializer + """ + model_name = 'StorageSyncError' + error = deserialize(model_name, response) + if error is None: + error = deserialize.dependencies[model_name]() + return error._EXCEPTION_TYPE(response, error) + + +class StorageSyncError(msrest.serialization.Model): + """Error type. + + :param error: Error type. + :type error: ~microsoft_storage_sync.models.StorageSyncApiError + :param innererror: Error type. + :type innererror: ~microsoft_storage_sync.models.StorageSyncApiError + """ + _EXCEPTION_TYPE = StorageSyncErrorException + + _attribute_map = { + 'error': {'key': 'error', 'type': 'StorageSyncApiError'}, + 'innererror': {'key': 'innererror', 'type': 'StorageSyncApiError'}, + } + + def __init__( + self, + *, + error: Optional["StorageSyncApiError"] = None, + innererror: Optional["StorageSyncApiError"] = None, + **kwargs + ): + super(StorageSyncError, self).__init__(**kwargs) + self.error = error + self.innererror = innererror + + +class StorageSyncErrorDetails(msrest.serialization.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: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + **kwargs + ): + super(StorageSyncErrorDetails, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + + +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: A set of 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: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +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: A set of 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: Optional[Dict[str, str]] = None, + **kwargs + ): + super(StorageSyncService, self).__init__(tags=tags, location=location, **kwargs) + self.storage_sync_service_status = None + self.storage_sync_service_uid = None + + +class StorageSyncServiceArray(msrest.serialization.Model): + """Array of StorageSyncServices. + + :param value: Collection of StorageSyncServices. + :type value: list[~microsoft_storage_sync.models.StorageSyncService] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageSyncService]'}, + } + + def __init__( + self, + *, + value: Optional[List["StorageSyncService"]] = None, + **kwargs + ): + super(StorageSyncServiceArray, self).__init__(**kwargs) + self.value = value + + +class StorageSyncServiceCreateParameters(msrest.serialization.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: A set of 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: Any object. + :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: Optional[Dict[str, str]] = None, + properties: Optional[object] = None, + **kwargs + ): + super(StorageSyncServiceCreateParameters, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.properties = properties + + +class StorageSyncServiceProperties(msrest.serialization.Model): + """Storage Sync Service Properties object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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 = { + 'storage_sync_service_status': {'readonly': True}, + 'storage_sync_service_uid': {'readonly': True}, + } + + _attribute_map = { + 'storage_sync_service_status': {'key': 'storageSyncServiceStatus', 'type': 'int'}, + 'storage_sync_service_uid': {'key': 'storageSyncServiceUid', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageSyncServiceProperties, self).__init__(**kwargs) + self.storage_sync_service_status = None + self.storage_sync_service_uid = None + + +class StorageSyncServiceUpdateParameters(msrest.serialization.Model): + """Parameters for updating an Storage sync service. + + :param tags: A set of tags. The user-specified tags associated with the storage sync service. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(StorageSyncServiceUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class StorageSyncServiceUpdateProperties(msrest.serialization.Model): + """Storage Sync Service Update Properties object. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(StorageSyncServiceUpdateProperties, self).__init__(**kwargs) + + +class SubscriptionState(msrest.serialization.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 ~microsoft_storage_sync.models.Reason + :ivar istransitioning: Is Transitioning. + :vartype istransitioning: bool + """ + + _validation = { + 'istransitioning': {'readonly': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'istransitioning': {'key': 'istransitioning', 'type': 'bool'}, + } + + def __init__( + self, + *, + state: Optional[Union[str, "Reason"]] = None, + **kwargs + ): + super(SubscriptionState, self).__init__(**kwargs) + self.state = state + self.istransitioning = None + + +class SubscriptionStateProperties(msrest.serialization.Model): + """Subscription State properties. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionStateProperties, self).__init__(**kwargs) + + +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 + :ivar unique_id: Unique Id. + :vartype 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}, + 'unique_id': {'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 = None + self.sync_group_status = None + + +class SyncGroupArray(msrest.serialization.Model): + """Array of SyncGroup. + + :param value: Collection of SyncGroup. + :type value: list[~microsoft_storage_sync.models.SyncGroup] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SyncGroup]'}, + } + + def __init__( + self, + *, + value: Optional[List["SyncGroup"]] = None, + **kwargs + ): + super(SyncGroupArray, self).__init__(**kwargs) + self.value = value + + +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 + """ + + _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(SyncGroupCreateParameters, self).__init__(**kwargs) + + +class SyncGroupCreateParametersProperties(msrest.serialization.Model): + """Sync Group Create Properties object. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(SyncGroupCreateParametersProperties, self).__init__(**kwargs) + + +class SyncGroupProperties(msrest.serialization.Model): + """SyncGroup Properties object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unique_id: Unique Id. + :vartype unique_id: str + :ivar sync_group_status: Sync group status. + :vartype sync_group_status: str + """ + + _validation = { + 'unique_id': {'readonly': True}, + 'sync_group_status': {'readonly': True}, + } + + _attribute_map = { + 'unique_id': {'key': 'uniqueId', 'type': 'str'}, + 'sync_group_status': {'key': 'syncGroupStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SyncGroupProperties, self).__init__(**kwargs) + self.unique_id = None + self.sync_group_status = None + + +class TriggerChangeDetectionParameters(msrest.serialization.Model): + """The parameters used when calling trigger change detection action on cloud endpoint. + + :param directory_path: Relative path to a directory Azure File share for which change detection + is to be performed. + :type directory_path: str + :param change_detection_mode: Change Detection Mode. Applies to a directory specified in + directoryPath parameter. Possible values include: 'Default', 'Recursive'. + :type change_detection_mode: str or ~microsoft_storage_sync.models.ChangeDetectionMode + :param paths: Array of relative paths on the Azure File share to be included in the change + detection. Can be files and directories. + :type paths: list[str] + """ + + _attribute_map = { + 'directory_path': {'key': 'directoryPath', 'type': 'str'}, + 'change_detection_mode': {'key': 'changeDetectionMode', 'type': 'str'}, + 'paths': {'key': 'paths', 'type': '[str]'}, + } + + def __init__( + self, + *, + directory_path: Optional[str] = None, + change_detection_mode: Optional[Union[str, "ChangeDetectionMode"]] = None, + paths: Optional[List[str]] = None, + **kwargs + ): + super(TriggerChangeDetectionParameters, self).__init__(**kwargs) + self.directory_path = directory_path + self.change_detection_mode = change_detection_mode + self.paths = paths + + +class TriggerRolloverRequest(msrest.serialization.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: Optional[str] = None, + **kwargs + ): + super(TriggerRolloverRequest, self).__init__(**kwargs) + self.server_certificate = server_certificate + + +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: Type of the Workflow Status. Possible values include: 'active', 'expired', + 'succeeded', 'aborted', 'failed'. + :type status: str or ~microsoft_storage_sync.models.WorkflowStatus + :param operation: Type of the Operation Direction. Possible values include: 'do', 'undo', + 'cancel'. + :type operation: str or ~microsoft_storage_sync.models.OperationDirection + :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: Optional[str] = None, + status: Optional[Union[str, "WorkflowStatus"]] = None, + operation: Optional[Union[str, "OperationDirection"]] = None, + steps: Optional[str] = None, + last_operation_id: Optional[str] = None, + **kwargs + ): + 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 + + +class WorkflowArray(msrest.serialization.Model): + """Array of Workflow. + + :param value: Collection of workflow items. + :type value: list[~microsoft_storage_sync.models.Workflow] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Workflow]'}, + } + + def __init__( + self, + *, + value: Optional[List["Workflow"]] = None, + **kwargs + ): + super(WorkflowArray, self).__init__(**kwargs) + self.value = value + + +class WorkflowProperties(msrest.serialization.Model): + """Workflow Properties object. + + :param last_step_name: last step name. + :type last_step_name: str + :param status: Type of the Workflow Status. Possible values include: 'active', 'expired', + 'succeeded', 'aborted', 'failed'. + :type status: str or ~microsoft_storage_sync.models.WorkflowStatus + :param operation: Type of the Operation Direction. Possible values include: 'do', 'undo', + 'cancel'. + :type operation: str or ~microsoft_storage_sync.models.OperationDirection + :param steps: workflow steps. + :type steps: str + :param last_operation_id: workflow last operation identifier. + :type last_operation_id: str + """ + + _attribute_map = { + 'last_step_name': {'key': 'lastStepName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'steps': {'key': 'steps', 'type': 'str'}, + 'last_operation_id': {'key': 'lastOperationId', 'type': 'str'}, + } + + def __init__( + self, + *, + last_step_name: Optional[str] = None, + status: Optional[Union[str, "WorkflowStatus"]] = None, + operation: Optional[Union[str, "OperationDirection"]] = None, + steps: Optional[str] = None, + last_operation_id: Optional[str] = None, + **kwargs + ): + super(WorkflowProperties, 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/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/__init__.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/__init__.py new file mode 100644 index 00000000000..e4b42aac8b4 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/__init__.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 ._operation_operations import OperationOperations +from ._storage_sync_service_operations import StorageSyncServiceOperations +from ._sync_group_operations import SyncGroupOperations +from ._cloud_endpoint_operations import CloudEndpointOperations +from ._server_endpoint_operations import ServerEndpointOperations +from ._registered_server_operations import RegisteredServerOperations +from ._workflow_operations import WorkflowOperations +from ._operation_status_operations import OperationStatusOperations + +__all__ = [ + 'OperationOperations', + 'StorageSyncServiceOperations', + 'SyncGroupOperations', + 'CloudEndpointOperations', + 'ServerEndpointOperations', + 'RegisteredServerOperations', + 'WorkflowOperations', + 'OperationStatusOperations', +] diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_cloud_endpoint_operations.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_cloud_endpoint_operations.py new file mode 100644 index 00000000000..6b07ccc1f49 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_cloud_endpoint_operations.py @@ -0,0 +1,1075 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CloudEndpointOperations(object): + """CloudEndpointOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_initial( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + parameters, # type: "models.CloudEndpointCreateParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.CloudEndpoint" + cls = kwargs.pop('cls', None ) # type: ClsType["models.CloudEndpoint"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._create_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'CloudEndpointCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('CloudEndpoint', pipeline_response) + + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Retry-After']=self._deserialize('str', response.headers.get('Retry-After')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} + + def begin_create( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + parameters, # type: "models.CloudEndpointCreateParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.CloudEndpoint" + """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: ~microsoft_storage_sync.models.CloudEndpointCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns CloudEndpoint + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.CloudEndpoint] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType["models.CloudEndpoint"] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('CloudEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} + + def get( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.CloudEndpoint" + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CloudEndpoint or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.CloudEndpoint + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.CloudEndpoint"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('CloudEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + 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, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._delete_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Retry-After']=self._deserialize('str', response.headers.get('Retry-After')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} + + def begin_delete( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType[None] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.CloudEndpointArray" + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CloudEndpointArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.CloudEndpointArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.CloudEndpointArray"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + 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='^[-\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) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CloudEndpointArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + 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, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + parameters, # type: "models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._pre_backup_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'BackupRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _pre_backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup'} + + def begin_pre_backup( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + parameters, # type: "models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> None + """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 parameters: Body of Backup request. + :type parameters: ~microsoft_storage_sync.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType[None] + 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, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + parameters, # type: "models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "models.PostBackupResponse" + cls = kwargs.pop('cls', None ) # type: ClsType["models.PostBackupResponse"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._post_backup_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'BackupRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('PostBackupResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _post_backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup'} + + def begin_post_backup( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + parameters, # type: "models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "models.PostBackupResponse" + """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 parameters: Body of Backup request. + :type parameters: ~microsoft_storage_sync.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns PostBackupResponse + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.PostBackupResponse] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType["models.PostBackupResponse"] + 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, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('PostBackupResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + parameters, # type: "models.PreRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._pre_restore_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'PreRestoreRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _pre_restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore'} + + def begin_pre_restore( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + parameters, # type: "models.PreRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + """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: ~microsoft_storage_sync.models.PreRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType[None] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_pre_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore'} + + def restoreheartbeat( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + 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, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + parameters, # type: "models.PostRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._post_restore_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'PostRestoreRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _post_restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore'} + + def begin_post_restore( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + parameters, # type: "models.PostRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + """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: ~microsoft_storage_sync.models.PostRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType[None] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore'} + + def _trigger_change_detection_initial( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + parameters, # type: "models.TriggerChangeDetectionParameters" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._trigger_change_detection_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'TriggerChangeDetectionParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _trigger_change_detection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/triggerChangeDetection'} + + def begin_trigger_change_detection( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + cloud_endpoint_name, # type: str + parameters, # type: "models.TriggerChangeDetectionParameters" + **kwargs # type: Any + ): + # type: (...) -> None + """Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud 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 cloud_endpoint_name: Name of Cloud Endpoint object. + :type cloud_endpoint_name: str + :param parameters: Trigger Change Detection Action parameters. + :type parameters: ~microsoft_storage_sync.models.TriggerChangeDetectionParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType[None] + raw_result = self._trigger_change_detection_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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_trigger_change_detection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/triggerChangeDetection'} diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_operation_operations.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_operation_operations.py new file mode 100644 index 00000000000..9b4cb50f266 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_operation_operations.py @@ -0,0 +1,99 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations(object): + """OperationOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.OperationEntityListResult" + """Lists all of the available Storage Sync Rest API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationEntityListResult or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.OperationEntityListResult + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.OperationEntityListResult"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationEntityListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.StorageSync/operations'} diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_operation_status_operations.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_operation_status_operations.py new file mode 100644 index 00000000000..6cfdd0fe431 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_operation_status_operations.py @@ -0,0 +1,106 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationStatusOperations(object): + """OperationStatusOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + location_name, # type: str + workflow_id, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OperationStatus" + """Get Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param location_name: The desired region for the name check. + :type location_name: str + :param workflow_id: workflow Id. + :type workflow_id: str + :param operation_id: operation Id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.OperationStatus + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.OperationStatus"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\w\._\(\)]+$'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'workflowId': self._serialize.url("workflow_id", workflow_id, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/locations/{locationName}/workflows/{workflowId}/operations/{operationId}'} diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_registered_server_operations.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_registered_server_operations.py new file mode 100644 index 00000000000..6b3b9ecfb02 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_registered_server_operations.py @@ -0,0 +1,512 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RegisteredServerOperations(object): + """RegisteredServerOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_storage_sync_service( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.RegisteredServerArray" + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegisteredServerArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.RegisteredServerArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.RegisteredServerArray"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_storage_sync_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\w\._\(\)]+$'), + 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RegisteredServerArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers'} + + def get( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + server_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.RegisteredServer" + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegisteredServer or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.RegisteredServer + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.RegisteredServer"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('RegisteredServer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + + def _create_initial( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + server_id, # type: str + parameters, # type: "models.RegisteredServerCreateParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.RegisteredServer" + cls = kwargs.pop('cls', None ) # type: ClsType["models.RegisteredServer"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._create_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'RegisteredServerCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('RegisteredServer', pipeline_response) + + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + + def begin_create( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + server_id, # type: str + parameters, # type: "models.RegisteredServerCreateParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.RegisteredServer" + """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: ~microsoft_storage_sync.models.RegisteredServerCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns RegisteredServer + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.RegisteredServer] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType["models.RegisteredServer"] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('RegisteredServer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + + def _delete_initial( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + server_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._delete_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + + def begin_delete( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + server_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType[None] + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + server_id=server_id, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + + def _trigger_rollover_initial( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + server_id, # type: str + parameters, # type: "models.TriggerRolloverRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._trigger_rollover_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'TriggerRolloverRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _trigger_rollover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover'} + + def begin_trigger_rollover( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + server_id, # type: str + parameters, # type: "models.TriggerRolloverRequest" + **kwargs # type: Any + ): + # type: (...) -> None + """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: GUID identifying the on-premises server. + :type server_id: str + :param parameters: Body of Trigger Rollover request. + :type parameters: ~microsoft_storage_sync.models.TriggerRolloverRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType[None] + raw_result = self._trigger_rollover_initial( + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + server_id=server_id, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_trigger_rollover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover'} diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_server_endpoint_operations.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_server_endpoint_operations.py new file mode 100644 index 00000000000..7f04e7b689d --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_server_endpoint_operations.py @@ -0,0 +1,670 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ServerEndpointOperations(object): + """ServerEndpointOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_initial( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + server_endpoint_name, # type: str + parameters, # type: "models.ServerEndpointCreateParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.ServerEndpoint" + cls = kwargs.pop('cls', None ) # type: ClsType["models.ServerEndpoint"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._create_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'ServerEndpointCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('ServerEndpoint', pipeline_response) + + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + + def begin_create( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + server_endpoint_name, # type: str + parameters, # type: "models.ServerEndpointCreateParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.ServerEndpoint" + """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: ~microsoft_storage_sync.models.ServerEndpointCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns ServerEndpoint + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.ServerEndpoint] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType["models.ServerEndpoint"] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('ServerEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + + def _update_initial( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + server_endpoint_name, # type: str + parameters=None, # type: Optional["models.ServerEndpointUpdateParameters"] + **kwargs # type: Any + ): + # type: (...) -> "models.ServerEndpoint" + cls = kwargs.pop('cls', None ) # type: ClsType["models.ServerEndpoint"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._update_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # 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) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('ServerEndpoint', pipeline_response) + + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + + def begin_update( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + server_endpoint_name, # type: str + parameters=None, # type: Optional["models.ServerEndpointUpdateParameters"] + **kwargs # type: Any + ): + # type: (...) -> "models.ServerEndpoint" + """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: ~microsoft_storage_sync.models.ServerEndpointUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns ServerEndpoint + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.ServerEndpoint] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType["models.ServerEndpoint"] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('ServerEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + + def get( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + server_endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ServerEndpoint" + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServerEndpoint or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.ServerEndpoint + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.ServerEndpoint"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('ServerEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + 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, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + server_endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._delete_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + + def begin_delete( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + server_endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType[None] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_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, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ServerEndpointArray" + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServerEndpointArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.ServerEndpointArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.ServerEndpointArray"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + 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='^[-\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) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ServerEndpointArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + 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, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + server_endpoint_name, # type: str + parameters, # type: "models.RecallActionParameters" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # Construct URL + url = self._recall_action_initial.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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'RecallActionParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _recall_action_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction'} + + def begin_recall_action( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + server_endpoint_name, # type: str + parameters, # type: "models.RecallActionParameters" + **kwargs # type: Any + ): + # type: (...) -> None + """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 parameters: Body of Recall Action object. + :type parameters: ~microsoft_storage_sync.models.RecallActionParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None ) # type: ClsType[None] + 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, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_recall_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction'} diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_storage_sync_service_operations.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_storage_sync_service_operations.py new file mode 100644 index 00000000000..f411fb22e92 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_storage_sync_service_operations.py @@ -0,0 +1,477 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class StorageSyncServiceOperations(object): + """StorageSyncServiceOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def check_name_availability( + self, + location_name, # type: str + parameters, # type: "models.CheckNameAvailabilityParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.CheckNameAvailabilityResult" + """Check the give namespace name availability. + + :param location_name: The desired region for the name check. + :type location_name: str + :param parameters: Parameters to check availability of the given namespace name. + :type parameters: ~microsoft_storage_sync.models.CheckNameAvailabilityParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.CheckNameAvailabilityResult + :raises: ~azure.core.HttpResponseError + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.CheckNameAvailabilityResult"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/checkNameAvailability'} + + def create( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + parameters, # type: "models.StorageSyncServiceCreateParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.StorageSyncService" + """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: ~microsoft_storage_sync.models.StorageSyncServiceCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageSyncService or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncService + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.StorageSyncService"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'StorageSyncServiceCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + deserialized = self._deserialize('StorageSyncService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + + def get( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.StorageSyncService" + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageSyncService or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncService + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.StorageSyncService"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('StorageSyncService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + + def update( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + parameters=None, # type: Optional["models.StorageSyncServiceUpdateParameters"] + **kwargs # type: Any + ): + # type: (...) -> "models.StorageSyncService" + """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 parameters: Storage Sync Service resource. + :type parameters: ~microsoft_storage_sync.models.StorageSyncServiceUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageSyncService or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncService + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.StorageSyncService"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # 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) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('StorageSyncService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + + def delete( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.StorageSyncServiceArray" + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageSyncServiceArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncServiceArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.StorageSyncServiceArray"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + 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='^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StorageSyncServiceArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices'} + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.StorageSyncServiceArray" + """Get a StorageSyncService list by subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageSyncServiceArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncServiceArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.StorageSyncServiceArray"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + 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) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StorageSyncServiceArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/storageSyncServices'} diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_sync_group_operations.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_sync_group_operations.py new file mode 100644 index 00000000000..e1619f3cb16 --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_sync_group_operations.py @@ -0,0 +1,305 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SyncGroupOperations(object): + """SyncGroupOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_storage_sync_service( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.SyncGroupArray" + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SyncGroupArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.SyncGroupArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.SyncGroupArray"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_storage_sync_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\w\._\(\)]+$'), + 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SyncGroupArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups'} + + def create( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + parameters, # type: "models.SyncGroupCreateParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.SyncGroup" + """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 parameters: Sync Group Body. + :type parameters: ~microsoft_storage_sync.models.SyncGroupCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SyncGroup or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.SyncGroup + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.SyncGroup"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'SyncGroupCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('SyncGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} + + def get( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.SyncGroup" + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SyncGroup or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.SyncGroup + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.SyncGroup"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('SyncGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} + + def delete( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + sync_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_workflow_operations.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_workflow_operations.py new file mode 100644 index 00000000000..dacd3754eee --- /dev/null +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_workflow_operations.py @@ -0,0 +1,234 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowOperations(object): + """WorkflowOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~microsoft_storage_sync.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_storage_sync_service( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowArray" + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowArray or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.WorkflowArray + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.WorkflowArray"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_storage_sync_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\w\._\(\)]+$'), + 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowArray', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows'} + + def get( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + workflow_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Workflow" + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workflow or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.Workflow + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.Workflow"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + deserialized = self._deserialize('Workflow', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}'} + + def abort( + self, + resource_group_name, # type: str + storage_sync_service_name, # type: str + workflow_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~microsoft_storage_sync.models.StorageSyncErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-10-01" + + # 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='^[-\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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageSyncErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + response_headers['x-ms-correlation-request-id']=self._deserialize('str', response.headers.get('x-ms-correlation-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + abort.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}/abort'} diff --git a/src/storagesync/report.md b/src/storagesync/report.md new file mode 100644 index 00000000000..1183278bff1 --- /dev/null +++ b/src/storagesync/report.md @@ -0,0 +1,254 @@ +# Azure CLI Module Creation Report + +### storagesync cloud-endpoint create + +create a storagesync cloud-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--parameters**|object|Body of Cloud Endpoint resource.|/something/my_option|/something/myOption| +### storagesync cloud-endpoint delete + +delete a storagesync cloud-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync cloud-endpoint list + +list a storagesync cloud-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync cloud-endpoint post-backup + +post-backup a storagesync cloud-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--parameters**|object|Body of Backup request.|/something/my_option|/something/myOption| +### storagesync cloud-endpoint post-restore + +post-restore a storagesync cloud-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--parameters**|object|Body of Cloud Endpoint object.|/something/my_option|/something/myOption| +### storagesync cloud-endpoint pre-backup + +pre-backup a storagesync cloud-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--parameters**|object|Body of Backup request.|/something/my_option|/something/myOption| +### storagesync cloud-endpoint pre-restore + +pre-restore a storagesync cloud-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--parameters**|object|Body of Cloud Endpoint object.|/something/my_option|/something/myOption| +### storagesync cloud-endpoint restoreheartbeat + +restoreheartbeat a storagesync cloud-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync cloud-endpoint show + +show a storagesync cloud-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync cloud-endpoint trigger-change-detection + +trigger-change-detection a storagesync cloud-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--parameters**|object|Trigger Change Detection Action parameters.|/something/my_option|/something/myOption| +### storagesync operation-status show + +show a storagesync operation-status. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync registered-server create + +create a storagesync registered-server. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--parameters**|object|Body of Registered Server object.|/something/my_option|/something/myOption| +### storagesync registered-server delete + +delete a storagesync registered-server. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync registered-server list + +list a storagesync registered-server. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync registered-server show + +show a storagesync registered-server. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync registered-server trigger-rollover + +trigger-rollover a storagesync registered-server. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--parameters**|object|Body of Trigger Rollover request.|/something/my_option|/something/myOption| +### storagesync server-endpoint create + +create a storagesync server-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--parameters**|object|Body of Server Endpoint object.|/something/my_option|/something/myOption| +### storagesync server-endpoint delete + +delete a storagesync server-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync server-endpoint list + +list a storagesync server-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync server-endpoint recall-action + +recall-action a storagesync server-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--parameters**|object|Body of Recall Action object.|/something/my_option|/something/myOption| +### storagesync server-endpoint show + +show a storagesync server-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync server-endpoint update + +update a storagesync server-endpoint. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|--parameters**|object|Any of the properties applicable in PUT request.|/something/my_option|/something/myOption| +### storagesync storage-sync-service create + +create a storagesync storage-sync-service. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--parameters**|object|Storage Sync Service resource name.|/something/my_option|/something/myOption| +### storagesync storage-sync-service delete + +delete a storagesync storage-sync-service. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync storage-sync-service list + +list a storagesync storage-sync-service. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync storage-sync-service show + +show a storagesync storage-sync-service. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync storage-sync-service update + +update a storagesync storage-sync-service. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|--parameters**|object|Storage Sync Service resource.|/something/my_option|/something/myOption| +### storagesync sync-group create + +create a storagesync sync-group. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--parameters**|object|Sync Group Body|/something/my_option|/something/myOption| +### storagesync sync-group delete + +delete a storagesync sync-group. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync sync-group list + +list a storagesync sync-group. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync sync-group show + +show a storagesync sync-group. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync workflow abort + +abort a storagesync workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync workflow list + +list a storagesync workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### storagesync workflow show + +show a storagesync workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| \ No newline at end of file diff --git a/src/storagesync/setup.cfg b/src/storagesync/setup.cfg new file mode 100644 index 00000000000..5eab412034f --- /dev/null +++ b/src/storagesync/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/src/storagesync/setup.py b/src/storagesync/setup.py new file mode 100644 index 00000000000..6cb18b9dca1 --- /dev/null +++ b/src/storagesync/setup.py @@ -0,0 +1,60 @@ +#!/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. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages +try: + from azure_bdist_wheel import cmdclass +except ImportError: + from distutils import log as logger + logger.warn("Wheel is not available, disabling bdist_wheel hook") + +# TODO: Confirm this is the right version number you want and it matches your +# HISTORY.rst entry. +VERSION = '0.1.0' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +# TODO: Add any additional SDK dependencies here +DEPENDENCIES = [] + +with open('README.rst', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='storagesync', + version=VERSION, + description='Microsoft Azure Command-Line Tools MicrosoftStorageSync Extension', + # TODO: Update author and email, if applicable + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + # TODO: consider pointing directly to your source code instead of the generic repo + url='https://github.com/Azure/azure-cli-extensions', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_storagesync': ['azext_metadata.json']}, +)