diff --git a/src/storagesync/azext_storagesync/__init__.py b/src/storagesync/azext_storagesync/__init__.py index f219408f6b2..3363d4f11e9 100644 --- a/src/storagesync/azext_storagesync/__init__.py +++ b/src/storagesync/azext_storagesync/__init__.py @@ -20,8 +20,8 @@ def __init__(self, cli_ctx=None): 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) + parent = super(MicrosoftStorageSyncCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=storagesync_custom) def load_command_table(self, args): from azext_storagesync.generated.commands import load_command_table diff --git a/src/storagesync/azext_storagesync/generated/_help.py b/src/storagesync/azext_storagesync/generated/_help.py index 31a409b7b23..656a7fcde15 100644 --- a/src/storagesync/azext_storagesync/generated/_help.py +++ b/src/storagesync/azext_storagesync/generated/_help.py @@ -32,8 +32,8 @@ examples: - name: StorageSyncServices_Get text: |- - az storagesync storage-sync-service show --resource-group "SampleResourceGroup_1" --storage-sync-service\ --name "SampleStorageSyncService_1" + az storagesync storage-sync-service show --resource-group "SampleResourceGroup_1" --name "SampleStorageS\ +yncService_1" """ helps['storagesync storage-sync-service create'] = """ @@ -43,7 +43,7 @@ - name: StorageSyncServices_Create text: |- az storagesync storage-sync-service create --location "WestUS" --incoming-traffic-policy "AllowAllTraffi\ -c" --resource-group "SampleResourceGroup_1" --storage-sync-service-name "SampleStorageSyncService_1" +c" --resource-group "SampleResourceGroup_1" --name "SampleStorageSyncService_1" """ helps['storagesync storage-sync-service update'] = """ @@ -53,7 +53,7 @@ - name: StorageSyncServices_Update text: |- az storagesync storage-sync-service update --incoming-traffic-policy "AllowAllTraffic" --tags Dept="IT" \ -Environment="Test" --resource-group "SampleResourceGroup_1" --storage-sync-service-name "SampleStorageSyncService_1" +Environment="Test" --resource-group "SampleResourceGroup_1" --name "SampleStorageSyncService_1" """ helps['storagesync storage-sync-service delete'] = """ @@ -62,8 +62,29 @@ examples: - name: StorageSyncServices_Delete text: |- - az storagesync storage-sync-service delete --resource-group "SampleResourceGroup_1" --storage-sync-servi\ -ce-name "SampleStorageSyncService_1" + az storagesync storage-sync-service delete --resource-group "SampleResourceGroup_1" --name "SampleStorag\ +eSyncService_1" +""" + +helps['storagesync storage-sync-service wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the storagesync storage-sync-service is met. + examples: + - name: Pause executing next line of CLI script until the storagesync storage-sync-service is successfully create\ +d. + text: |- + az storagesync storage-sync-service wait --resource-group "SampleResourceGroup_1" --name "SampleStorageS\ +yncService_1" --created + - name: Pause executing next line of CLI script until the storagesync storage-sync-service is successfully update\ +d. + text: |- + az storagesync storage-sync-service wait --resource-group "SampleResourceGroup_1" --name "SampleStorageS\ +yncService_1" --updated + - name: Pause executing next line of CLI script until the storagesync storage-sync-service is successfully delete\ +d. + text: |- + az storagesync storage-sync-service wait --resource-group "SampleResourceGroup_1" --name "SampleStorageS\ +yncService_1" --deleted """ helps['storagesync private-link-resource'] = """ @@ -102,19 +123,30 @@ examples: - name: PrivateEndpointConnections_Get text: |- - az storagesync private-endpoint-connection show --private-endpoint-connection-name "{privateEndpointConn\ -ectionName}" --resource-group "res6977" --storage-sync-service-name "sss2527" + az storagesync private-endpoint-connection show --name "{privateEndpointConnectionName}" --resource-grou\ +p "res6977" --storage-sync-service-name "sss2527" """ helps['storagesync private-endpoint-connection create'] = """ type: command short-summary: Update the state of specified private endpoint connection associated with the storage sync service. + parameters: + - name: --private-link-service-connection-state + short-summary: A collection of information about the state of the connection between service consumer and provi\ +der. + long-summary: | + Usage: --private-link-service-connection-state status=XX description=XX actions-required=XX + + status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + description: The reason for approval/rejection of the connection. + actions-required: A message indicating if changes on the service provider require any updates on the consum\ +er. examples: - name: PrivateEndpointConnections_Create text: |- - az storagesync private-endpoint-connection create --private-endpoint-connection-name "{privateEndpointCo\ -nnectionName}" --private-link-service-connection-state description="Auto-Approved" status="Approved" --resource-group "\ -res7687" --storage-sync-service-name "sss2527" + az storagesync private-endpoint-connection create --name "{privateEndpointConnectionName}" --private-lin\ +k-service-connection-state description="Auto-Approved" status="Approved" --resource-group "res7687" --storage-sync-serv\ +ice-name "sss2527" """ helps['storagesync private-endpoint-connection delete'] = """ @@ -123,8 +155,25 @@ examples: - name: PrivateEndpointConnections_Delete text: |- - az storagesync private-endpoint-connection delete --private-endpoint-connection-name "{privateEndpointCo\ -nnectionName}" --resource-group "res6977" --storage-sync-service-name "sss2527" + az storagesync private-endpoint-connection delete --name "{privateEndpointConnectionName}" --resource-gr\ +oup "res6977" --storage-sync-service-name "sss2527" +""" + +helps['storagesync private-endpoint-connection wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the storagesync private-endpoint-connection is\ + met. + examples: + - name: Pause executing next line of CLI script until the storagesync private-endpoint-connection is successfully\ + created. + text: |- + az storagesync private-endpoint-connection wait --name "{privateEndpointConnectionName}" --resource-grou\ +p "res6977" --storage-sync-service-name "sss2527" --created + - name: Pause executing next line of CLI script until the storagesync private-endpoint-connection is successfully\ + deleted. + text: |- + az storagesync private-endpoint-connection wait --name "{privateEndpointConnectionName}" --resource-grou\ +p "res6977" --storage-sync-service-name "sss2527" --deleted """ helps['storagesync sync-group'] = """ @@ -149,7 +198,7 @@ - name: SyncGroups_Get text: |- az storagesync sync-group show --resource-group "SampleResourceGroup_1" --storage-sync-service-name "Sam\ -pleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +pleStorageSyncService_1" --name "SampleSyncGroup_1" """ helps['storagesync sync-group create'] = """ @@ -159,7 +208,7 @@ - name: SyncGroups_Create text: |- az storagesync sync-group create --properties "{}" --resource-group "SampleResourceGroup_1" --storage-sy\ -nc-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +nc-service-name "SampleStorageSyncService_1" --name "SampleSyncGroup_1" """ helps['storagesync sync-group delete'] = """ @@ -169,7 +218,7 @@ - name: SyncGroups_Delete text: |- az storagesync sync-group delete --resource-group "SampleResourceGroup_1" --storage-sync-service-name "S\ -ampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +ampleStorageSyncService_1" --name "SampleSyncGroup_1" """ helps['storagesync cloud-endpoint'] = """ @@ -193,8 +242,8 @@ examples: - name: CloudEndpoints_Get text: |- - az storagesync cloud-endpoint show --cloud-endpoint-name "SampleCloudEndpoint_1" --resource-group "Sampl\ -eResourceGroup_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" + az storagesync cloud-endpoint show --name "SampleCloudEndpoint_1" --resource-group "SampleResourceGroup_\ +1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" """ helps['storagesync cloud-endpoint create'] = """ @@ -203,12 +252,12 @@ examples: - name: CloudEndpoints_Create text: |- - az storagesync cloud-endpoint create --cloud-endpoint-name "SampleCloudEndpoint_1" --azure-file-share-na\ -me "cvcloud-afscv-0719-058-a94a1354-a1fd-4e9a-9a50-919fad8c4ba4" --friendly-name "ankushbsubscriptionmgmtmab" --storage\ --account-resource-id "/subscriptions/744f4d70-6d17-4921-8970-a765d14f763f/resourceGroups/tminienv59svc/providers/Micros\ -oft.Storage/storageAccounts/tminienv59storage" --storage-account-tenant-id "\\"72f988bf-86f1-41af-91ab-2d7cd011db47\\""\ - --resource-group "SampleResourceGroup_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "S\ -ampleSyncGroup_1" + az storagesync cloud-endpoint create --name "SampleCloudEndpoint_1" --azure-file-share-name "cvcloud-afs\ +cv-0719-058-a94a1354-a1fd-4e9a-9a50-919fad8c4ba4" --friendly-name "ankushbsubscriptionmgmtmab" --storage-account-resour\ +ce-id "/subscriptions/744f4d70-6d17-4921-8970-a765d14f763f/resourceGroups/tminienv59svc/providers/Microsoft.Storage/sto\ +rageAccounts/tminienv59storage" --storage-account-tenant-id "\\"72f988bf-86f1-41af-91ab-2d7cd011db47\\"" --resource-gro\ +up "SampleResourceGroup_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_\ +1" """ helps['storagesync cloud-endpoint delete'] = """ @@ -217,8 +266,8 @@ examples: - name: CloudEndpoints_Delete text: |- - az storagesync cloud-endpoint delete --cloud-endpoint-name "SampleCloudEndpoint_1" --resource-group "Sam\ -pleResourceGroup_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" + az storagesync cloud-endpoint delete --name "SampleCloudEndpoint_1" --resource-group "SampleResourceGrou\ +p_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" """ helps['storagesync cloud-endpoint post-backup'] = """ @@ -227,23 +276,33 @@ examples: - name: CloudEndpoints_PostBackup text: |- - az storagesync cloud-endpoint post-backup --cloud-endpoint-name "SampleCloudEndpoint_1" --azure-file-sha\ -re "https://sampleserver.file.core.test-cint.azure-test.net/sampleFileShare" --resource-group "SampleResourceGroup_1" -\ --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" + az storagesync cloud-endpoint post-backup --name "SampleCloudEndpoint_1" --azure-file-share "https://sam\ +pleserver.file.core.test-cint.azure-test.net/sampleFileShare" --resource-group "SampleResourceGroup_1" --storage-sync-s\ +ervice-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" """ helps['storagesync cloud-endpoint post-restore'] = """ type: command short-summary: Post Restore a given CloudEndpoint. + parameters: + - name: --restore-file-spec + short-summary: Post Restore restore file spec array. + long-summary: | + Usage: --restore-file-spec path=XX isdir=XX + + path: Restore file spec path + isdir: Restore file spec isdir + + Multiple actions can be specified by using more than one --restore-file-spec argument. examples: - name: CloudEndpoints_PostRestore text: |- - az storagesync cloud-endpoint post-restore --cloud-endpoint-name "SampleCloudEndpoint_1" --azure-file-sh\ -are-uri "https://hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare" --restore-file-spec path="t\ -ext1.txt" isdir=false --restore-file-spec path="MyDir" isdir=true --restore-file-spec path="MyDir/SubDir" isdir=false -\ --restore-file-spec path="MyDir/SubDir/File1.pdf" isdir=false --source-azure-file-share-uri "https://hfsazbackupdevintnc\ -us2.file.core.test-cint.azure-test.net/sampleFileShare" --status "Succeeded" --resource-group "SampleResourceGroup_1" -\ --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" + az storagesync cloud-endpoint post-restore --name "SampleCloudEndpoint_1" --azure-file-share-uri "https:\ +//hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare" --restore-file-spec path="text1.txt" isdir\ +=false --restore-file-spec path="MyDir" isdir=true --restore-file-spec path="MyDir/SubDir" isdir=false --restore-file-s\ +pec path="MyDir/SubDir/File1.pdf" isdir=false --source-azure-file-share-uri "https://hfsazbackupdevintncus2.file.core.t\ +est-cint.azure-test.net/sampleFileShare" --status "Succeeded" --resource-group "SampleResourceGroup_1" --storage-sync-s\ +ervice-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" """ helps['storagesync cloud-endpoint pre-backup'] = """ @@ -252,22 +311,32 @@ examples: - name: CloudEndpoints_PreBackup text: |- - az storagesync cloud-endpoint pre-backup --cloud-endpoint-name "SampleCloudEndpoint_1" --azure-file-shar\ -e "https://sampleserver.file.core.test-cint.azure-test.net/sampleFileShare" --resource-group "SampleResourceGroup_1" --\ -storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" + az storagesync cloud-endpoint pre-backup --name "SampleCloudEndpoint_1" --azure-file-share "https://samp\ +leserver.file.core.test-cint.azure-test.net/sampleFileShare" --resource-group "SampleResourceGroup_1" --storage-sync-se\ +rvice-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" """ helps['storagesync cloud-endpoint pre-restore'] = """ type: command short-summary: Pre Restore a given CloudEndpoint. + parameters: + - name: --restore-file-spec + short-summary: Pre Restore restore file spec array. + long-summary: | + Usage: --restore-file-spec path=XX isdir=XX + + path: Restore file spec path + isdir: Restore file spec isdir + + Multiple actions can be specified by using more than one --restore-file-spec argument. examples: - name: CloudEndpoints_PreRestore text: |- - az storagesync cloud-endpoint pre-restore --cloud-endpoint-name "SampleCloudEndpoint_1" --azure-file-sha\ -re-uri "https://hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare" --restore-file-spec path="te\ -xt1.txt" isdir=false --restore-file-spec path="MyDir" isdir=true --restore-file-spec path="MyDir/SubDir" isdir=false --\ -restore-file-spec path="MyDir/SubDir/File1.pdf" isdir=false --resource-group "SampleResourceGroup_1" --storage-sync-ser\ -vice-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" + az storagesync cloud-endpoint pre-restore --name "SampleCloudEndpoint_1" --azure-file-share-uri "https:/\ +/hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare" --restore-file-spec path="text1.txt" isdir=\ +false --restore-file-spec path="MyDir" isdir=true --restore-file-spec path="MyDir/SubDir" isdir=false --restore-file-sp\ +ec path="MyDir/SubDir/File1.pdf" isdir=false --resource-group "SampleResourceGroup_1" --storage-sync-service-name "Samp\ +leStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" """ helps['storagesync cloud-endpoint restoreheartbeat'] = """ @@ -276,9 +345,8 @@ 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 "SampleSyncGro\ -up_1" + az storagesync cloud-endpoint restoreheartbeat --name "SampleCloudEndpoint_1" --resource-group "SampleRe\ +sourceGroup_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" """ helps['storagesync cloud-endpoint trigger-change-detection'] = """ @@ -288,9 +356,23 @@ examples: - name: CloudEndpoints_TriggerChangeDetection text: |- - az storagesync cloud-endpoint trigger-change-detection --cloud-endpoint-name "SampleCloudEndpoint_1" --c\ -hange-detection-mode "Recursive" --directory-path "NewDirectory" --resource-group "SampleResourceGroup_1" --storage-syn\ -c-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" + az storagesync cloud-endpoint trigger-change-detection --name "SampleCloudEndpoint_1" --change-detection\ +-mode "Recursive" --directory-path "NewDirectory" --resource-group "SampleResourceGroup_1" --storage-sync-service-name \ +"SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +""" + +helps['storagesync cloud-endpoint wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the storagesync cloud-endpoint is met. + examples: + - name: Pause executing next line of CLI script until the storagesync cloud-endpoint is successfully created. + text: |- + az storagesync cloud-endpoint wait --name "SampleCloudEndpoint_1" --resource-group "SampleResourceGroup_\ +1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" --created + - name: Pause executing next line of CLI script until the storagesync cloud-endpoint is successfully deleted. + text: |- + az storagesync cloud-endpoint wait --name "SampleCloudEndpoint_1" --resource-group "SampleResourceGroup_\ +1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" --deleted """ helps['storagesync server-endpoint'] = """ @@ -314,8 +396,8 @@ examples: - name: ServerEndpoints_Get text: |- - az storagesync server-endpoint show --resource-group "SampleResourceGroup_1" --server-endpoint-name "Sam\ -pleServerEndpoint_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" + az storagesync server-endpoint show --resource-group "SampleResourceGroup_1" --name "SampleServerEndpoin\ +t_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" """ helps['storagesync server-endpoint create'] = """ @@ -329,8 +411,8 @@ e "myfileshare" --server-local-path "D:\\\\SampleServerEndpoint_1" --server-resource-id "/subscriptions/52b8da2f-61e0-4\ a1f-8dde-336911f367fb/resourceGroups/SampleResourceGroup_1/providers/Microsoft.StorageSync/storageSyncServices/SampleSt\ orageSyncService_1/registeredServers/080d4133-bdb5-40a0-96a0-71a6057bfe9a" --tier-files-older-than-days 0 --volume-free\ --space-percent 100 --resource-group "SampleResourceGroup_1" --server-endpoint-name "SampleServerEndpoint_1" --storage-s\ -ync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" +-space-percent 100 --resource-group "SampleResourceGroup_1" --name "SampleServerEndpoint_1" --storage-sync-service-name\ + "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" """ helps['storagesync server-endpoint update'] = """ @@ -341,8 +423,8 @@ text: |- az storagesync server-endpoint update --cloud-tiering "off" --local-cache-mode "UpdateLocallyCachedFiles\ " --offline-data-transfer "off" --tier-files-older-than-days 0 --volume-free-space-percent 100 --resource-group "Sample\ -ResourceGroup_1" --server-endpoint-name "SampleServerEndpoint_1" --storage-sync-service-name "SampleStorageSyncService_\ -1" --sync-group-name "SampleSyncGroup_1" +ResourceGroup_1" --name "SampleServerEndpoint_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-\ +name "SampleSyncGroup_1" """ helps['storagesync server-endpoint delete'] = """ @@ -351,8 +433,8 @@ examples: - name: ServerEndpoints_Delete text: |- - az storagesync server-endpoint delete --resource-group "SampleResourceGroup_1" --server-endpoint-name "S\ -ampleServerEndpoint_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" + az storagesync server-endpoint delete --resource-group "SampleResourceGroup_1" --name "SampleServerEndpo\ +int_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" """ helps['storagesync server-endpoint recall-action'] = """ @@ -362,8 +444,26 @@ - name: ServerEndpoints_recallAction text: |- az storagesync server-endpoint recall-action --pattern "" --recall-path "" --resource-group "SampleResou\ -rceGroup_1" --server-endpoint-name "SampleServerEndpoint_1" --storage-sync-service-name "SampleStorageSyncService_1" --\ -sync-group-name "SampleSyncGroup_1" +rceGroup_1" --name "SampleServerEndpoint_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name \ +"SampleSyncGroup_1" +""" + +helps['storagesync server-endpoint wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the storagesync server-endpoint is met. + examples: + - name: Pause executing next line of CLI script until the storagesync server-endpoint is successfully created. + text: |- + az storagesync server-endpoint wait --resource-group "SampleResourceGroup_1" --name "SampleServerEndpoin\ +t_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" --created + - name: Pause executing next line of CLI script until the storagesync server-endpoint is successfully updated. + text: |- + az storagesync server-endpoint wait --resource-group "SampleResourceGroup_1" --name "SampleServerEndpoin\ +t_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" --updated + - name: Pause executing next line of CLI script until the storagesync server-endpoint is successfully deleted. + text: |- + az storagesync server-endpoint wait --resource-group "SampleResourceGroup_1" --name "SampleServerEndpoin\ +t_1" --storage-sync-service-name "SampleStorageSyncService_1" --sync-group-name "SampleSyncGroup_1" --deleted """ helps['storagesync registered-server'] = """ @@ -441,6 +541,20 @@ up_1" --server-id "d166ca76-dad2-49df-b409-12345642d730" --storage-sync-service-name "SampleStorageSyncService_1" """ +helps['storagesync registered-server wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the storagesync registered-server is met. + examples: + - name: Pause executing next line of CLI script until the storagesync registered-server is successfully created. + text: |- + az storagesync registered-server wait --resource-group "SampleResourceGroup_1" --server-id "080d4133-bdb\ +5-40a0-96a0-71a6057bfe9a" --storage-sync-service-name "SampleStorageSyncService_1" --created + - name: Pause executing next line of CLI script until the storagesync registered-server is successfully deleted. + text: |- + az storagesync registered-server wait --resource-group "SampleResourceGroup_1" --server-id "080d4133-bdb\ +5-40a0-96a0-71a6057bfe9a" --storage-sync-service-name "SampleStorageSyncService_1" --deleted +""" + helps['storagesync workflow'] = """ type: group short-summary: storagesync workflow diff --git a/src/storagesync/azext_storagesync/generated/_params.py b/src/storagesync/azext_storagesync/generated/_params.py index 0386e168f0c..63694861f04 100644 --- a/src/storagesync/azext_storagesync/generated/_params.py +++ b/src/storagesync/azext_storagesync/generated/_params.py @@ -19,7 +19,6 @@ ) from azure.cli.core.commands.validators import get_default_location_from_resource_group from azext_storagesync.action import ( - AddPrivateEndpoint, AddPrivateLinkServiceConnectionState, AddStoragesyncCloudEndpointPostRestoreRestoreFileSpec, AddStoragesyncCloudEndpointPreRestoreRestoreFileSpec @@ -33,11 +32,13 @@ def load_arguments(self, _): 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.') + c.argument('storage_sync_service_name', options_list=['--name', '-n'], help='Name of Storage Sync Service resou' + 'rce.', id_part='name') 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('storage_sync_service_name', options_list=['--name', '-n'], help='Name of Storage Sync Service resou' + 'rce.') c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) c.argument('tags', tags_type) @@ -46,14 +47,21 @@ def load_arguments(self, _): 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('storage_sync_service_name', options_list=['--name', '-n'], help='Name of Storage Sync Service resou' + 'rce.', id_part='name') c.argument('tags', tags_type) c.argument('incoming_traffic_policy', arg_type=get_enum_type(['AllowAllTraffic', 'AllowVirtualNetworksOnly']), help='Incoming Traffic Policy') 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.') + c.argument('storage_sync_service_name', options_list=['--name', '-n'], help='Name of Storage Sync Service resou' + 'rce.', id_part='name') + + with self.argument_context('storagesync storage-sync-service wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', options_list=['--name', '-n'], help='Name of Storage Sync Service resou' + 'rce.', id_part='name') with self.argument_context('storagesync private-link-resource list') as c: c.argument('resource_group_name', resource_group_name_type) @@ -67,29 +75,33 @@ def load_arguments(self, _): with self.argument_context('storagesync private-endpoint-connection show') as c: c.argument('resource_group_name', resource_group_name_type) c.argument('storage_sync_service_name', help='The name of the storage sync service name within the specified re' - 'source group.') - c.argument('private_endpoint_connection_name', help='The name of the private endpoint connection associated wit' - 'h the Azure resource') + 'source group.', id_part='name') + c.argument('private_endpoint_connection_name', options_list=['--name', '-n'], help='The name of the private end' + 'point connection associated with the Azure resource', id_part='child_name_1') with self.argument_context('storagesync private-endpoint-connection create') as c: c.argument('resource_group_name', resource_group_name_type) c.argument('storage_sync_service_name', help='The name of the storage sync service name within the specified re' 'source group.') - c.argument('private_endpoint_connection_name', help='The name of the private endpoint connection associated wit' - 'h the Azure resource') - c.argument('private_endpoint', action=AddPrivateEndpoint, nargs='+', help='The resource of private end point. E' - 'xpect value: KEY1=VALUE1 KEY2=VALUE2 ...') + c.argument('private_endpoint_connection_name', options_list=['--name', '-n'], help='The name of the private end' + 'point connection associated with the Azure resource') c.argument('private_link_service_connection_state', action=AddPrivateLinkServiceConnectionState, nargs='+', help='A collection of information about the state of the connection between service consumer and pro' - 'vider. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: status, description, action-' - 'required.') + 'vider.') with self.argument_context('storagesync private-endpoint-connection delete') as c: c.argument('resource_group_name', resource_group_name_type) c.argument('storage_sync_service_name', help='The name of the storage sync service name within the specified re' - 'source group.') - c.argument('private_endpoint_connection_name', help='The name of the private endpoint connection associated wit' - 'h the Azure resource') + 'source group.', id_part='name') + c.argument('private_endpoint_connection_name', options_list=['--name', '-n'], help='The name of the private end' + 'point connection associated with the Azure resource', id_part='child_name_1') + + with self.argument_context('storagesync private-endpoint-connection wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='The name of the storage sync service name within the specified re' + 'source group.', id_part='name') + c.argument('private_endpoint_connection_name', options_list=['--name', '-n'], help='The name of the private end' + 'point connection associated with the Azure resource', id_part='child_name_1') with self.argument_context('storagesync sync-group list') as c: c.argument('resource_group_name', resource_group_name_type) @@ -97,20 +109,22 @@ def load_arguments(self, _): 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.') + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', options_list=['--name', '-n'], help='Name of Sync Group resource.', id_part='chil' + 'd_name_1') 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('sync_group_name', options_list=['--name', '-n'], help='Name of Sync Group resource.') c.argument('properties', arg_type=CLIArgumentType(options_list=['--properties'], help='The parameters used to c' 'reate the sync group Expected value: json-string/@json-file.')) 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.') + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', options_list=['--name', '-n'], help='Name of Sync Group resource.', id_part='chil' + 'd_name_1') with self.argument_context('storagesync cloud-endpoint list') as c: c.argument('resource_group_name', resource_group_name_type) @@ -119,15 +133,16 @@ def load_arguments(self, _): 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.') + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('cloud_endpoint_name', options_list=['--name', '-n'], help='Name of Cloud Endpoint object.', + id_part='child_name_2') 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('cloud_endpoint_name', options_list=['--name', '-n'], help='Name of Cloud Endpoint object.') c.argument('storage_account_resource_id', help='Storage Account Resource Id') c.argument('azure_file_share_name', help='Azure file share name') c.argument('storage_account_tenant_id', help='Storage Account Tenant Id') @@ -135,22 +150,25 @@ def load_arguments(self, _): 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.') + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('cloud_endpoint_name', options_list=['--name', '-n'], help='Name of Cloud Endpoint object.', + id_part='child_name_2') 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('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('cloud_endpoint_name', options_list=['--name', '-n'], help='Name of Cloud Endpoint object.', + id_part='child_name_2') c.argument('azure_file_share', help='Azure File Share.') 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('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('cloud_endpoint_name', options_list=['--name', '-n'], help='Name of Cloud Endpoint object.', + id_part='child_name_2') c.argument('partition', help='Post Restore partition.') c.argument('replica_group', help='Post Restore replica group.') c.argument('request_id', help='Post Restore request id.') @@ -159,21 +177,22 @@ def load_arguments(self, _): c.argument('source_azure_file_share_uri', help='Post Restore Azure source azure file share uri.') c.argument('failed_file_list', help='Post Restore Azure failed file list.') c.argument('restore_file_spec', action=AddStoragesyncCloudEndpointPostRestoreRestoreFileSpec, nargs='+', help= - 'Post Restore restore file spec array. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs ar' - 'e: path, isdir.') + 'Post Restore restore file spec array.') 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('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('cloud_endpoint_name', options_list=['--name', '-n'], help='Name of Cloud Endpoint object.', + id_part='child_name_2') c.argument('azure_file_share', help='Azure File Share.') 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('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('cloud_endpoint_name', options_list=['--name', '-n'], help='Name of Cloud Endpoint object.', + id_part='child_name_2') c.argument('partition', help='Pre Restore partition.') c.argument('replica_group', help='Pre Restore replica group.') c.argument('request_id', help='Pre Restore request id.') @@ -182,28 +201,36 @@ def load_arguments(self, _): c.argument('source_azure_file_share_uri', help='Pre Restore Azure source azure file share uri.') c.argument('backup_metadata_property_bag', help='Pre Restore backup metadata property bag.') c.argument('restore_file_spec', action=AddStoragesyncCloudEndpointPreRestoreRestoreFileSpec, nargs='+', help='P' - 're Restore restore file spec array. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are:' - ' path, isdir.') + 're Restore restore file spec array.') c.argument('pause_wait_for_sync_drain_time_period_in_seconds', help='Pre Restore pause wait for sync drain time' ' period in seconds.') 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.') + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('cloud_endpoint_name', options_list=['--name', '-n'], help='Name of Cloud Endpoint object.', + id_part='child_name_2') 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('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('cloud_endpoint_name', options_list=['--name', '-n'], help='Name of Cloud Endpoint object.', + id_part='child_name_2') c.argument('directory_path', help='Relative path to a directory Azure File share for which change detection is ' 'to be performed.') c.argument('change_detection_mode', arg_type=get_enum_type(['Default', 'Recursive']), help='Change Detection Mo' 'de. Applies to a directory specified in directoryPath parameter.') c.argument('paths', nargs='+', help='Array of relative paths on the Azure File share to be included in the chan' - 'ge detection. Can be files and directories. Expected value: json-string/@json-file.') + 'ge detection. Can be files and directories.') + + with self.argument_context('storagesync cloud-endpoint wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('cloud_endpoint_name', options_list=['--name', '-n'], help='Name of Cloud Endpoint object.', + id_part='child_name_2') with self.argument_context('storagesync server-endpoint list') as c: c.argument('resource_group_name', resource_group_name_type) @@ -212,15 +239,16 @@ def load_arguments(self, _): 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.') + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('server_endpoint_name', options_list=['--name', '-n'], help='Name of Server Endpoint object.', + id_part='child_name_2') 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('server_endpoint_name', options_list=['--name', '-n'], help='Name of Server Endpoint object.') c.argument('server_local_path', help='Server Local path.') c.argument('cloud_tiering', arg_type=get_enum_type(['on', 'off']), help='Cloud Tiering.') c.argument('volume_free_space_percent', help='Level of free space to be maintained by Cloud Tiering if it is en' @@ -238,9 +266,10 @@ def load_arguments(self, _): 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('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('server_endpoint_name', options_list=['--name', '-n'], help='Name of Server Endpoint object.', + id_part='child_name_2') c.argument('cloud_tiering', arg_type=get_enum_type(['on', 'off']), help='Cloud Tiering.') c.argument('volume_free_space_percent', help='Level of free space to be maintained by Cloud Tiering if it is en' 'abled.') @@ -253,26 +282,35 @@ def load_arguments(self, _): 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.') + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('server_endpoint_name', options_list=['--name', '-n'], help='Name of Server Endpoint object.', + id_part='child_name_2') 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('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('server_endpoint_name', options_list=['--name', '-n'], help='Name of Server Endpoint object.', + id_part='child_name_2') c.argument('pattern', help='Pattern of the files.') c.argument('recall_path', help='Recall path.') + with self.argument_context('storagesync server-endpoint wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('sync_group_name', help='Name of Sync Group resource.', id_part='child_name_1') + c.argument('server_endpoint_name', options_list=['--name', '-n'], help='Name of Server Endpoint object.', + id_part='child_name_2') + 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.') + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('server_id', help='GUID identifying the on-premises server.', id_part='child_name_1') with self.argument_context('storagesync registered-server create') as c: c.argument('resource_group_name', resource_group_name_type) @@ -290,31 +328,36 @@ def load_arguments(self, _): 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.') + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('server_id', help='GUID identifying the on-premises server.', id_part='child_name_1') 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='Server Id') + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('server_id', help='Server Id', id_part='child_name_1') c.argument('server_certificate', help='Certificate Data') + with self.argument_context('storagesync registered-server wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('server_id', help='GUID identifying the on-premises server.', id_part='child_name_1') + 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') + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('workflow_id', help='workflow Id', id_part='child_name_1') 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') + c.argument('storage_sync_service_name', help='Name of Storage Sync Service resource.', id_part='name') + c.argument('workflow_id', help='workflow Id', id_part='child_name_1') 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 to obtain information from.') - c.argument('workflow_id', help='workflow Id') - c.argument('operation_id', help='operation Id') + c.argument('location_name', help='The desired region to obtain information from.', id_part='name') + c.argument('workflow_id', help='workflow Id', id_part='child_name_1') + c.argument('operation_id', help='operation Id', id_part='child_name_2') diff --git a/src/storagesync/azext_storagesync/generated/_validators.py b/src/storagesync/azext_storagesync/generated/_validators.py index 7536d0531ea..e5ac7838677 100644 --- a/src/storagesync/azext_storagesync/generated/_validators.py +++ b/src/storagesync/azext_storagesync/generated/_validators.py @@ -7,17 +7,3 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- - - -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 index 2dcdf293e67..47fbc0b0828 100644 --- a/src/storagesync/azext_storagesync/generated/action.py +++ b/src/storagesync/azext_storagesync/generated/action.py @@ -14,33 +14,11 @@ from collections import defaultdict -class AddPrivateEndpoint(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.private_endpoint = action - - - def get_action(self, values, option_string): # pylint: disable=no-self-use - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - return d - - class AddPrivateLinkServiceConnectionState(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) namespace.private_link_service_connection_state = action - def get_action(self, values, option_string): # pylint: disable=no-self-use try: properties = defaultdict(list) @@ -57,8 +35,8 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use d['status'] = v[0] elif kl == 'description': d['description'] = v[0] - elif kl == 'action-required': - d['action_required'] = v[0] + elif kl == 'actions-required': + d['actions_required'] = v[0] return d @@ -67,7 +45,6 @@ def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) super(AddStoragesyncCloudEndpointPostRestoreRestoreFileSpec, self).__call__(parser, namespace, action, option_string) - def get_action(self, values, option_string): # pylint: disable=no-self-use try: properties = defaultdict(list) @@ -92,7 +69,6 @@ def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) super(AddStoragesyncCloudEndpointPreRestoreRestoreFileSpec, self).__call__(parser, namespace, action, option_string) - def get_action(self, values, option_string): # pylint: disable=no-self-use try: properties = defaultdict(list) diff --git a/src/storagesync/azext_storagesync/generated/commands.py b/src/storagesync/azext_storagesync/generated/commands.py index 4ff2fa096f2..b5f0bd77cf9 100644 --- a/src/storagesync/azext_storagesync/generated/commands.py +++ b/src/storagesync/azext_storagesync/generated/commands.py @@ -25,7 +25,7 @@ def load_command_table(self, _): g.custom_command('create', 'storagesync_storage_sync_service_create', supports_no_wait=True) g.custom_command('update', 'storagesync_storage_sync_service_update', supports_no_wait=True) g.custom_command('delete', 'storagesync_storage_sync_service_delete', supports_no_wait=True) - g.wait_command('wait') + g.custom_wait_command('wait', 'storagesync_storage_sync_service_show') from azext_storagesync.generated._client_factory import cf_private_link_resource storagesync_private_link_resource = CliCommandType( @@ -47,7 +47,7 @@ def load_command_table(self, _): g.custom_show_command('show', 'storagesync_private_endpoint_connection_show') g.custom_command('create', 'storagesync_private_endpoint_connection_create', supports_no_wait=True) g.custom_command('delete', 'storagesync_private_endpoint_connection_delete', supports_no_wait=True) - g.wait_command('wait') + g.custom_wait_command('wait', 'storagesync_private_endpoint_connection_show') from azext_storagesync.generated._client_factory import cf_sync_group storagesync_sync_group = CliCommandType( @@ -79,7 +79,7 @@ def load_command_table(self, _): g.custom_command('restoreheartbeat', 'storagesync_cloud_endpoint_restoreheartbeat') g.custom_command('trigger-change-detection', 'storagesync_cloud_endpoint_trigger_change_detection', supports_no_wait=True) - g.wait_command('wait') + g.custom_wait_command('wait', 'storagesync_cloud_endpoint_show') from azext_storagesync.generated._client_factory import cf_server_endpoint storagesync_server_endpoint = CliCommandType( @@ -94,7 +94,7 @@ def load_command_table(self, _): 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') + g.custom_wait_command('wait', 'storagesync_server_endpoint_show') from azext_storagesync.generated._client_factory import cf_registered_server storagesync_registered_server = CliCommandType( @@ -108,7 +108,7 @@ def load_command_table(self, _): 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') + g.custom_wait_command('wait', 'storagesync_registered_server_show') from azext_storagesync.generated._client_factory import cf_workflow storagesync_workflow = CliCommandType( diff --git a/src/storagesync/azext_storagesync/generated/custom.py b/src/storagesync/azext_storagesync/generated/custom.py index 4b0b10bf22d..a3b2b71db05 100644 --- a/src/storagesync/azext_storagesync/generated/custom.py +++ b/src/storagesync/azext_storagesync/generated/custom.py @@ -11,68 +11,78 @@ # pylint: disable=too-many-lines import json +from azure.cli.core.util import sdk_no_wait -def storagesync_storage_sync_service_list(cmd, client, +def storagesync_storage_sync_service_list(client, resource_group_name=None): - if resource_group_name is not None: + if resource_group_name: 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, +def storagesync_storage_sync_service_show(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, +def storagesync_storage_sync_service_create(client, resource_group_name, storage_sync_service_name, location, tags=None, - incoming_traffic_policy=None): - return client.begin_create(resource_group_name=resource_group_name, - storage_sync_service_name=storage_sync_service_name, - location=location, - tags=tags, - incoming_traffic_policy=incoming_traffic_policy) - - -def storagesync_storage_sync_service_update(cmd, client, + incoming_traffic_policy=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create, + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + location=location, + tags=tags, + incoming_traffic_policy=incoming_traffic_policy) + + +def storagesync_storage_sync_service_update(client, resource_group_name, storage_sync_service_name, tags=None, - incoming_traffic_policy=None): - return client.begin_update(resource_group_name=resource_group_name, - storage_sync_service_name=storage_sync_service_name, - tags=tags, - incoming_traffic_policy=incoming_traffic_policy) + incoming_traffic_policy=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + tags=tags, + incoming_traffic_policy=incoming_traffic_policy) -def storagesync_storage_sync_service_delete(cmd, client, +def storagesync_storage_sync_service_delete(client, resource_group_name, - storage_sync_service_name): - return client.begin_delete(resource_group_name=resource_group_name, - storage_sync_service_name=storage_sync_service_name) + storage_sync_service_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name) -def storagesync_private_link_resource_list(cmd, client, +def storagesync_private_link_resource_list(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_private_endpoint_connection_list(cmd, client, +def storagesync_private_endpoint_connection_list(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_private_endpoint_connection_show(cmd, client, +def storagesync_private_endpoint_connection_show(client, resource_group_name, storage_sync_service_name, private_endpoint_connection_name): @@ -81,36 +91,41 @@ def storagesync_private_endpoint_connection_show(cmd, client, private_endpoint_connection_name=private_endpoint_connection_name) -def storagesync_private_endpoint_connection_create(cmd, client, +def storagesync_private_endpoint_connection_create(client, resource_group_name, storage_sync_service_name, private_endpoint_connection_name, - private_endpoint=None, - private_link_service_connection_state=None): - return client.begin_create(resource_group_name=resource_group_name, - storage_sync_service_name=storage_sync_service_name, - private_endpoint_connection_name=private_endpoint_connection_name, - private_endpoint=private_endpoint, - private_link_service_connection_state=private_link_service_connection_state) - - -def storagesync_private_endpoint_connection_delete(cmd, client, + private_link_service_connection_state=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create, + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint=json.loads("{}"), + private_link_service_connection_state=private_link_service_connection_state) + + +def storagesync_private_endpoint_connection_delete(client, resource_group_name, storage_sync_service_name, - private_endpoint_connection_name): - return client.begin_delete(resource_group_name=resource_group_name, - storage_sync_service_name=storage_sync_service_name, - private_endpoint_connection_name=private_endpoint_connection_name) + private_endpoint_connection_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + private_endpoint_connection_name=private_endpoint_connection_name) -def storagesync_sync_group_list(cmd, client, +def storagesync_sync_group_list(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, +def storagesync_sync_group_show(client, resource_group_name, storage_sync_service_name, sync_group_name): @@ -119,7 +134,7 @@ def storagesync_sync_group_show(cmd, client, sync_group_name=sync_group_name) -def storagesync_sync_group_create(cmd, client, +def storagesync_sync_group_create(client, resource_group_name, storage_sync_service_name, sync_group_name, @@ -132,7 +147,7 @@ def storagesync_sync_group_create(cmd, client, properties=properties) -def storagesync_sync_group_delete(cmd, client, +def storagesync_sync_group_delete(client, resource_group_name, storage_sync_service_name, sync_group_name): @@ -141,7 +156,7 @@ def storagesync_sync_group_delete(cmd, client, sync_group_name=sync_group_name) -def storagesync_cloud_endpoint_list(cmd, client, +def storagesync_cloud_endpoint_list(client, resource_group_name, storage_sync_service_name, sync_group_name): @@ -150,7 +165,7 @@ def storagesync_cloud_endpoint_list(cmd, client, sync_group_name=sync_group_name) -def storagesync_cloud_endpoint_show(cmd, client, +def storagesync_cloud_endpoint_show(client, resource_group_name, storage_sync_service_name, sync_group_name, @@ -161,7 +176,7 @@ def storagesync_cloud_endpoint_show(cmd, client, cloud_endpoint_name=cloud_endpoint_name) -def storagesync_cloud_endpoint_create(cmd, client, +def storagesync_cloud_endpoint_create(client, resource_group_name, storage_sync_service_name, sync_group_name, @@ -169,42 +184,51 @@ def storagesync_cloud_endpoint_create(cmd, client, storage_account_resource_id=None, azure_file_share_name=None, storage_account_tenant_id=None, - friendly_name=None): - 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, - storage_account_resource_id=storage_account_resource_id, - azure_file_share_name=azure_file_share_name, - storage_account_tenant_id=storage_account_tenant_id, - friendly_name=friendly_name) - - -def storagesync_cloud_endpoint_delete(cmd, client, + friendly_name=None, + no_wait=False): + return sdk_no_wait(no_wait, + 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, + storage_account_resource_id=storage_account_resource_id, + azure_file_share_name=azure_file_share_name, + storage_account_tenant_id=storage_account_tenant_id, + friendly_name=friendly_name) + + +def storagesync_cloud_endpoint_delete(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) + cloud_endpoint_name, + no_wait=False): + return sdk_no_wait(no_wait, + 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_post_backup(cmd, client, +def storagesync_cloud_endpoint_post_backup(client, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, - azure_file_share=None): - 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, - azure_file_share=azure_file_share) - - -def storagesync_cloud_endpoint_post_restore(cmd, client, + azure_file_share=None, + no_wait=False): + return sdk_no_wait(no_wait, + 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, + azure_file_share=azure_file_share) + + +def storagesync_cloud_endpoint_post_restore(client, resource_group_name, storage_sync_service_name, sync_group_name, @@ -216,35 +240,41 @@ def storagesync_cloud_endpoint_post_restore(cmd, client, status=None, source_azure_file_share_uri=None, failed_file_list=None, - restore_file_spec=None): - 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, - partition=partition, - replica_group=replica_group, - request_id_parameter=request_id, - azure_file_share_uri=azure_file_share_uri, - status=status, - source_azure_file_share_uri=source_azure_file_share_uri, - failed_file_list=failed_file_list, - restore_file_spec=restore_file_spec) - - -def storagesync_cloud_endpoint_pre_backup(cmd, client, + restore_file_spec=None, + no_wait=False): + return sdk_no_wait(no_wait, + 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, + partition=partition, + replica_group=replica_group, + request_id_parameter=request_id, + azure_file_share_uri=azure_file_share_uri, + status=status, + source_azure_file_share_uri=source_azure_file_share_uri, + failed_file_list=failed_file_list, + restore_file_spec=restore_file_spec) + + +def storagesync_cloud_endpoint_pre_backup(client, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, - azure_file_share=None): - 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, - azure_file_share=azure_file_share) - - -def storagesync_cloud_endpoint_pre_restore(cmd, client, + azure_file_share=None, + no_wait=False): + return sdk_no_wait(no_wait, + 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, + azure_file_share=azure_file_share) + + +def storagesync_cloud_endpoint_pre_restore(client, resource_group_name, storage_sync_service_name, sync_group_name, @@ -257,23 +287,26 @@ def storagesync_cloud_endpoint_pre_restore(cmd, client, source_azure_file_share_uri=None, backup_metadata_property_bag=None, restore_file_spec=None, - pause_wait_for_sync_drain_time_period_in_seconds=None): - 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, - partition=partition, - replica_group=replica_group, - request_id_parameter=request_id, - azure_file_share_uri=azure_file_share_uri, - status=status, - source_azure_file_share_uri=source_azure_file_share_uri, - backup_metadata_property_bag=backup_metadata_property_bag, - restore_file_spec=restore_file_spec, - pause_wait_for_sync_drain_time_period_in_seconds=pause_wait_for_sync_drain_time_period_in_seconds) - - -def storagesync_cloud_endpoint_restoreheartbeat(cmd, client, + pause_wait_for_sync_drain_time_period_in_seconds=None, + no_wait=False): + return sdk_no_wait(no_wait, + 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, + partition=partition, + replica_group=replica_group, + request_id_parameter=request_id, + azure_file_share_uri=azure_file_share_uri, + status=status, + source_azure_file_share_uri=source_azure_file_share_uri, + backup_metadata_property_bag=backup_metadata_property_bag, + restore_file_spec=restore_file_spec, + pause_wait_for_sync_drain_time_period_in_seconds=pause_wait_for_sync_drain_time_period_in_seconds) + + +def storagesync_cloud_endpoint_restoreheartbeat(client, resource_group_name, storage_sync_service_name, sync_group_name, @@ -284,26 +317,27 @@ def storagesync_cloud_endpoint_restoreheartbeat(cmd, client, cloud_endpoint_name=cloud_endpoint_name) -def storagesync_cloud_endpoint_trigger_change_detection(cmd, client, +def storagesync_cloud_endpoint_trigger_change_detection(client, resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, directory_path=None, change_detection_mode=None, - paths=None): - if isinstance(paths, str): - paths = json.loads(paths) - 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, - directory_path=directory_path, - change_detection_mode=change_detection_mode, - paths=paths) - - -def storagesync_server_endpoint_list(cmd, client, + paths=None, + no_wait=False): + return sdk_no_wait(no_wait, + 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, + directory_path=directory_path, + change_detection_mode=change_detection_mode, + paths=paths) + + +def storagesync_server_endpoint_list(client, resource_group_name, storage_sync_service_name, sync_group_name): @@ -312,7 +346,7 @@ def storagesync_server_endpoint_list(cmd, client, sync_group_name=sync_group_name) -def storagesync_server_endpoint_show(cmd, client, +def storagesync_server_endpoint_show(client, resource_group_name, storage_sync_service_name, sync_group_name, @@ -323,7 +357,7 @@ def storagesync_server_endpoint_show(cmd, client, server_endpoint_name=server_endpoint_name) -def storagesync_server_endpoint_create(cmd, client, +def storagesync_server_endpoint_create(client, resource_group_name, storage_sync_service_name, sync_group_name, @@ -337,24 +371,27 @@ def storagesync_server_endpoint_create(cmd, client, offline_data_transfer=None, offline_data_transfer_share_name=None, initial_download_policy=None, - local_cache_mode=None): - 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, - server_local_path=server_local_path, - cloud_tiering=cloud_tiering, - volume_free_space_percent=volume_free_space_percent, - tier_files_older_than_days=tier_files_older_than_days, - friendly_name=friendly_name, - server_resource_id=server_resource_id, - offline_data_transfer=offline_data_transfer, - offline_data_transfer_share_name=offline_data_transfer_share_name, - initial_download_policy=initial_download_policy, - local_cache_mode=local_cache_mode) - - -def storagesync_server_endpoint_update(cmd, client, + local_cache_mode=None, + no_wait=False): + return sdk_no_wait(no_wait, + 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, + server_local_path=server_local_path, + cloud_tiering=cloud_tiering, + volume_free_space_percent=volume_free_space_percent, + tier_files_older_than_days=tier_files_older_than_days, + friendly_name=friendly_name, + server_resource_id=server_resource_id, + offline_data_transfer=offline_data_transfer, + offline_data_transfer_share_name=offline_data_transfer_share_name, + initial_download_policy=initial_download_policy, + local_cache_mode=local_cache_mode) + + +def storagesync_server_endpoint_update(client, resource_group_name, storage_sync_service_name, sync_group_name, @@ -364,53 +401,62 @@ def storagesync_server_endpoint_update(cmd, client, tier_files_older_than_days=None, offline_data_transfer=None, offline_data_transfer_share_name=None, - local_cache_mode=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, - cloud_tiering=cloud_tiering, - volume_free_space_percent=volume_free_space_percent, - tier_files_older_than_days=tier_files_older_than_days, - offline_data_transfer=offline_data_transfer, - offline_data_transfer_share_name=offline_data_transfer_share_name, - local_cache_mode=local_cache_mode) - - -def storagesync_server_endpoint_delete(cmd, client, + local_cache_mode=None, + no_wait=False): + return sdk_no_wait(no_wait, + 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, + cloud_tiering=cloud_tiering, + volume_free_space_percent=volume_free_space_percent, + tier_files_older_than_days=tier_files_older_than_days, + offline_data_transfer=offline_data_transfer, + offline_data_transfer_share_name=offline_data_transfer_share_name, + local_cache_mode=local_cache_mode) + + +def storagesync_server_endpoint_delete(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) + server_endpoint_name, + no_wait=False): + return sdk_no_wait(no_wait, + 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, +def storagesync_server_endpoint_recall_action(client, resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, pattern=None, - recall_path=None): - 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, - pattern=pattern, - recall_path=recall_path) - - -def storagesync_registered_server_list(cmd, client, + recall_path=None, + no_wait=False): + return sdk_no_wait(no_wait, + 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, + pattern=pattern, + recall_path=recall_path) + + +def storagesync_registered_server_list(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, +def storagesync_registered_server_show(client, resource_group_name, storage_sync_service_name, server_id): @@ -419,7 +465,7 @@ def storagesync_registered_server_show(cmd, client, server_id=server_id) -def storagesync_registered_server_create(cmd, client, +def storagesync_registered_server_create(client, resource_group_name, storage_sync_service_name, server_id, @@ -431,49 +477,58 @@ def storagesync_registered_server_create(cmd, client, server_role=None, cluster_id=None, cluster_name=None, - friendly_name=None): - return client.begin_create(resource_group_name=resource_group_name, - storage_sync_service_name=storage_sync_service_name, - server_id=server_id, - server_certificate=server_certificate, - agent_version=agent_version, - server_os_version=server_osversion, - last_heart_beat=last_heart_beat, - server_role=server_role, - cluster_id=cluster_id, - cluster_name=cluster_name, - registered_server_create_parameters_properties_server_id=properties_server_id, - friendly_name=friendly_name) - - -def storagesync_registered_server_delete(cmd, client, + friendly_name=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create, + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + server_id=server_id, + server_certificate=server_certificate, + agent_version=agent_version, + server_os_version=server_osversion, + last_heart_beat=last_heart_beat, + server_role=server_role, + cluster_id=cluster_id, + cluster_name=cluster_name, + registered_server_create_parameters_properties_server_id=properties_server_id, + friendly_name=friendly_name) + + +def storagesync_registered_server_delete(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) + server_id, + no_wait=False): + return sdk_no_wait(no_wait, + 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, +def storagesync_registered_server_trigger_rollover(client, resource_group_name, storage_sync_service_name, server_id, - server_certificate=None): - return client.begin_trigger_rollover(resource_group_name=resource_group_name, - storage_sync_service_name=storage_sync_service_name, - server_id=server_id, - server_certificate=server_certificate) + server_certificate=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_trigger_rollover, + resource_group_name=resource_group_name, + storage_sync_service_name=storage_sync_service_name, + server_id=server_id, + server_certificate=server_certificate) -def storagesync_workflow_list(cmd, client, +def storagesync_workflow_list(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, +def storagesync_workflow_show(client, resource_group_name, storage_sync_service_name, workflow_id): @@ -482,7 +537,7 @@ def storagesync_workflow_show(cmd, client, workflow_id=workflow_id) -def storagesync_workflow_abort(cmd, client, +def storagesync_workflow_abort(client, resource_group_name, storage_sync_service_name, workflow_id): @@ -491,7 +546,7 @@ def storagesync_workflow_abort(cmd, client, workflow_id=workflow_id) -def storagesync_operation_status_show(cmd, client, +def storagesync_operation_status_show(client, resource_group_name, location_name, workflow_id, diff --git a/src/storagesync/azext_storagesync/tests/__init__.py b/src/storagesync/azext_storagesync/tests/__init__.py index fe1bd438b46..5f8f1fd97ad 100644 --- a/src/storagesync/azext_storagesync/tests/__init__.py +++ b/src/storagesync/azext_storagesync/tests/__init__.py @@ -10,9 +10,14 @@ # -------------------------------------------------------------------------- import inspect import os +import sys +import traceback +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError __path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] def try_manual(func): @@ -34,6 +39,7 @@ def get_func_to_call(): func_to_call = func try: func_to_call = import_manual_function(func) + print("Found manual override for {}(...)".format(func.__name__)) except (ImportError, AttributeError): pass return func_to_call @@ -41,9 +47,25 @@ def get_func_to_call(): def wrapper(*args, **kwargs): func_to_call = get_func_to_call() print("running {}()...".format(func.__name__)) - return func_to_call(*args, **kwargs) + try: + return func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, JMESPathCheckAssertionError) as e: + print("--------------------------------------") + print("step exception: ", e) + print("--------------------------------------", file=sys.stderr) + print("step exception in {}: {}".format(func.__name__, e), file=sys.stderr) + traceback.print_exc() + exceptions.append((func.__name__, sys.exc_info())) if inspect.isclass(func): return get_func_to_call() - else: - return wrapper + return wrapper + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/storagesync/azext_storagesync/tests/latest/preparers.py b/src/storagesync/azext_storagesync/tests/latest/preparers.py index 3d6672de64f..4702355b2bd 100644 --- a/src/storagesync/azext_storagesync/tests/latest/preparers.py +++ b/src/storagesync/azext_storagesync/tests/latest/preparers.py @@ -10,8 +10,8 @@ import os from datetime import datetime -from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer from azure_devtools.scenario_tests import SingleValueReplacer +from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer from azure.cli.testsdk.exceptions import CliTestError from azure.cli.testsdk.reverse_dependency import get_dummy_cli @@ -19,6 +19,7 @@ KEY_RESOURCE_GROUP = 'rg' KEY_VIRTUAL_NETWORK = 'vnet' KEY_VNET_SUBNET = 'subnet' +KEY_VNET_NIC = 'nic' class VirtualNetworkPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): @@ -40,7 +41,7 @@ def __init__(self, name_prefix='clitest.vn', self.resource_group_key = resource_group_key self.dev_setting_name = os.environ.get(dev_setting_name, None) - def create_resource(self, name, **kwargs): + def create_resource(self, name, **_): if self.dev_setting_name: return {self.parameter_name: self.dev_setting_name, } @@ -56,61 +57,103 @@ def create_resource(self, name, **kwargs): 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 + template = 'az network vnet create --resource-group {} --name {} --subnet-name default --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): + def remove_resource(self, name, **_): # 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 {} --resource-group {}'.format(name, self.resource_group_name)) + self.cli_ctx, + 'az network vnet delete --name {} --resource-group {}'.format(name, self.resource_group_name)) class VnetSubnetPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): def __init__(self, name_prefix='clitest.vn', parameter_name='subnet', - 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=24, key=KEY_VNET_SUBNET): + key=KEY_VNET_SUBNET): if ' ' in name_prefix: raise CliTestError( 'Error: Space character in name prefix \'%s\'' % name_prefix) - super(VnetSubnetPreparer, self).__init__( - name_prefix, random_name_length) + super(VnetSubnetPreparer, self).__init__(name_prefix, 15) 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.resource_group = [resource_group_key, None] + self.vnet = [vnet_key, None] self.address_prefixes = address_prefixes self.dev_setting_name = os.environ.get(dev_setting_name, None) - def create_resource(self, name, **kwargs): + def create_resource(self, name, **_): 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: + if not self.resource_group[1]: + self.resource_group[1] = self.test_class_instance.kwargs.get( + self.resource_group[0]) + if not self.resource_group[1]: 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: + if not self.vnet[1]: + self.vnet[1] = self.test_class_instance.kwargs.get(self.vnet[0]) + if not self.vnet[1]: raise CliTestError("Error: No vnet configured!") self.test_class_instance.kwargs[self.key] = 'default' return {self.parameter_name: name} - def remove_resource(self, name, **kwargs): + def remove_resource(self, name, **_): pass + + +class VnetNicPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.nic', + parameter_name='subnet', + resource_group_key=KEY_RESOURCE_GROUP, + vnet_key=KEY_VIRTUAL_NETWORK, + dev_setting_name='AZURE_CLI_TEST_DEV_VNET_NIC_NAME', + key=KEY_VNET_NIC): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VnetNicPreparer, self).__init__(name_prefix, 15) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group = [resource_group_key, None] + self.vnet = [vnet_key, None] + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **_): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group[1]: + self.resource_group[1] = self.test_class_instance.kwargs.get( + self.resource_group[0]) + if not self.resource_group[1]: + raise CliTestError("Error: No resource group configured!") + if not self.vnet[1]: + self.vnet[1] = self.test_class_instance.kwargs.get(self.vnet[0]) + if not self.vnet[1]: + raise CliTestError("Error: No vnet configured!") + + template = 'az network nic create --resource-group {} --name {} --vnet-name {} --subnet default ' + self.live_only_execute(self.cli_ctx, template.format( + self.resource_group[1], name, self.vnet[1])) + + self.test_class_instance.kwargs[self.key] = name + return {self.parameter_name: name} + + def remove_resource(self, name, **_): + if not self.dev_setting_name: + self.live_only_execute( + self.cli_ctx, + 'az network nic delete --name {} --resource-group {}'.format(name, self.resource_group[1])) diff --git a/src/storagesync/azext_storagesync/tests/latest/test_storagesync_scenario.py b/src/storagesync/azext_storagesync/tests/latest/test_storagesync_scenario.py index b067e901a61..7427a928daf 100644 --- a/src/storagesync/azext_storagesync/tests/latest/test_storagesync_scenario.py +++ b/src/storagesync/azext_storagesync/tests/latest/test_storagesync_scenario.py @@ -9,11 +9,8 @@ # -------------------------------------------------------------------------- import os -import unittest - -from azure_devtools.scenario_tests import AllowLargeResponse from azure.cli.testsdk import ScenarioTest -from .. import try_manual +from .. import try_manual, raise_if from azure.cli.testsdk import ResourceGroupPreparer from azure.cli.testsdk import StorageAccountPreparer @@ -33,11 +30,11 @@ def step_storagesyncservices_create(test, rg, rg_2): '--location "WestUS" ' '--incoming-traffic-policy "AllowAllTraffic" ' '--resource-group "{rg_2}" ' - '--storage-sync-service-name "{SampleStorageSyncService_1}"', + '--name "{SampleStorageSyncService_1}"', checks=[]) test.cmd('az storagesync storage-sync-service wait --created ' '--resource-group "{rg_2}" ' - '--storage-sync-service-name "{SampleStorageSyncService_1}"', + '--name "{SampleStorageSyncService_1}"', checks=[]) @@ -48,7 +45,7 @@ def step_syncgroups_create(test, rg, rg_2): '--properties "{{}}" ' '--resource-group "{rg_2}" ' '--storage-sync-service-name "{SampleStorageSyncService_1}" ' - '--sync-group-name "{SampleSyncGroup_1}"', + '--name "{SampleSyncGroup_1}"', checks=[]) @@ -75,16 +72,13 @@ def step_registeredservers_create(test, rg, rg_2): '--properties-server-id "\\"080d4133-bdb5-40a0-96a0-71a6057bfe9a\\"" ' '--storage-sync-service-name "{SampleStorageSyncService_1}"', checks=[]) - test.cmd('az storagesync registered-server wait --created ' - '--resource-group "{rg_2}"', - checks=[]) # EXAMPLE: CloudEndpoints_Create @try_manual def step_cloudendpoints_create(test, rg, rg_2): test.cmd('az storagesync cloud-endpoint create ' - '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--name "{SampleCloudEndpoint_1}" ' '--azure-file-share-name "cvcloud-afscv-0719-058-a94a1354-a1fd-4e9a-9a50-919fad8c4ba4" ' '--friendly-name "ankushbsubscriptionmgmtmab" ' '--storage-account-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.S' @@ -95,7 +89,7 @@ def step_cloudendpoints_create(test, rg, rg_2): '--sync-group-name "{SampleSyncGroup_1}"', checks=[]) test.cmd('az storagesync cloud-endpoint wait --created ' - '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--name "{SampleCloudEndpoint_1}" ' '--resource-group "{rg_2}"', checks=[]) @@ -116,13 +110,13 @@ def step_serverendpoints_create(test, rg, rg_2): '--tier-files-older-than-days 0 ' '--volume-free-space-percent 100 ' '--resource-group "{rg_2}" ' - '--server-endpoint-name "{SampleServerEndpoint_1}" ' + '--name "{SampleServerEndpoint_1}" ' '--storage-sync-service-name "{SampleStorageSyncService_1}" ' '--sync-group-name "{SampleSyncGroup_1}"', checks=[]) test.cmd('az storagesync server-endpoint wait --created ' '--resource-group "{rg_2}" ' - '--server-endpoint-name "{SampleServerEndpoint_1}"', + '--name "{SampleServerEndpoint_1}"', checks=[]) @@ -131,7 +125,7 @@ def step_serverendpoints_create(test, rg, rg_2): def step_serverendpoints_get(test, rg, rg_2): test.cmd('az storagesync server-endpoint show ' '--resource-group "{rg_2}" ' - '--server-endpoint-name "{SampleServerEndpoint_1}" ' + '--name "{SampleServerEndpoint_1}" ' '--storage-sync-service-name "{SampleStorageSyncService_1}" ' '--sync-group-name "{SampleSyncGroup_1}"', checks=[]) @@ -141,7 +135,7 @@ def step_serverendpoints_get(test, rg, rg_2): @try_manual def step_cloudendpoints_get(test, rg, rg_2): test.cmd('az storagesync cloud-endpoint show ' - '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--name "{SampleCloudEndpoint_1}" ' '--resource-group "{rg_2}" ' '--storage-sync-service-name "{SampleStorageSyncService_1}" ' '--sync-group-name "{SampleSyncGroup_1}"', @@ -194,7 +188,7 @@ def step_syncgroups_get(test, rg, rg_2): test.cmd('az storagesync sync-group show ' '--resource-group "{rg_2}" ' '--storage-sync-service-name "{SampleStorageSyncService_1}" ' - '--sync-group-name "{SampleSyncGroup_1}"', + '--name "{SampleSyncGroup_1}"', checks=[]) @@ -240,7 +234,7 @@ def step_workflows_listbystoragesyncservice(test, rg, rg_2): def step_storagesyncservices_get(test, rg, rg_2): test.cmd('az storagesync storage-sync-service show ' '--resource-group "{rg_2}" ' - '--storage-sync-service-name "{SampleStorageSyncService_1}"', + '--name "{SampleStorageSyncService_1}"', checks=[]) @@ -255,7 +249,8 @@ def step_storagesyncservices_listbyresourcegroup(test, rg, rg_2): # EXAMPLE: StorageSyncServices_ListBySubscription @try_manual def step_storagesyncservices_listbysubscription(test, rg, rg_2): - test.cmd('az storagesync storage-sync-service list', + test.cmd('az storagesync storage-sync-service list ' + '-g ""', checks=[]) @@ -270,7 +265,7 @@ def step_operations_list(test, rg, rg_2): @try_manual def step_cloudendpoints_triggerchangedetection(test, rg, rg_2): test.cmd('az storagesync cloud-endpoint trigger-change-detection ' - '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--name "{SampleCloudEndpoint_1}" ' '--change-detection-mode "Recursive" ' '--directory-path "NewDirectory" ' '--resource-group "{rg_2}" ' @@ -283,7 +278,7 @@ def step_cloudendpoints_triggerchangedetection(test, rg, rg_2): @try_manual def step_cloudendpoints_restoreheartbeat(test, rg, rg_2): test.cmd('az storagesync cloud-endpoint restoreheartbeat ' - '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--name "{SampleCloudEndpoint_1}" ' '--resource-group "{rg_2}" ' '--storage-sync-service-name "{SampleStorageSyncService_1}" ' '--sync-group-name "{SampleSyncGroup_1}"', @@ -297,7 +292,7 @@ def step_serverendpoints_recallaction(test, rg, rg_2): '--pattern "" ' '--recall-path "" ' '--resource-group "{rg_2}" ' - '--server-endpoint-name "{SampleServerEndpoint_1}" ' + '--name "{SampleServerEndpoint_1}" ' '--storage-sync-service-name "{SampleStorageSyncService_1}" ' '--sync-group-name "{SampleSyncGroup_1}"', checks=[]) @@ -307,7 +302,7 @@ def step_serverendpoints_recallaction(test, rg, rg_2): @try_manual def step_cloudendpoints_postrestore(test, rg, rg_2): test.cmd('az storagesync cloud-endpoint post-restore ' - '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--name "{SampleCloudEndpoint_1}" ' '--azure-file-share-uri "https://hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare' '" ' '--restore-file-spec path="text1.txt" isdir=false ' @@ -327,7 +322,7 @@ def step_cloudendpoints_postrestore(test, rg, rg_2): @try_manual def step_cloudendpoints_prerestore(test, rg, rg_2): test.cmd('az storagesync cloud-endpoint pre-restore ' - '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--name "{SampleCloudEndpoint_1}" ' '--azure-file-share-uri "https://hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare' '" ' '--restore-file-spec path="text1.txt" isdir=false ' @@ -344,7 +339,7 @@ def step_cloudendpoints_prerestore(test, rg, rg_2): @try_manual def step_cloudendpoints_postbackup(test, rg, rg_2): test.cmd('az storagesync cloud-endpoint post-backup ' - '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--name "{SampleCloudEndpoint_1}" ' '--azure-file-share "https://sampleserver.file.core.test-cint.azure-test.net/sampleFileShare" ' '--resource-group "{rg_2}" ' '--storage-sync-service-name "{SampleStorageSyncService_1}" ' @@ -356,7 +351,7 @@ def step_cloudendpoints_postbackup(test, rg, rg_2): @try_manual def step_cloudendpoints_prebackup(test, rg, rg_2): test.cmd('az storagesync cloud-endpoint pre-backup ' - '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--name "{SampleCloudEndpoint_1}" ' '--azure-file-share "https://sampleserver.file.core.test-cint.azure-test.net/sampleFileShare" ' '--resource-group "{rg_2}" ' '--storage-sync-service-name "{SampleStorageSyncService_1}" ' @@ -374,7 +369,7 @@ def step_serverendpoints_update(test, rg, rg_2): '--tier-files-older-than-days 0 ' '--volume-free-space-percent 100 ' '--resource-group "{rg_2}" ' - '--server-endpoint-name "{SampleServerEndpoint_1}" ' + '--name "{SampleServerEndpoint_1}" ' '--storage-sync-service-name "{SampleStorageSyncService_1}" ' '--sync-group-name "{SampleSyncGroup_1}"', checks=[]) @@ -418,7 +413,7 @@ def step_storagesyncservices_update(test, rg, rg_2): '--incoming-traffic-policy "AllowAllTraffic" ' '--tags Dept="IT" Environment="Test" ' '--resource-group "{rg_2}" ' - '--storage-sync-service-name "{SampleStorageSyncService_1}"', + '--name "{SampleStorageSyncService_1}"', checks=[]) @@ -441,7 +436,7 @@ def step_storagesyncservicechecknameavailability_available(test, rg, rg_2): def step_serverendpoints_delete(test, rg, rg_2): test.cmd('az storagesync server-endpoint delete ' '--resource-group "{rg_2}" ' - '--server-endpoint-name "{SampleServerEndpoint_1}" ' + '--name "{SampleServerEndpoint_1}" ' '--storage-sync-service-name "{SampleStorageSyncService_1}" ' '--sync-group-name "{SampleSyncGroup_1}"', checks=[]) @@ -451,7 +446,7 @@ def step_serverendpoints_delete(test, rg, rg_2): @try_manual def step_cloudendpoints_delete(test, rg, rg_2): test.cmd('az storagesync cloud-endpoint delete ' - '--cloud-endpoint-name "{SampleCloudEndpoint_1}" ' + '--name "{SampleCloudEndpoint_1}" ' '--resource-group "{rg_2}" ' '--storage-sync-service-name "{SampleStorageSyncService_1}" ' '--sync-group-name "{SampleSyncGroup_1}"', @@ -474,7 +469,7 @@ def step_syncgroups_delete(test, rg, rg_2): test.cmd('az storagesync sync-group delete ' '--resource-group "{rg_2}" ' '--storage-sync-service-name "{SampleStorageSyncService_1}" ' - '--sync-group-name "{SampleSyncGroup_1}"', + '--name "{SampleSyncGroup_1}"', checks=[]) @@ -483,7 +478,7 @@ def step_syncgroups_delete(test, rg, rg_2): def step_storagesyncservices_delete(test, rg, rg_2): test.cmd('az storagesync storage-sync-service delete ' '--resource-group "{rg_2}" ' - '--storage-sync-service-name "{SampleStorageSyncService_1}"', + '--name "{SampleStorageSyncService_1}"', checks=[]) @@ -559,3 +554,4 @@ def test_storagesync(self, rg, rg_2): }) call_scenario(self, rg, rg_2) + raise_if() diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/__init__.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/__init__.py index 27e3c05ceb4..42bfda8fd9d 100644 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/__init__.py +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/__init__.py @@ -7,13 +7,10 @@ # -------------------------------------------------------------------------- from ._microsoft_storage_sync import MicrosoftStorageSync -from ._version import VERSION - -__version__ = VERSION __all__ = ['MicrosoftStorageSync'] try: - from .patch import patch_sdk + from ._patch import patch_sdk patch_sdk() except ImportError: pass diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_configuration.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_configuration.py index ee89c81292f..cd5c1312fd6 100644 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_configuration.py +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_configuration.py @@ -11,14 +11,13 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential +VERSION = "unknown" class MicrosoftStorageSyncConfiguration(Configuration): """Configuration for MicrosoftStorageSync. @@ -49,7 +48,8 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2020-03-01" self.credential_scopes = ['https://management.azure.com/.default'] - kwargs.setdefault('sdk_moniker', 'mgmt-storagesync/{}'.format(VERSION)) + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + kwargs.setdefault('sdk_moniker', 'microsoftstoragesync/{}'.format(VERSION)) self._configure(**kwargs) def _configure( 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 index fc86b5f06cf..7256b8b4e0b 100644 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_microsoft_storage_sync.py +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_microsoft_storage_sync.py @@ -15,6 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from typing import Any, Optional + from azure.core.credentials import TokenCredential + from ._configuration import MicrosoftStorageSyncConfiguration from .operations import OperationOperations from .operations import StorageSyncServiceOperations @@ -33,30 +35,31 @@ class MicrosoftStorageSync(object): """Microsoft Storage Sync Service API. :ivar operation: OperationOperations operations - :vartype operation: azure.mgmt.storagesync.operations.OperationOperations + :vartype operation: microsoft_storage_sync.operations.OperationOperations :ivar storage_sync_service: StorageSyncServiceOperations operations - :vartype storage_sync_service: azure.mgmt.storagesync.operations.StorageSyncServiceOperations + :vartype storage_sync_service: microsoft_storage_sync.operations.StorageSyncServiceOperations :ivar private_link_resource: PrivateLinkResourceOperations operations - :vartype private_link_resource: azure.mgmt.storagesync.operations.PrivateLinkResourceOperations + :vartype private_link_resource: microsoft_storage_sync.operations.PrivateLinkResourceOperations :ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations - :vartype private_endpoint_connection: azure.mgmt.storagesync.operations.PrivateEndpointConnectionOperations + :vartype private_endpoint_connection: microsoft_storage_sync.operations.PrivateEndpointConnectionOperations :ivar sync_group: SyncGroupOperations operations - :vartype sync_group: azure.mgmt.storagesync.operations.SyncGroupOperations + :vartype sync_group: microsoft_storage_sync.operations.SyncGroupOperations :ivar cloud_endpoint: CloudEndpointOperations operations - :vartype cloud_endpoint: azure.mgmt.storagesync.operations.CloudEndpointOperations + :vartype cloud_endpoint: microsoft_storage_sync.operations.CloudEndpointOperations :ivar server_endpoint: ServerEndpointOperations operations - :vartype server_endpoint: azure.mgmt.storagesync.operations.ServerEndpointOperations + :vartype server_endpoint: microsoft_storage_sync.operations.ServerEndpointOperations :ivar registered_server: RegisteredServerOperations operations - :vartype registered_server: azure.mgmt.storagesync.operations.RegisteredServerOperations + :vartype registered_server: microsoft_storage_sync.operations.RegisteredServerOperations :ivar workflow: WorkflowOperations operations - :vartype workflow: azure.mgmt.storagesync.operations.WorkflowOperations + :vartype workflow: microsoft_storage_sync.operations.WorkflowOperations :ivar operation_status: OperationStatusOperations operations - :vartype operation_status: azure.mgmt.storagesync.operations.OperationStatusOperations + :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_version.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_version.py deleted file mode 100644 index c47f66669f1..00000000000 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "1.0.0" 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 index 22bea5fa760..885cfaaec93 100644 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/_configuration_async.py +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/_configuration_async.py @@ -11,12 +11,11 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential + from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class MicrosoftStorageSyncConfiguration(Configuration): """Configuration for MicrosoftStorageSync. @@ -46,7 +45,8 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2020-03-01" self.credential_scopes = ['https://management.azure.com/.default'] - kwargs.setdefault('sdk_moniker', 'mgmt-storagesync/{}'.format(VERSION)) + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + kwargs.setdefault('sdk_moniker', 'microsoftstoragesync/{}'.format(VERSION)) self._configure(**kwargs) def _configure( 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 index b4be097511c..4a78a3276de 100644 --- 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 @@ -6,11 +6,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional +from typing import Any, Optional, TYPE_CHECKING from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + from ._configuration_async import MicrosoftStorageSyncConfiguration from .operations_async import OperationOperations from .operations_async import StorageSyncServiceOperations @@ -29,30 +33,31 @@ class MicrosoftStorageSync(object): """Microsoft Storage Sync Service API. :ivar operation: OperationOperations operations - :vartype operation: azure.mgmt.storagesync.aio.operations_async.OperationOperations + :vartype operation: microsoft_storage_sync.aio.operations_async.OperationOperations :ivar storage_sync_service: StorageSyncServiceOperations operations - :vartype storage_sync_service: azure.mgmt.storagesync.aio.operations_async.StorageSyncServiceOperations + :vartype storage_sync_service: microsoft_storage_sync.aio.operations_async.StorageSyncServiceOperations :ivar private_link_resource: PrivateLinkResourceOperations operations - :vartype private_link_resource: azure.mgmt.storagesync.aio.operations_async.PrivateLinkResourceOperations + :vartype private_link_resource: microsoft_storage_sync.aio.operations_async.PrivateLinkResourceOperations :ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations - :vartype private_endpoint_connection: azure.mgmt.storagesync.aio.operations_async.PrivateEndpointConnectionOperations + :vartype private_endpoint_connection: microsoft_storage_sync.aio.operations_async.PrivateEndpointConnectionOperations :ivar sync_group: SyncGroupOperations operations - :vartype sync_group: azure.mgmt.storagesync.aio.operations_async.SyncGroupOperations + :vartype sync_group: microsoft_storage_sync.aio.operations_async.SyncGroupOperations :ivar cloud_endpoint: CloudEndpointOperations operations - :vartype cloud_endpoint: azure.mgmt.storagesync.aio.operations_async.CloudEndpointOperations + :vartype cloud_endpoint: microsoft_storage_sync.aio.operations_async.CloudEndpointOperations :ivar server_endpoint: ServerEndpointOperations operations - :vartype server_endpoint: azure.mgmt.storagesync.aio.operations_async.ServerEndpointOperations + :vartype server_endpoint: microsoft_storage_sync.aio.operations_async.ServerEndpointOperations :ivar registered_server: RegisteredServerOperations operations - :vartype registered_server: azure.mgmt.storagesync.aio.operations_async.RegisteredServerOperations + :vartype registered_server: microsoft_storage_sync.aio.operations_async.RegisteredServerOperations :ivar workflow: WorkflowOperations operations - :vartype workflow: azure.mgmt.storagesync.aio.operations_async.WorkflowOperations + :vartype workflow: microsoft_storage_sync.aio.operations_async.WorkflowOperations :ivar operation_status: OperationStatusOperations operations - :vartype operation_status: azure.mgmt.storagesync.aio.operations_async.OperationStatusOperations + :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_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( 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 index dcfdd2b6f44..289669978a0 100644 --- 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 @@ -5,7 +5,7 @@ # 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, List, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -28,7 +28,7 @@ class CloudEndpointOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -56,14 +56,15 @@ async def _create_initial( **kwargs ) -> "models.CloudEndpoint": cls = kwargs.pop('cls', None) # type: ClsType["models.CloudEndpoint"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.CloudEndpointCreateParameters(storage_account_resource_id=storage_account_resource_id, azure_file_share_name=azure_file_share_name, storage_account_tenant_id=storage_account_tenant_id, friendly_name=friendly_name) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -111,10 +112,10 @@ async def _create_initial( 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 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}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} # type: ignore async def create( self, @@ -150,13 +151,17 @@ async def create( :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[~azure.mgmt.storagesync.models.CloudEndpoint] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: CloudEndpoint, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.CloudEndpoint :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.CloudEndpoint"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._create_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -170,6 +175,9 @@ async def create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response @@ -181,15 +189,11 @@ def get_long_running_output(pipeline_response): 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}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} # type: ignore async def get( self, @@ -210,16 +214,17 @@ async def get( :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: ~azure.mgmt.storagesync.models.CloudEndpoint + :return: CloudEndpoint, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.CloudEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CloudEndpoint"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -253,10 +258,10 @@ async def get( deserialized = self._deserialize('CloudEndpoint', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + 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}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} # type: ignore async def _delete_initial( self, @@ -267,11 +272,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -311,9 +317,9 @@ async def _delete_initial( 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) + return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} # type: ignore async def delete( self, @@ -337,13 +343,17 @@ async def delete( :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] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -353,19 +363,18 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} # type: ignore def list_by_sync_group( self, @@ -373,7 +382,7 @@ def list_by_sync_group( storage_sync_service_name: str, sync_group_name: str, **kwargs - ) -> "models.CloudEndpointArray": + ) -> AsyncIterable["models.CloudEndpointArray"]: """Get a CloudEndpoint List. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -383,18 +392,19 @@ def list_by_sync_group( :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: ~azure.mgmt.storagesync.models.CloudEndpointArray + :return: An iterator like instance of either CloudEndpointArray or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_storage_sync.models.CloudEndpointArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CloudEndpointArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_sync_group.metadata['url'] + url = self.list_by_sync_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -402,13 +412,13 @@ def prepare_request(next_link=None): 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -440,7 +450,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_sync_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints'} + list_by_sync_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints'} # type: ignore async def _pre_backup_initial( self, @@ -452,14 +462,15 @@ async def _pre_backup_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.BackupRequest(azure_file_share=azure_file_share) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._pre_backup_initial.metadata['url'] + url = self._pre_backup_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -503,9 +514,9 @@ async def _pre_backup_initial( 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) + 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'} + _pre_backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup'} # type: ignore async def pre_backup( self, @@ -532,13 +543,17 @@ async def pre_backup( :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] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._pre_backup_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -549,19 +564,18 @@ async def pre_backup( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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'} + pre_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup'} # type: ignore async def _post_backup_initial( self, @@ -573,14 +587,15 @@ async def _post_backup_initial( **kwargs ) -> "models.PostBackupResponse": cls = kwargs.pop('cls', None) # type: ClsType["models.PostBackupResponse"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.BackupRequest(azure_file_share=azure_file_share) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._post_backup_initial.metadata['url'] + url = self._post_backup_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -627,10 +642,10 @@ async def _post_backup_initial( 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 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'} + _post_backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup'} # type: ignore async def post_backup( self, @@ -657,13 +672,17 @@ async def post_backup( :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[~azure.mgmt.storagesync.models.PostBackupResponse] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: PostBackupResponse, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.PostBackupResponse :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.PostBackupResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._post_backup_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -674,6 +693,9 @@ async def post_backup( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response @@ -686,15 +708,11 @@ def get_long_running_output(pipeline_response): 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'} + post_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup'} # type: ignore async def _pre_restore_initial( self, @@ -709,19 +727,20 @@ async def _pre_restore_initial( 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, + restore_file_spec: Optional[List["models.RestoreFileSpec"]] = None, pause_wait_for_sync_drain_time_period_in_seconds: Optional[int] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.PreRestoreRequest(partition=partition, replica_group=replica_group, request_id=request_id_parameter, azure_file_share_uri=azure_file_share_uri, status=status, source_azure_file_share_uri=source_azure_file_share_uri, backup_metadata_property_bag=backup_metadata_property_bag, restore_file_spec=restore_file_spec, pause_wait_for_sync_drain_time_period_in_seconds=pause_wait_for_sync_drain_time_period_in_seconds) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._pre_restore_initial.metadata['url'] + url = self._pre_restore_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -760,9 +779,9 @@ async def _pre_restore_initial( 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) + 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'} + _pre_restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore'} # type: ignore async def pre_restore( self, @@ -777,7 +796,7 @@ async def pre_restore( 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, + restore_file_spec: Optional[List["models.RestoreFileSpec"]] = None, pause_wait_for_sync_drain_time_period_in_seconds: Optional[int] = None, **kwargs ) -> None: @@ -806,7 +825,7 @@ async def pre_restore( :param backup_metadata_property_bag: Pre Restore backup metadata property bag. :type backup_metadata_property_bag: str :param restore_file_spec: Pre Restore restore file spec array. - :type restore_file_spec: list[~azure.mgmt.storagesync.models.RestoreFileSpec] + :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 @@ -814,13 +833,17 @@ async def pre_restore( :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] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._pre_restore_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -839,19 +862,18 @@ async def pre_restore( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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'} + pre_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore'} # type: ignore async def restoreheartbeat( self, @@ -872,16 +894,17 @@ async def restoreheartbeat( :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) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.restoreheartbeat.metadata['url'] + url = self.restoreheartbeat.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -913,9 +936,9 @@ async def restoreheartbeat( 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) + return cls(pipeline_response, None, response_headers) - restoreheartbeat.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/restoreheartbeat'} + restoreheartbeat.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/restoreheartbeat'} # type: ignore async def _post_restore_initial( self, @@ -930,18 +953,19 @@ async def _post_restore_initial( 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, + restore_file_spec: Optional[List["models.RestoreFileSpec"]] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.PostRestoreRequest(partition=partition, replica_group=replica_group, request_id=request_id_parameter, azure_file_share_uri=azure_file_share_uri, status=status, source_azure_file_share_uri=source_azure_file_share_uri, failed_file_list=failed_file_list, restore_file_spec=restore_file_spec) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._post_restore_initial.metadata['url'] + url = self._post_restore_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -980,9 +1004,9 @@ async def _post_restore_initial( 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) + 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'} + _post_restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore'} # type: ignore async def post_restore( self, @@ -997,7 +1021,7 @@ async def post_restore( 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, + restore_file_spec: Optional[List["models.RestoreFileSpec"]] = None, **kwargs ) -> None: """Post Restore a given CloudEndpoint. @@ -1025,18 +1049,22 @@ async def post_restore( :param failed_file_list: Post Restore Azure failed file list. :type failed_file_list: str :param restore_file_spec: Post Restore restore file spec array. - :type restore_file_spec: list[~azure.mgmt.storagesync.models.RestoreFileSpec] + :type restore_file_spec: list[~microsoft_storage_sync.models.RestoreFileSpec] :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] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._post_restore_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -1054,19 +1082,18 @@ async def post_restore( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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'} + post_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore'} # type: ignore async def _trigger_change_detection_initial( self, @@ -1080,14 +1107,15 @@ async def _trigger_change_detection_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.TriggerChangeDetectionParameters(directory_path=directory_path, change_detection_mode=change_detection_mode, paths=paths) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._trigger_change_detection_initial.metadata['url'] + url = self._trigger_change_detection_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -1126,9 +1154,9 @@ async def _trigger_change_detection_initial( 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) + 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'} + _trigger_change_detection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/triggerChangeDetection'} # type: ignore async def trigger_change_detection( self, @@ -1156,7 +1184,7 @@ async def trigger_change_detection( :type directory_path: str :param change_detection_mode: Change Detection Mode. Applies to a directory specified in directoryPath parameter. - :type change_detection_mode: str or ~azure.mgmt.storagesync.models.ChangeDetectionMode + :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] @@ -1164,13 +1192,17 @@ async def trigger_change_detection( :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] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._trigger_change_detection_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -1183,16 +1215,15 @@ async def trigger_change_detection( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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'} + trigger_change_detection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/triggerChangeDetection'} # type: ignore 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 index 7ce840e180d..29de86da8ff 100644 --- 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 @@ -5,7 +5,7 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -26,7 +26,7 @@ class OperationOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -44,29 +44,30 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> "models.OperationEntityListResult": + ) -> AsyncIterable["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: ~azure.mgmt.storagesync.models.OperationEntityListResult + :return: An iterator like instance of either OperationEntityListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_storage_sync.models.OperationEntityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationEntityListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -98,4 +99,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.StorageSync/operations'} + list.metadata = {'url': '/providers/Microsoft.StorageSync/operations'} # type: ignore 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 index 7809b773abb..60b4b4864bf 100644 --- 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 @@ -25,7 +25,7 @@ class OperationStatusOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,16 +59,17 @@ async def get( :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: ~azure.mgmt.storagesync.models.OperationStatus + :return: OperationStatus, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.OperationStatus :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatus"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -102,7 +103,7 @@ async def get( deserialized = self._deserialize('OperationStatus', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + 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}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/locations/{locationName}/workflows/{workflowId}/operations/{operationId}'} # type: ignore diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_private_endpoint_connection_operations_async.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_private_endpoint_connection_operations_async.py index c8d4486f502..83349cf32af 100644 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_private_endpoint_connection_operations_async.py +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_private_endpoint_connection_operations_async.py @@ -5,7 +5,7 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -28,7 +28,7 @@ class PrivateEndpointConnectionOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,16 +61,17 @@ async def get( with the Azure resource. :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.storagesync.models.PrivateEndpointConnection + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), @@ -100,10 +101,10 @@ async def get( deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore async def _create_initial( self, @@ -115,14 +116,15 @@ async def _create_initial( **kwargs ) -> "models.PrivateEndpointConnection": cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _properties = models.PrivateEndpointConnection(private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), @@ -167,10 +169,10 @@ async def _create_initial( 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 cls(pipeline_response, deserialized, response_headers) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore async def create( self, @@ -192,21 +194,25 @@ async def create( with the Azure resource. :type private_endpoint_connection_name: str :param private_endpoint: The resource of private end point. - :type private_endpoint: ~azure.mgmt.storagesync.models.PrivateEndpoint + :type private_endpoint: ~microsoft_storage_sync.models.PrivateEndpoint :param private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. - :type private_link_service_connection_state: ~azure.mgmt.storagesync.models.PrivateLinkServiceConnectionState + :type private_link_service_connection_state: ~microsoft_storage_sync.models.PrivateLinkServiceConnectionState :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 PrivateEndpointConnection - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storagesync.models.PrivateEndpointConnection] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._create_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -217,6 +223,9 @@ async def create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -224,15 +233,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) 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}/privateEndpointConnections/{privateEndpointConnectionName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore async def _delete_initial( self, @@ -242,11 +247,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), @@ -281,9 +287,9 @@ async def _delete_initial( 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) + return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore async def delete( self, @@ -306,13 +312,17 @@ async def delete( :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] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -321,26 +331,25 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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}/privateEndpointConnections/{privateEndpointConnectionName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore def list_by_storage_sync_service( self, resource_group_name: str, storage_sync_service_name: str, **kwargs - ) -> "models.PrivateEndpointConnectionListResult": + ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: """Get a PrivateEndpointConnection List. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -348,31 +357,32 @@ def list_by_storage_sync_service( :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: PrivateEndpointConnectionListResult or the result of cls(response) - :rtype: ~azure.mgmt.storagesync.models.PrivateEndpointConnectionListResult + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_storage_sync.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_storage_sync_service.metadata['url'] + url = self.list_by_storage_sync_service.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -404,4 +414,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections'} + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections'} # type: ignore diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_private_link_resource_operations_async.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_private_link_resource_operations_async.py index 2131fb824e9..baf24f6c0d2 100644 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_private_link_resource_operations_async.py +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/aio/operations_async/_private_link_resource_operations_async.py @@ -25,7 +25,7 @@ class PrivateLinkResourceOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -54,16 +54,17 @@ async def list_by_storage_sync_service( specified resource group. :type storage_sync_service_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkResourceListResult or the result of cls(response) - :rtype: ~azure.mgmt.storagesync.models.PrivateLinkResourceListResult + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.list_by_storage_sync_service.metadata['url'] + url = self.list_by_storage_sync_service.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), @@ -91,7 +92,7 @@ async def list_by_storage_sync_service( deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateLinkResources'} + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateLinkResources'} # type: ignore 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 index ecfafeb8aa7..0a87aa96759 100644 --- 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 @@ -5,7 +5,7 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -28,7 +28,7 @@ class RegisteredServerOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -48,7 +48,7 @@ def list_by_storage_sync_service( resource_group_name: str, storage_sync_service_name: str, **kwargs - ) -> "models.RegisteredServerArray": + ) -> AsyncIterable["models.RegisteredServerArray"]: """Get a given registered server list. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -56,31 +56,32 @@ def list_by_storage_sync_service( :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: ~azure.mgmt.storagesync.models.RegisteredServerArray + :return: An iterator like instance of either RegisteredServerArray or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_storage_sync.models.RegisteredServerArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RegisteredServerArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_storage_sync_service.metadata['url'] + url = self.list_by_storage_sync_service.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -112,7 +113,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers'} + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers'} # type: ignore async def get( self, @@ -130,16 +131,17 @@ async def get( :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: ~azure.mgmt.storagesync.models.RegisteredServer + :return: RegisteredServer, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.RegisteredServer :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RegisteredServer"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -172,10 +174,10 @@ async def get( deserialized = self._deserialize('RegisteredServer', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} # type: ignore async def _create_initial( self, @@ -194,14 +196,15 @@ async def _create_initial( **kwargs ) -> "models.RegisteredServer": cls = kwargs.pop('cls', None) # type: ClsType["models.RegisteredServer"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.RegisteredServerCreateParameters(server_certificate=server_certificate, agent_version=agent_version, server_os_version=server_os_version, last_heart_beat=last_heart_beat, server_role=server_role, cluster_id=cluster_id, cluster_name=cluster_name, server_id=registered_server_create_parameters_properties_server_id, friendly_name=friendly_name) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -247,10 +250,10 @@ async def _create_initial( 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 cls(pipeline_response, deserialized, response_headers) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} # type: ignore async def create( self, @@ -298,13 +301,17 @@ async def create( :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[~azure.mgmt.storagesync.models.RegisteredServer] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: RegisteredServer, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.RegisteredServer :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.RegisteredServer"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._create_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -322,6 +329,9 @@ async def create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response @@ -333,15 +343,11 @@ def get_long_running_output(pipeline_response): 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}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} # type: ignore async def _delete_initial( self, @@ -351,11 +357,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -392,9 +399,9 @@ async def _delete_initial( 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) + return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} # type: ignore async def delete( self, @@ -415,13 +422,17 @@ async def delete( :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] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -430,19 +441,18 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} # type: ignore async def _trigger_rollover_initial( self, @@ -453,14 +463,15 @@ async def _trigger_rollover_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.TriggerRolloverRequest(server_certificate=server_certificate) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._trigger_rollover_initial.metadata['url'] + url = self._trigger_rollover_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -502,9 +513,9 @@ async def _trigger_rollover_initial( 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) + return cls(pipeline_response, None, response_headers) - _trigger_rollover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover'} + _trigger_rollover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover'} # type: ignore async def trigger_rollover( self, @@ -528,13 +539,17 @@ async def trigger_rollover( :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] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._trigger_rollover_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -544,16 +559,15 @@ async def trigger_rollover( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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'} + trigger_rollover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover'} # type: ignore 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 index 152121fa248..ef9b6342e8b 100644 --- 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 @@ -5,7 +5,7 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -28,7 +28,7 @@ class ServerEndpointOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,14 +62,15 @@ async def _create_initial( **kwargs ) -> "models.ServerEndpoint": cls = kwargs.pop('cls', None) # type: ClsType["models.ServerEndpoint"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.ServerEndpointCreateParameters(server_local_path=server_local_path, cloud_tiering=cloud_tiering, volume_free_space_percent=volume_free_space_percent, tier_files_older_than_days=tier_files_older_than_days, friendly_name=friendly_name, server_resource_id=server_resource_id, offline_data_transfer=offline_data_transfer, offline_data_transfer_share_name=offline_data_transfer_share_name, initial_download_policy=initial_download_policy, local_cache_mode=local_cache_mode) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -116,10 +117,10 @@ async def _create_initial( 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 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}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore async def create( self, @@ -152,7 +153,7 @@ async def create( :param server_local_path: Server Local path. :type server_local_path: str :param cloud_tiering: Cloud Tiering. - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 @@ -163,25 +164,29 @@ async def create( :param server_resource_id: Server Resource Id. :type server_resource_id: str :param offline_data_transfer: Offline data transfer. - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 :param initial_download_policy: Policy for how namespace and files are recalled during FastDr. - :type initial_download_policy: str or ~azure.mgmt.storagesync.models.InitialDownloadPolicy + :type initial_download_policy: str or ~microsoft_storage_sync.models.InitialDownloadPolicy :param local_cache_mode: Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. - :type local_cache_mode: str or ~azure.mgmt.storagesync.models.LocalCacheMode + :type local_cache_mode: str or ~microsoft_storage_sync.models.LocalCacheMode :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[~azure.mgmt.storagesync.models.ServerEndpoint] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: ServerEndpoint, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.ServerEndpoint :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.ServerEndpoint"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._create_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -201,6 +206,9 @@ async def create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response @@ -212,15 +220,11 @@ def get_long_running_output(pipeline_response): 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}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore async def _update_initial( self, @@ -237,14 +241,15 @@ async def _update_initial( **kwargs ) -> "models.ServerEndpoint": cls = kwargs.pop('cls', None) # type: ClsType["models.ServerEndpoint"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.ServerEndpointUpdateParameters(cloud_tiering=cloud_tiering, volume_free_space_percent=volume_free_space_percent, tier_files_older_than_days=tier_files_older_than_days, offline_data_transfer=offline_data_transfer, offline_data_transfer_share_name=offline_data_transfer_share_name, local_cache_mode=local_cache_mode) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._update_initial.metadata['url'] + url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -294,10 +299,10 @@ async def _update_initial( 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 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}'} + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore async def update( self, @@ -324,30 +329,34 @@ async def update( :param server_endpoint_name: Name of Server Endpoint object. :type server_endpoint_name: str :param cloud_tiering: Cloud Tiering. - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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: Offline data transfer. - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 :param local_cache_mode: Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. - :type local_cache_mode: str or ~azure.mgmt.storagesync.models.LocalCacheMode + :type local_cache_mode: str or ~microsoft_storage_sync.models.LocalCacheMode :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[~azure.mgmt.storagesync.models.ServerEndpoint] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: ServerEndpoint, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.ServerEndpoint :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.ServerEndpoint"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._update_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -363,6 +372,9 @@ async def update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response @@ -374,15 +386,11 @@ def get_long_running_output(pipeline_response): 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}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore async def get( self, @@ -403,16 +411,17 @@ async def get( :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: ~azure.mgmt.storagesync.models.ServerEndpoint + :return: ServerEndpoint, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.ServerEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServerEndpoint"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -446,10 +455,10 @@ async def get( deserialized = self._deserialize('ServerEndpoint', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + 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}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore async def _delete_initial( self, @@ -460,11 +469,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -502,9 +512,9 @@ async def _delete_initial( 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) + return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore async def delete( self, @@ -528,13 +538,17 @@ async def delete( :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] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -544,19 +558,18 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore def list_by_sync_group( self, @@ -564,7 +577,7 @@ def list_by_sync_group( storage_sync_service_name: str, sync_group_name: str, **kwargs - ) -> "models.ServerEndpointArray": + ) -> AsyncIterable["models.ServerEndpointArray"]: """Get a ServerEndpoint list. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -574,18 +587,19 @@ def list_by_sync_group( :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: ~azure.mgmt.storagesync.models.ServerEndpointArray + :return: An iterator like instance of either ServerEndpointArray or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_storage_sync.models.ServerEndpointArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServerEndpointArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_sync_group.metadata['url'] + url = self.list_by_sync_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -593,13 +607,13 @@ def prepare_request(next_link=None): 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -631,7 +645,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_sync_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints'} + list_by_sync_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints'} # type: ignore async def _recall_action_initial( self, @@ -644,14 +658,15 @@ async def _recall_action_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.RecallActionParameters(pattern=pattern, recall_path=recall_path) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._recall_action_initial.metadata['url'] + url = self._recall_action_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -694,9 +709,9 @@ async def _recall_action_initial( 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) + 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'} + _recall_action_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction'} # type: ignore async def recall_action( self, @@ -726,13 +741,17 @@ async def recall_action( :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] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._recall_action_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -744,16 +763,15 @@ async def recall_action( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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'} + recall_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction'} # type: ignore 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 index 40f3653d024..2b973aa08b0 100644 --- 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 @@ -5,7 +5,7 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -28,7 +28,7 @@ class StorageSyncServiceOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -56,19 +56,20 @@ async def check_name_availability( :param name: The name to check for availability. :type name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.storagesync.models.CheckNameAvailabilityResult + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.CheckNameAvailabilityParameters(name=name) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_name_availability.metadata['url'] + url = self.check_name_availability.metadata['url'] # type: ignore 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), @@ -100,10 +101,10 @@ async def check_name_availability( deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/checkNameAvailability'} + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/checkNameAvailability'} # type: ignore async def _create_initial( self, @@ -115,14 +116,15 @@ async def _create_initial( **kwargs ) -> "models.StorageSyncService": cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncService"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.StorageSyncServiceCreateParameters(location=location, tags=tags, incoming_traffic_policy=incoming_traffic_policy) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -166,10 +168,10 @@ async def _create_initial( 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 cls(pipeline_response, deserialized, response_headers) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore async def create( self, @@ -197,18 +199,22 @@ async def create( characters and a value with a length no greater than 256 characters. :type tags: dict[str, str] :param incoming_traffic_policy: Incoming Traffic Policy. - :type incoming_traffic_policy: str or ~azure.mgmt.storagesync.models.IncomingTrafficPolicy + :type incoming_traffic_policy: str or ~microsoft_storage_sync.models.IncomingTrafficPolicy :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 StorageSyncService - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storagesync.models.StorageSyncService] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: StorageSyncService, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncService :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncService"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._create_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -219,6 +225,9 @@ async def create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('StorageSyncService', pipeline_response) @@ -226,15 +235,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) 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}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore async def get( self, @@ -249,16 +254,17 @@ async def get( :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: ~azure.mgmt.storagesync.models.StorageSyncService + :return: StorageSyncService, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncService :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncService"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -290,10 +296,10 @@ async def get( deserialized = self._deserialize('StorageSyncService', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore async def _update_initial( self, @@ -304,14 +310,15 @@ async def _update_initial( **kwargs ) -> "models.StorageSyncService": cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncService"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.StorageSyncServiceUpdateParameters(tags=tags, incoming_traffic_policy=incoming_traffic_policy) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._update_initial.metadata['url'] + url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -360,10 +367,10 @@ async def _update_initial( 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 cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore async def update( self, @@ -382,18 +389,22 @@ async def update( :param tags: The user-specified tags associated with the storage sync service. :type tags: dict[str, str] :param incoming_traffic_policy: Incoming Traffic Policy. - :type incoming_traffic_policy: str or ~azure.mgmt.storagesync.models.IncomingTrafficPolicy + :type incoming_traffic_policy: str or ~microsoft_storage_sync.models.IncomingTrafficPolicy :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 StorageSyncService - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storagesync.models.StorageSyncService] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: StorageSyncService, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncService :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncService"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._update_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -403,6 +414,9 @@ async def update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response @@ -414,15 +428,11 @@ def get_long_running_output(pipeline_response): 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}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore async def _delete_initial( self, @@ -431,11 +441,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -473,9 +484,9 @@ async def _delete_initial( 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) + return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore async def delete( self, @@ -493,13 +504,17 @@ async def delete( :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] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -507,54 +522,54 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.StorageSyncServiceArray": + ) -> AsyncIterable["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: ~azure.mgmt.storagesync.models.StorageSyncServiceArray + :return: An iterator like instance of either StorageSyncServiceArray or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_storage_sync.models.StorageSyncServiceArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncServiceArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_resource_group.metadata['url'] + url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -586,38 +601,39 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices'} + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices'} # type: ignore def list_by_subscription( self, **kwargs - ) -> "models.StorageSyncServiceArray": + ) -> AsyncIterable["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: ~azure.mgmt.storagesync.models.StorageSyncServiceArray + :return: An iterator like instance of either StorageSyncServiceArray or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_storage_sync.models.StorageSyncServiceArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncServiceArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_subscription.metadata['url'] + url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -649,4 +665,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/storageSyncServices'} + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/storageSyncServices'} # type: ignore 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 index 697c8e6eb38..6268506c2f3 100644 --- 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 @@ -5,7 +5,7 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -26,7 +26,7 @@ class SyncGroupOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -46,7 +46,7 @@ def list_by_storage_sync_service( resource_group_name: str, storage_sync_service_name: str, **kwargs - ) -> "models.SyncGroupArray": + ) -> AsyncIterable["models.SyncGroupArray"]: """Get a SyncGroup List. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -54,31 +54,32 @@ def list_by_storage_sync_service( :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: ~azure.mgmt.storagesync.models.SyncGroupArray + :return: An iterator like instance of either SyncGroupArray or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_storage_sync.models.SyncGroupArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SyncGroupArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_storage_sync_service.metadata['url'] + url = self.list_by_storage_sync_service.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -110,7 +111,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups'} + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups'} # type: ignore async def create( self, @@ -131,19 +132,20 @@ async def create( :param properties: The parameters used to create the sync group. :type properties: object :keyword callable cls: A custom type or function that will be passed the direct response - :return: SyncGroup or the result of cls(response) - :rtype: ~azure.mgmt.storagesync.models.SyncGroup + :return: SyncGroup, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.SyncGroup :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SyncGroup"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.SyncGroupCreateParameters(properties=properties) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self.create.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -181,10 +183,10 @@ async def create( deserialized = self._deserialize('SyncGroup', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} # type: ignore async def get( self, @@ -202,16 +204,17 @@ async def get( :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: ~azure.mgmt.storagesync.models.SyncGroup + :return: SyncGroup, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.SyncGroup :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SyncGroup"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -244,10 +247,10 @@ async def get( deserialized = self._deserialize('SyncGroup', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} # type: ignore async def delete( self, @@ -265,16 +268,17 @@ async def delete( :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) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.delete.metadata['url'] + url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -306,6 +310,6 @@ async def delete( 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) + return cls(pipeline_response, None, response_headers) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} # type: ignore 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 index 822aaefa445..33f307c114f 100644 --- 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 @@ -5,7 +5,7 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -26,7 +26,7 @@ class WorkflowOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -46,7 +46,7 @@ def list_by_storage_sync_service( resource_group_name: str, storage_sync_service_name: str, **kwargs - ) -> "models.WorkflowArray": + ) -> AsyncIterable["models.WorkflowArray"]: """Get a Workflow List. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -54,31 +54,32 @@ def list_by_storage_sync_service( :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: ~azure.mgmt.storagesync.models.WorkflowArray + :return: An iterator like instance of either WorkflowArray or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_storage_sync.models.WorkflowArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_storage_sync_service.metadata['url'] + url = self.list_by_storage_sync_service.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -110,7 +111,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows'} + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows'} # type: ignore async def get( self, @@ -128,16 +129,17 @@ async def get( :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: ~azure.mgmt.storagesync.models.Workflow + :return: Workflow, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.Workflow :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Workflow"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -170,10 +172,10 @@ async def get( deserialized = self._deserialize('Workflow', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}'} # type: ignore async def abort( self, @@ -191,16 +193,17 @@ async def abort( :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) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.abort.metadata['url'] + url = self.abort.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -231,6 +234,6 @@ async def abort( 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) + return cls(pipeline_response, None, response_headers) - abort.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}/abort'} + abort.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}/abort'} # type: ignore diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models.py index 30b27bb6050..012431fa5e9 100644 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models.py +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models.py @@ -76,7 +76,7 @@ class CheckNameAvailabilityResult(msrest.serialization.Model): :ivar reason: Gets the reason that a Storage Sync Service name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: "Invalid", "AlreadyExists". - :vartype reason: str or ~azure.mgmt.storagesync.models.NameAvailabilityReason + :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 """ @@ -140,41 +140,7 @@ def __init__( self.type = 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): +class CloudEndpoint(Resource): """Cloud Endpoint object. Variables are only populated by the server, and will be ignored when sending a request. @@ -249,7 +215,7 @@ class CloudEndpointArray(msrest.serialization.Model): """Array of CloudEndpoint. :param value: Collection of CloudEndpoint. - :type value: list[~azure.mgmt.storagesync.models.CloudEndpoint] + :type value: list[~microsoft_storage_sync.models.CloudEndpoint] """ _attribute_map = { @@ -264,7 +230,7 @@ def __init__( self.value = kwargs.get('value', None) -class CloudEndpointCreateParameters(ProxyResource): +class CloudEndpointCreateParameters(Resource): """The parameters used when creating a cloud endpoint. Variables are only populated by the server, and will be ignored when sending a request. @@ -395,7 +361,7 @@ class CloudTieringFilesNotTiering(msrest.serialization.Model): :ivar total_file_count: Last cloud tiering result (HResult). :vartype total_file_count: long :ivar errors: Array of tiering errors. - :vartype errors: list[~azure.mgmt.storagesync.models.FilesNotTieringError] + :vartype errors: list[~microsoft_storage_sync.models.FilesNotTieringError] """ _validation = { @@ -604,7 +570,7 @@ class OperationEntity(msrest.serialization.Model): :param name: Operation name: {provider}/{resource}/{operation}. :type name: str :param display: The operation supported by storage sync. - :type display: ~azure.mgmt.storagesync.models.OperationDisplayInfo + :type display: ~microsoft_storage_sync.models.OperationDisplayInfo :param origin: The origin. :type origin: str """ @@ -631,7 +597,7 @@ class OperationEntityListResult(msrest.serialization.Model): :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[~azure.mgmt.storagesync.models.OperationEntity] + :type value: list[~microsoft_storage_sync.models.OperationEntity] """ _attribute_map = { @@ -662,7 +628,7 @@ class OperationStatus(msrest.serialization.Model): :ivar end_time: End time of the operation. :vartype end_time: ~datetime.datetime :ivar error: Error details. - :vartype error: ~azure.mgmt.storagesync.models.StorageSyncApiError + :vartype error: ~microsoft_storage_sync.models.StorageSyncApiError """ _validation = { @@ -736,7 +702,7 @@ class PostRestoreRequest(msrest.serialization.Model): :param failed_file_list: Post Restore Azure failed file list. :type failed_file_list: str :param restore_file_spec: Post Restore restore file spec array. - :type restore_file_spec: list[~azure.mgmt.storagesync.models.RestoreFileSpec] + :type restore_file_spec: list[~microsoft_storage_sync.models.RestoreFileSpec] """ _attribute_map = { @@ -783,7 +749,7 @@ class PreRestoreRequest(msrest.serialization.Model): :param backup_metadata_property_bag: Pre Restore backup metadata property bag. :type backup_metadata_property_bag: str :param restore_file_spec: Pre Restore restore file spec array. - :type restore_file_spec: list[~azure.mgmt.storagesync.models.RestoreFileSpec] + :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 @@ -856,15 +822,15 @@ class PrivateEndpointConnection(Resource): Microsoft.Storage/storageAccounts. :vartype type: str :param private_endpoint: The resource of private end point. - :type private_endpoint: ~azure.mgmt.storagesync.models.PrivateEndpoint + :type private_endpoint: ~microsoft_storage_sync.models.PrivateEndpoint :param private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :type private_link_service_connection_state: - ~azure.mgmt.storagesync.models.PrivateLinkServiceConnectionState + ~microsoft_storage_sync.models.PrivateLinkServiceConnectionState :ivar provisioning_state: The provisioning state of the private endpoint connection resource. Possible values include: "Succeeded", "Creating", "Deleting", "Failed". :vartype provisioning_state: str or - ~azure.mgmt.storagesync.models.PrivateEndpointConnectionProvisioningState + ~microsoft_storage_sync.models.PrivateEndpointConnectionProvisioningState """ _validation = { @@ -897,7 +863,7 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """List of private endpoint connection associated with the specified storage account. :param value: Array of private endpoint connections. - :type value: list[~azure.mgmt.storagesync.models.PrivateEndpointConnection] + :type value: list[~microsoft_storage_sync.models.PrivateEndpointConnection] """ _attribute_map = { @@ -964,7 +930,7 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """A list of private link resources. :param value: Array of private link resources. - :type value: list[~azure.mgmt.storagesync.models.PrivateLinkResource] + :type value: list[~microsoft_storage_sync.models.PrivateLinkResource] """ _attribute_map = { @@ -984,18 +950,18 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: "Pending", "Approved", "Rejected". - :type status: str or ~azure.mgmt.storagesync.models.PrivateEndpointServiceConnectionStatus + :type status: str or ~microsoft_storage_sync.models.PrivateEndpointServiceConnectionStatus :param description: The reason for approval/rejection of the connection. :type description: str - :param action_required: A message indicating if changes on the service provider require any + :param actions_required: A message indicating if changes on the service provider require any updates on the consumer. - :type action_required: str + :type actions_required: str """ _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, - 'action_required': {'key': 'actionRequired', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } def __init__( @@ -1005,7 +971,41 @@ def __init__( super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = kwargs.get('status', None) self.description = kwargs.get('description', None) - self.action_required = kwargs.get('action_required', None) + self.actions_required = kwargs.get('actions_required', 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 RecallActionParameters(msrest.serialization.Model): @@ -1031,7 +1031,7 @@ def __init__( self.recall_path = kwargs.get('recall_path', None) -class RegisteredServer(ProxyResource): +class RegisteredServer(Resource): """Registered Server resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -1149,7 +1149,7 @@ class RegisteredServerArray(msrest.serialization.Model): """Array of RegisteredServer. :param value: Collection of Registered Server. - :type value: list[~azure.mgmt.storagesync.models.RegisteredServer] + :type value: list[~microsoft_storage_sync.models.RegisteredServer] """ _attribute_map = { @@ -1164,7 +1164,7 @@ def __init__( self.value = kwargs.get('value', None) -class RegisteredServerCreateParameters(ProxyResource): +class RegisteredServerCreateParameters(Resource): """The parameters used when creating a registered server. Variables are only populated by the server, and will be ignored when sending a request. @@ -1280,7 +1280,7 @@ def __init__( self.isdir = kwargs.get('isdir', None) -class ServerEndpoint(ProxyResource): +class ServerEndpoint(Resource): """Server Endpoint object. Variables are only populated by the server, and will be ignored when sending a request. @@ -1296,7 +1296,7 @@ class ServerEndpoint(ProxyResource): :param server_local_path: Server Local path. :type server_local_path: str :param cloud_tiering: Cloud Tiering. Possible values include: "on", "off". - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 @@ -1313,9 +1313,9 @@ class ServerEndpoint(ProxyResource): :ivar last_operation_name: Resource Last Operation Name. :vartype last_operation_name: str :ivar sync_status: Server Endpoint sync status. - :vartype sync_status: ~azure.mgmt.storagesync.models.ServerEndpointSyncStatus + :vartype sync_status: ~microsoft_storage_sync.models.ServerEndpointSyncStatus :param offline_data_transfer: Offline data transfer. Possible values include: "on", "off". - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 @@ -1325,16 +1325,16 @@ class ServerEndpoint(ProxyResource): :param offline_data_transfer_share_name: Offline data transfer share name. :type offline_data_transfer_share_name: str :ivar cloud_tiering_status: Cloud tiering status. Only populated if cloud tiering is enabled. - :vartype cloud_tiering_status: ~azure.mgmt.storagesync.models.ServerEndpointCloudTieringStatus + :vartype cloud_tiering_status: ~microsoft_storage_sync.models.ServerEndpointCloudTieringStatus :ivar recall_status: Recall status. Only populated if cloud tiering is enabled. - :vartype recall_status: ~azure.mgmt.storagesync.models.ServerEndpointRecallStatus + :vartype recall_status: ~microsoft_storage_sync.models.ServerEndpointRecallStatus :param initial_download_policy: Policy for how namespace and files are recalled during FastDr. Possible values include: "NamespaceOnly", "NamespaceThenModifiedFiles", "AvoidTieredFiles". - :type initial_download_policy: str or ~azure.mgmt.storagesync.models.InitialDownloadPolicy + :type initial_download_policy: str or ~microsoft_storage_sync.models.InitialDownloadPolicy :param local_cache_mode: Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. Possible values include: "DownloadNewAndModifiedFiles", "UpdateLocallyCachedFiles". - :type local_cache_mode: str or ~azure.mgmt.storagesync.models.LocalCacheMode + :type local_cache_mode: str or ~microsoft_storage_sync.models.LocalCacheMode """ _validation = { @@ -1406,7 +1406,7 @@ class ServerEndpointArray(msrest.serialization.Model): """Array of ServerEndpoint. :param value: Collection of ServerEndpoint. - :type value: list[~azure.mgmt.storagesync.models.ServerEndpoint] + :type value: list[~microsoft_storage_sync.models.ServerEndpoint] """ _attribute_map = { @@ -1429,7 +1429,7 @@ class ServerEndpointCloudTieringStatus(msrest.serialization.Model): :ivar last_updated_timestamp: Last updated timestamp. :vartype last_updated_timestamp: ~datetime.datetime :ivar health: Cloud tiering health state. Possible values include: "Healthy", "Error". - :vartype health: str or ~azure.mgmt.storagesync.models.ServerEndpointCloudTieringHealthState + :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). @@ -1437,17 +1437,17 @@ class ServerEndpointCloudTieringStatus(msrest.serialization.Model): :ivar last_success_timestamp: Last cloud tiering success timestamp. :vartype last_success_timestamp: ~datetime.datetime :ivar space_savings: Information regarding how much local space cloud tiering is saving. - :vartype space_savings: ~azure.mgmt.storagesync.models.CloudTieringSpaceSavings + :vartype space_savings: ~microsoft_storage_sync.models.CloudTieringSpaceSavings :ivar cache_performance: Information regarding how well the local cache on the server is performing. - :vartype cache_performance: ~azure.mgmt.storagesync.models.CloudTieringCachePerformance + :vartype cache_performance: ~microsoft_storage_sync.models.CloudTieringCachePerformance :ivar files_not_tiering: Information regarding files that failed to be tiered. - :vartype files_not_tiering: ~azure.mgmt.storagesync.models.CloudTieringFilesNotTiering + :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: - ~azure.mgmt.storagesync.models.CloudTieringVolumeFreeSpacePolicyStatus + ~microsoft_storage_sync.models.CloudTieringVolumeFreeSpacePolicyStatus :ivar date_policy_status: Status of the date policy. - :vartype date_policy_status: ~azure.mgmt.storagesync.models.CloudTieringDatePolicyStatus + :vartype date_policy_status: ~microsoft_storage_sync.models.CloudTieringDatePolicyStatus """ _validation = { @@ -1493,7 +1493,7 @@ def __init__( self.date_policy_status = None -class ServerEndpointCreateParameters(ProxyResource): +class ServerEndpointCreateParameters(Resource): """The parameters used when creating a server endpoint. Variables are only populated by the server, and will be ignored when sending a request. @@ -1509,7 +1509,7 @@ class ServerEndpointCreateParameters(ProxyResource): :param server_local_path: Server Local path. :type server_local_path: str :param cloud_tiering: Cloud Tiering. Possible values include: "on", "off". - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 @@ -1520,16 +1520,16 @@ class ServerEndpointCreateParameters(ProxyResource): :param server_resource_id: Server Resource Id. :type server_resource_id: str :param offline_data_transfer: Offline data transfer. Possible values include: "on", "off". - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 :param initial_download_policy: Policy for how namespace and files are recalled during FastDr. Possible values include: "NamespaceOnly", "NamespaceThenModifiedFiles", "AvoidTieredFiles". - :type initial_download_policy: str or ~azure.mgmt.storagesync.models.InitialDownloadPolicy + :type initial_download_policy: str or ~microsoft_storage_sync.models.InitialDownloadPolicy :param local_cache_mode: Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. Possible values include: "DownloadNewAndModifiedFiles", "UpdateLocallyCachedFiles". - :type local_cache_mode: str or ~azure.mgmt.storagesync.models.LocalCacheMode + :type local_cache_mode: str or ~microsoft_storage_sync.models.LocalCacheMode """ _validation = { @@ -1648,7 +1648,7 @@ class ServerEndpointRecallStatus(msrest.serialization.Model): :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[~azure.mgmt.storagesync.models.ServerEndpointRecallError] + :vartype recall_errors: list[~microsoft_storage_sync.models.ServerEndpointRecallError] """ _validation = { @@ -1742,7 +1742,7 @@ class ServerEndpointSyncSessionStatus(msrest.serialization.Model): :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[~azure.mgmt.storagesync.models.ServerEndpointFilesNotSyncingError] + list[~microsoft_storage_sync.models.ServerEndpointFilesNotSyncingError] """ _validation = { @@ -1786,33 +1786,33 @@ class ServerEndpointSyncStatus(msrest.serialization.Model): :ivar download_health: Download Health Status. Possible values include: "Healthy", "Error", "SyncBlockedForRestore", "SyncBlockedForChangeDetectionPostRestore", "NoActivity". - :vartype download_health: str or ~azure.mgmt.storagesync.models.ServerEndpointSyncHealthState + :vartype download_health: str or ~microsoft_storage_sync.models.ServerEndpointSyncHealthState :ivar upload_health: Upload Health Status. Possible values include: "Healthy", "Error", "SyncBlockedForRestore", "SyncBlockedForChangeDetectionPostRestore", "NoActivity". - :vartype upload_health: str or ~azure.mgmt.storagesync.models.ServerEndpointSyncHealthState + :vartype upload_health: str or ~microsoft_storage_sync.models.ServerEndpointSyncHealthState :ivar combined_health: Combined Health Status. Possible values include: "Healthy", "Error", "SyncBlockedForRestore", "SyncBlockedForChangeDetectionPostRestore", "NoActivity". - :vartype combined_health: str or ~azure.mgmt.storagesync.models.ServerEndpointSyncHealthState + :vartype combined_health: str or ~microsoft_storage_sync.models.ServerEndpointSyncHealthState :ivar sync_activity: Sync activity. Possible values include: "Upload", "Download", "UploadAndDownload". - :vartype sync_activity: str or ~azure.mgmt.storagesync.models.ServerEndpointSyncActivityState + :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: Upload Status. - :vartype upload_status: ~azure.mgmt.storagesync.models.ServerEndpointSyncSessionStatus + :vartype upload_status: ~microsoft_storage_sync.models.ServerEndpointSyncSessionStatus :ivar download_status: Download Status. - :vartype download_status: ~azure.mgmt.storagesync.models.ServerEndpointSyncSessionStatus + :vartype download_status: ~microsoft_storage_sync.models.ServerEndpointSyncSessionStatus :ivar upload_activity: Upload sync activity. - :vartype upload_activity: ~azure.mgmt.storagesync.models.ServerEndpointSyncActivityStatus + :vartype upload_activity: ~microsoft_storage_sync.models.ServerEndpointSyncActivityStatus :ivar download_activity: Download sync activity. - :vartype download_activity: ~azure.mgmt.storagesync.models.ServerEndpointSyncActivityStatus + :vartype download_activity: ~microsoft_storage_sync.models.ServerEndpointSyncActivityStatus :ivar offline_data_transfer_status: Offline Data Transfer State. Possible values include: "InProgress", "Stopping", "NotRunning", "Complete". :vartype offline_data_transfer_status: str or - ~azure.mgmt.storagesync.models.ServerEndpointOfflineDataTransferState + ~microsoft_storage_sync.models.ServerEndpointOfflineDataTransferState """ _validation = { @@ -1865,20 +1865,20 @@ class ServerEndpointUpdateParameters(msrest.serialization.Model): """Parameters for updating an Server Endpoint. :param cloud_tiering: Cloud Tiering. Possible values include: "on", "off". - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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: Offline data transfer. Possible values include: "on", "off". - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 :param local_cache_mode: Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. Possible values include: "DownloadNewAndModifiedFiles", "UpdateLocallyCachedFiles". - :type local_cache_mode: str or ~azure.mgmt.storagesync.models.LocalCacheMode + :type local_cache_mode: str or ~microsoft_storage_sync.models.LocalCacheMode """ _validation = { @@ -1918,7 +1918,7 @@ class StorageSyncApiError(msrest.serialization.Model): :param target: Target of the given error entry. :type target: str :param details: Error details of the given entry. - :type details: ~azure.mgmt.storagesync.models.StorageSyncErrorDetails + :type details: ~microsoft_storage_sync.models.StorageSyncErrorDetails """ _attribute_map = { @@ -1943,9 +1943,9 @@ class StorageSyncError(msrest.serialization.Model): """Error type. :param error: Error details of the given entry. - :type error: ~azure.mgmt.storagesync.models.StorageSyncApiError + :type error: ~microsoft_storage_sync.models.StorageSyncApiError :param innererror: Error details of the given entry. - :type innererror: ~azure.mgmt.storagesync.models.StorageSyncApiError + :type innererror: ~microsoft_storage_sync.models.StorageSyncApiError """ _attribute_map = { @@ -2055,7 +2055,7 @@ class StorageSyncService(TrackedResource): :type location: str :param incoming_traffic_policy: Incoming Traffic Policy. Possible values include: "AllowAllTraffic", "AllowVirtualNetworksOnly". - :type incoming_traffic_policy: str or ~azure.mgmt.storagesync.models.IncomingTrafficPolicy + :type incoming_traffic_policy: str or ~microsoft_storage_sync.models.IncomingTrafficPolicy :ivar storage_sync_service_status: Storage Sync service status. :vartype storage_sync_service_status: int :ivar storage_sync_service_uid: Storage Sync service Uid. @@ -2069,7 +2069,7 @@ class StorageSyncService(TrackedResource): :ivar private_endpoint_connections: List of private endpoint connection associated with the specified storage sync service. :vartype private_endpoint_connections: - list[~azure.mgmt.storagesync.models.PrivateEndpointConnection] + list[~microsoft_storage_sync.models.PrivateEndpointConnection] """ _validation = { @@ -2118,7 +2118,7 @@ class StorageSyncServiceArray(msrest.serialization.Model): """Array of StorageSyncServices. :param value: Collection of StorageSyncServices. - :type value: list[~azure.mgmt.storagesync.models.StorageSyncService] + :type value: list[~microsoft_storage_sync.models.StorageSyncService] """ _attribute_map = { @@ -2150,7 +2150,7 @@ class StorageSyncServiceCreateParameters(msrest.serialization.Model): :type tags: dict[str, str] :param incoming_traffic_policy: Incoming Traffic Policy. Possible values include: "AllowAllTraffic", "AllowVirtualNetworksOnly". - :type incoming_traffic_policy: str or ~azure.mgmt.storagesync.models.IncomingTrafficPolicy + :type incoming_traffic_policy: str or ~microsoft_storage_sync.models.IncomingTrafficPolicy """ _validation = { @@ -2180,7 +2180,7 @@ class StorageSyncServiceUpdateParameters(msrest.serialization.Model): :type tags: dict[str, str] :param incoming_traffic_policy: Incoming Traffic Policy. Possible values include: "AllowAllTraffic", "AllowVirtualNetworksOnly". - :type incoming_traffic_policy: str or ~azure.mgmt.storagesync.models.IncomingTrafficPolicy + :type incoming_traffic_policy: str or ~microsoft_storage_sync.models.IncomingTrafficPolicy """ _attribute_map = { @@ -2204,7 +2204,7 @@ class SubscriptionState(msrest.serialization.Model): :param state: State of Azure Subscription. Possible values include: "Registered", "Unregistered", "Warned", "Suspended", "Deleted". - :type state: str or ~azure.mgmt.storagesync.models.Reason + :type state: str or ~microsoft_storage_sync.models.Reason :ivar istransitioning: Is Transitioning. :vartype istransitioning: bool :param properties: Subscription state properties. @@ -2231,7 +2231,7 @@ def __init__( self.properties = kwargs.get('properties', None) -class SyncGroup(ProxyResource): +class SyncGroup(Resource): """Sync Group object. Variables are only populated by the server, and will be ignored when sending a request. @@ -2279,7 +2279,7 @@ class SyncGroupArray(msrest.serialization.Model): """Array of SyncGroup. :param value: Collection of SyncGroup. - :type value: list[~azure.mgmt.storagesync.models.SyncGroup] + :type value: list[~microsoft_storage_sync.models.SyncGroup] """ _attribute_map = { @@ -2294,7 +2294,7 @@ def __init__( self.value = kwargs.get('value', None) -class SyncGroupCreateParameters(ProxyResource): +class SyncGroupCreateParameters(Resource): """The parameters used when creating a sync group. Variables are only populated by the server, and will be ignored when sending a request. @@ -2340,7 +2340,7 @@ class TriggerChangeDetectionParameters(msrest.serialization.Model): :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 ~azure.mgmt.storagesync.models.ChangeDetectionMode + :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] @@ -2381,7 +2381,7 @@ def __init__( self.server_certificate = kwargs.get('server_certificate', None) -class Workflow(ProxyResource): +class Workflow(Resource): """Workflow resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -2398,9 +2398,9 @@ class Workflow(ProxyResource): :type last_step_name: str :param status: workflow status. Possible values include: "active", "expired", "succeeded", "aborted", "failed". - :type status: str or ~azure.mgmt.storagesync.models.WorkflowStatus + :type status: str or ~microsoft_storage_sync.models.WorkflowStatus :param operation: operation direction. Possible values include: "do", "undo", "cancel". - :type operation: str or ~azure.mgmt.storagesync.models.OperationDirection + :type operation: str or ~microsoft_storage_sync.models.OperationDirection :param steps: workflow steps. :type steps: str :param last_operation_id: workflow last operation identifier. @@ -2440,7 +2440,7 @@ class WorkflowArray(msrest.serialization.Model): """Array of Workflow. :param value: Collection of workflow items. - :type value: list[~azure.mgmt.storagesync.models.Workflow] + :type value: list[~microsoft_storage_sync.models.Workflow] """ _attribute_map = { 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 index 1c60fef1416..f4565db953c 100644 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models_py3.py +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/models/_models_py3.py @@ -11,6 +11,8 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization +from ._microsoft_storage_sync_enums import * + class BackupRequest(msrest.serialization.Model): """Backup request. @@ -82,7 +84,7 @@ class CheckNameAvailabilityResult(msrest.serialization.Model): :ivar reason: Gets the reason that a Storage Sync Service name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: "Invalid", "AlreadyExists". - :vartype reason: str or ~azure.mgmt.storagesync.models.NameAvailabilityReason + :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 """ @@ -146,41 +148,7 @@ def __init__( self.type = 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): +class CloudEndpoint(Resource): """Cloud Endpoint object. Variables are only populated by the server, and will be ignored when sending a request. @@ -264,7 +232,7 @@ class CloudEndpointArray(msrest.serialization.Model): """Array of CloudEndpoint. :param value: Collection of CloudEndpoint. - :type value: list[~azure.mgmt.storagesync.models.CloudEndpoint] + :type value: list[~microsoft_storage_sync.models.CloudEndpoint] """ _attribute_map = { @@ -281,7 +249,7 @@ def __init__( self.value = value -class CloudEndpointCreateParameters(ProxyResource): +class CloudEndpointCreateParameters(Resource): """The parameters used when creating a cloud endpoint. Variables are only populated by the server, and will be ignored when sending a request. @@ -417,7 +385,7 @@ class CloudTieringFilesNotTiering(msrest.serialization.Model): :ivar total_file_count: Last cloud tiering result (HResult). :vartype total_file_count: long :ivar errors: Array of tiering errors. - :vartype errors: list[~azure.mgmt.storagesync.models.FilesNotTieringError] + :vartype errors: list[~microsoft_storage_sync.models.FilesNotTieringError] """ _validation = { @@ -636,7 +604,7 @@ class OperationEntity(msrest.serialization.Model): :param name: Operation name: {provider}/{resource}/{operation}. :type name: str :param display: The operation supported by storage sync. - :type display: ~azure.mgmt.storagesync.models.OperationDisplayInfo + :type display: ~microsoft_storage_sync.models.OperationDisplayInfo :param origin: The origin. :type origin: str """ @@ -667,7 +635,7 @@ class OperationEntityListResult(msrest.serialization.Model): :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[~azure.mgmt.storagesync.models.OperationEntity] + :type value: list[~microsoft_storage_sync.models.OperationEntity] """ _attribute_map = { @@ -701,7 +669,7 @@ class OperationStatus(msrest.serialization.Model): :ivar end_time: End time of the operation. :vartype end_time: ~datetime.datetime :ivar error: Error details. - :vartype error: ~azure.mgmt.storagesync.models.StorageSyncApiError + :vartype error: ~microsoft_storage_sync.models.StorageSyncApiError """ _validation = { @@ -775,7 +743,7 @@ class PostRestoreRequest(msrest.serialization.Model): :param failed_file_list: Post Restore Azure failed file list. :type failed_file_list: str :param restore_file_spec: Post Restore restore file spec array. - :type restore_file_spec: list[~azure.mgmt.storagesync.models.RestoreFileSpec] + :type restore_file_spec: list[~microsoft_storage_sync.models.RestoreFileSpec] """ _attribute_map = { @@ -831,7 +799,7 @@ class PreRestoreRequest(msrest.serialization.Model): :param backup_metadata_property_bag: Pre Restore backup metadata property bag. :type backup_metadata_property_bag: str :param restore_file_spec: Pre Restore restore file spec array. - :type restore_file_spec: list[~azure.mgmt.storagesync.models.RestoreFileSpec] + :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 @@ -914,15 +882,15 @@ class PrivateEndpointConnection(Resource): Microsoft.Storage/storageAccounts. :vartype type: str :param private_endpoint: The resource of private end point. - :type private_endpoint: ~azure.mgmt.storagesync.models.PrivateEndpoint + :type private_endpoint: ~microsoft_storage_sync.models.PrivateEndpoint :param private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :type private_link_service_connection_state: - ~azure.mgmt.storagesync.models.PrivateLinkServiceConnectionState + ~microsoft_storage_sync.models.PrivateLinkServiceConnectionState :ivar provisioning_state: The provisioning state of the private endpoint connection resource. Possible values include: "Succeeded", "Creating", "Deleting", "Failed". :vartype provisioning_state: str or - ~azure.mgmt.storagesync.models.PrivateEndpointConnectionProvisioningState + ~microsoft_storage_sync.models.PrivateEndpointConnectionProvisioningState """ _validation = { @@ -958,7 +926,7 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """List of private endpoint connection associated with the specified storage account. :param value: Array of private endpoint connections. - :type value: list[~azure.mgmt.storagesync.models.PrivateEndpointConnection] + :type value: list[~microsoft_storage_sync.models.PrivateEndpointConnection] """ _attribute_map = { @@ -1029,7 +997,7 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """A list of private link resources. :param value: Array of private link resources. - :type value: list[~azure.mgmt.storagesync.models.PrivateLinkResource] + :type value: list[~microsoft_storage_sync.models.PrivateLinkResource] """ _attribute_map = { @@ -1051,18 +1019,18 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: "Pending", "Approved", "Rejected". - :type status: str or ~azure.mgmt.storagesync.models.PrivateEndpointServiceConnectionStatus + :type status: str or ~microsoft_storage_sync.models.PrivateEndpointServiceConnectionStatus :param description: The reason for approval/rejection of the connection. :type description: str - :param action_required: A message indicating if changes on the service provider require any + :param actions_required: A message indicating if changes on the service provider require any updates on the consumer. - :type action_required: str + :type actions_required: str """ _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, - 'action_required': {'key': 'actionRequired', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } def __init__( @@ -1070,13 +1038,47 @@ def __init__( *, status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, description: Optional[str] = None, - action_required: Optional[str] = None, + actions_required: Optional[str] = None, **kwargs ): super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description - self.action_required = action_required + self.actions_required = actions_required + + +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 RecallActionParameters(msrest.serialization.Model): @@ -1105,7 +1107,7 @@ def __init__( self.recall_path = recall_path -class RegisteredServer(ProxyResource): +class RegisteredServer(Resource): """Registered Server resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -1244,7 +1246,7 @@ class RegisteredServerArray(msrest.serialization.Model): """Array of RegisteredServer. :param value: Collection of Registered Server. - :type value: list[~azure.mgmt.storagesync.models.RegisteredServer] + :type value: list[~microsoft_storage_sync.models.RegisteredServer] """ _attribute_map = { @@ -1261,7 +1263,7 @@ def __init__( self.value = value -class RegisteredServerCreateParameters(ProxyResource): +class RegisteredServerCreateParameters(Resource): """The parameters used when creating a registered server. Variables are only populated by the server, and will be ignored when sending a request. @@ -1393,7 +1395,7 @@ def __init__( self.isdir = isdir -class ServerEndpoint(ProxyResource): +class ServerEndpoint(Resource): """Server Endpoint object. Variables are only populated by the server, and will be ignored when sending a request. @@ -1409,7 +1411,7 @@ class ServerEndpoint(ProxyResource): :param server_local_path: Server Local path. :type server_local_path: str :param cloud_tiering: Cloud Tiering. Possible values include: "on", "off". - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 @@ -1426,9 +1428,9 @@ class ServerEndpoint(ProxyResource): :ivar last_operation_name: Resource Last Operation Name. :vartype last_operation_name: str :ivar sync_status: Server Endpoint sync status. - :vartype sync_status: ~azure.mgmt.storagesync.models.ServerEndpointSyncStatus + :vartype sync_status: ~microsoft_storage_sync.models.ServerEndpointSyncStatus :param offline_data_transfer: Offline data transfer. Possible values include: "on", "off". - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 @@ -1438,16 +1440,16 @@ class ServerEndpoint(ProxyResource): :param offline_data_transfer_share_name: Offline data transfer share name. :type offline_data_transfer_share_name: str :ivar cloud_tiering_status: Cloud tiering status. Only populated if cloud tiering is enabled. - :vartype cloud_tiering_status: ~azure.mgmt.storagesync.models.ServerEndpointCloudTieringStatus + :vartype cloud_tiering_status: ~microsoft_storage_sync.models.ServerEndpointCloudTieringStatus :ivar recall_status: Recall status. Only populated if cloud tiering is enabled. - :vartype recall_status: ~azure.mgmt.storagesync.models.ServerEndpointRecallStatus + :vartype recall_status: ~microsoft_storage_sync.models.ServerEndpointRecallStatus :param initial_download_policy: Policy for how namespace and files are recalled during FastDr. Possible values include: "NamespaceOnly", "NamespaceThenModifiedFiles", "AvoidTieredFiles". - :type initial_download_policy: str or ~azure.mgmt.storagesync.models.InitialDownloadPolicy + :type initial_download_policy: str or ~microsoft_storage_sync.models.InitialDownloadPolicy :param local_cache_mode: Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. Possible values include: "DownloadNewAndModifiedFiles", "UpdateLocallyCachedFiles". - :type local_cache_mode: str or ~azure.mgmt.storagesync.models.LocalCacheMode + :type local_cache_mode: str or ~microsoft_storage_sync.models.LocalCacheMode """ _validation = { @@ -1530,7 +1532,7 @@ class ServerEndpointArray(msrest.serialization.Model): """Array of ServerEndpoint. :param value: Collection of ServerEndpoint. - :type value: list[~azure.mgmt.storagesync.models.ServerEndpoint] + :type value: list[~microsoft_storage_sync.models.ServerEndpoint] """ _attribute_map = { @@ -1555,7 +1557,7 @@ class ServerEndpointCloudTieringStatus(msrest.serialization.Model): :ivar last_updated_timestamp: Last updated timestamp. :vartype last_updated_timestamp: ~datetime.datetime :ivar health: Cloud tiering health state. Possible values include: "Healthy", "Error". - :vartype health: str or ~azure.mgmt.storagesync.models.ServerEndpointCloudTieringHealthState + :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). @@ -1563,17 +1565,17 @@ class ServerEndpointCloudTieringStatus(msrest.serialization.Model): :ivar last_success_timestamp: Last cloud tiering success timestamp. :vartype last_success_timestamp: ~datetime.datetime :ivar space_savings: Information regarding how much local space cloud tiering is saving. - :vartype space_savings: ~azure.mgmt.storagesync.models.CloudTieringSpaceSavings + :vartype space_savings: ~microsoft_storage_sync.models.CloudTieringSpaceSavings :ivar cache_performance: Information regarding how well the local cache on the server is performing. - :vartype cache_performance: ~azure.mgmt.storagesync.models.CloudTieringCachePerformance + :vartype cache_performance: ~microsoft_storage_sync.models.CloudTieringCachePerformance :ivar files_not_tiering: Information regarding files that failed to be tiered. - :vartype files_not_tiering: ~azure.mgmt.storagesync.models.CloudTieringFilesNotTiering + :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: - ~azure.mgmt.storagesync.models.CloudTieringVolumeFreeSpacePolicyStatus + ~microsoft_storage_sync.models.CloudTieringVolumeFreeSpacePolicyStatus :ivar date_policy_status: Status of the date policy. - :vartype date_policy_status: ~azure.mgmt.storagesync.models.CloudTieringDatePolicyStatus + :vartype date_policy_status: ~microsoft_storage_sync.models.CloudTieringDatePolicyStatus """ _validation = { @@ -1619,7 +1621,7 @@ def __init__( self.date_policy_status = None -class ServerEndpointCreateParameters(ProxyResource): +class ServerEndpointCreateParameters(Resource): """The parameters used when creating a server endpoint. Variables are only populated by the server, and will be ignored when sending a request. @@ -1635,7 +1637,7 @@ class ServerEndpointCreateParameters(ProxyResource): :param server_local_path: Server Local path. :type server_local_path: str :param cloud_tiering: Cloud Tiering. Possible values include: "on", "off". - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 @@ -1646,16 +1648,16 @@ class ServerEndpointCreateParameters(ProxyResource): :param server_resource_id: Server Resource Id. :type server_resource_id: str :param offline_data_transfer: Offline data transfer. Possible values include: "on", "off". - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 :param initial_download_policy: Policy for how namespace and files are recalled during FastDr. Possible values include: "NamespaceOnly", "NamespaceThenModifiedFiles", "AvoidTieredFiles". - :type initial_download_policy: str or ~azure.mgmt.storagesync.models.InitialDownloadPolicy + :type initial_download_policy: str or ~microsoft_storage_sync.models.InitialDownloadPolicy :param local_cache_mode: Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. Possible values include: "DownloadNewAndModifiedFiles", "UpdateLocallyCachedFiles". - :type local_cache_mode: str or ~azure.mgmt.storagesync.models.LocalCacheMode + :type local_cache_mode: str or ~microsoft_storage_sync.models.LocalCacheMode """ _validation = { @@ -1785,7 +1787,7 @@ class ServerEndpointRecallStatus(msrest.serialization.Model): :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[~azure.mgmt.storagesync.models.ServerEndpointRecallError] + :vartype recall_errors: list[~microsoft_storage_sync.models.ServerEndpointRecallError] """ _validation = { @@ -1879,7 +1881,7 @@ class ServerEndpointSyncSessionStatus(msrest.serialization.Model): :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[~azure.mgmt.storagesync.models.ServerEndpointFilesNotSyncingError] + list[~microsoft_storage_sync.models.ServerEndpointFilesNotSyncingError] """ _validation = { @@ -1923,33 +1925,33 @@ class ServerEndpointSyncStatus(msrest.serialization.Model): :ivar download_health: Download Health Status. Possible values include: "Healthy", "Error", "SyncBlockedForRestore", "SyncBlockedForChangeDetectionPostRestore", "NoActivity". - :vartype download_health: str or ~azure.mgmt.storagesync.models.ServerEndpointSyncHealthState + :vartype download_health: str or ~microsoft_storage_sync.models.ServerEndpointSyncHealthState :ivar upload_health: Upload Health Status. Possible values include: "Healthy", "Error", "SyncBlockedForRestore", "SyncBlockedForChangeDetectionPostRestore", "NoActivity". - :vartype upload_health: str or ~azure.mgmt.storagesync.models.ServerEndpointSyncHealthState + :vartype upload_health: str or ~microsoft_storage_sync.models.ServerEndpointSyncHealthState :ivar combined_health: Combined Health Status. Possible values include: "Healthy", "Error", "SyncBlockedForRestore", "SyncBlockedForChangeDetectionPostRestore", "NoActivity". - :vartype combined_health: str or ~azure.mgmt.storagesync.models.ServerEndpointSyncHealthState + :vartype combined_health: str or ~microsoft_storage_sync.models.ServerEndpointSyncHealthState :ivar sync_activity: Sync activity. Possible values include: "Upload", "Download", "UploadAndDownload". - :vartype sync_activity: str or ~azure.mgmt.storagesync.models.ServerEndpointSyncActivityState + :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: Upload Status. - :vartype upload_status: ~azure.mgmt.storagesync.models.ServerEndpointSyncSessionStatus + :vartype upload_status: ~microsoft_storage_sync.models.ServerEndpointSyncSessionStatus :ivar download_status: Download Status. - :vartype download_status: ~azure.mgmt.storagesync.models.ServerEndpointSyncSessionStatus + :vartype download_status: ~microsoft_storage_sync.models.ServerEndpointSyncSessionStatus :ivar upload_activity: Upload sync activity. - :vartype upload_activity: ~azure.mgmt.storagesync.models.ServerEndpointSyncActivityStatus + :vartype upload_activity: ~microsoft_storage_sync.models.ServerEndpointSyncActivityStatus :ivar download_activity: Download sync activity. - :vartype download_activity: ~azure.mgmt.storagesync.models.ServerEndpointSyncActivityStatus + :vartype download_activity: ~microsoft_storage_sync.models.ServerEndpointSyncActivityStatus :ivar offline_data_transfer_status: Offline Data Transfer State. Possible values include: "InProgress", "Stopping", "NotRunning", "Complete". :vartype offline_data_transfer_status: str or - ~azure.mgmt.storagesync.models.ServerEndpointOfflineDataTransferState + ~microsoft_storage_sync.models.ServerEndpointOfflineDataTransferState """ _validation = { @@ -2002,20 +2004,20 @@ class ServerEndpointUpdateParameters(msrest.serialization.Model): """Parameters for updating an Server Endpoint. :param cloud_tiering: Cloud Tiering. Possible values include: "on", "off". - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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: Offline data transfer. Possible values include: "on", "off". - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 :param local_cache_mode: Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. Possible values include: "DownloadNewAndModifiedFiles", "UpdateLocallyCachedFiles". - :type local_cache_mode: str or ~azure.mgmt.storagesync.models.LocalCacheMode + :type local_cache_mode: str or ~microsoft_storage_sync.models.LocalCacheMode """ _validation = { @@ -2062,7 +2064,7 @@ class StorageSyncApiError(msrest.serialization.Model): :param target: Target of the given error entry. :type target: str :param details: Error details of the given entry. - :type details: ~azure.mgmt.storagesync.models.StorageSyncErrorDetails + :type details: ~microsoft_storage_sync.models.StorageSyncErrorDetails """ _attribute_map = { @@ -2092,9 +2094,9 @@ class StorageSyncError(msrest.serialization.Model): """Error type. :param error: Error details of the given entry. - :type error: ~azure.mgmt.storagesync.models.StorageSyncApiError + :type error: ~microsoft_storage_sync.models.StorageSyncApiError :param innererror: Error details of the given entry. - :type innererror: ~azure.mgmt.storagesync.models.StorageSyncApiError + :type innererror: ~microsoft_storage_sync.models.StorageSyncApiError """ _attribute_map = { @@ -2214,7 +2216,7 @@ class StorageSyncService(TrackedResource): :type location: str :param incoming_traffic_policy: Incoming Traffic Policy. Possible values include: "AllowAllTraffic", "AllowVirtualNetworksOnly". - :type incoming_traffic_policy: str or ~azure.mgmt.storagesync.models.IncomingTrafficPolicy + :type incoming_traffic_policy: str or ~microsoft_storage_sync.models.IncomingTrafficPolicy :ivar storage_sync_service_status: Storage Sync service status. :vartype storage_sync_service_status: int :ivar storage_sync_service_uid: Storage Sync service Uid. @@ -2228,7 +2230,7 @@ class StorageSyncService(TrackedResource): :ivar private_endpoint_connections: List of private endpoint connection associated with the specified storage sync service. :vartype private_endpoint_connections: - list[~azure.mgmt.storagesync.models.PrivateEndpointConnection] + list[~microsoft_storage_sync.models.PrivateEndpointConnection] """ _validation = { @@ -2281,7 +2283,7 @@ class StorageSyncServiceArray(msrest.serialization.Model): """Array of StorageSyncServices. :param value: Collection of StorageSyncServices. - :type value: list[~azure.mgmt.storagesync.models.StorageSyncService] + :type value: list[~microsoft_storage_sync.models.StorageSyncService] """ _attribute_map = { @@ -2315,7 +2317,7 @@ class StorageSyncServiceCreateParameters(msrest.serialization.Model): :type tags: dict[str, str] :param incoming_traffic_policy: Incoming Traffic Policy. Possible values include: "AllowAllTraffic", "AllowVirtualNetworksOnly". - :type incoming_traffic_policy: str or ~azure.mgmt.storagesync.models.IncomingTrafficPolicy + :type incoming_traffic_policy: str or ~microsoft_storage_sync.models.IncomingTrafficPolicy """ _validation = { @@ -2349,7 +2351,7 @@ class StorageSyncServiceUpdateParameters(msrest.serialization.Model): :type tags: dict[str, str] :param incoming_traffic_policy: Incoming Traffic Policy. Possible values include: "AllowAllTraffic", "AllowVirtualNetworksOnly". - :type incoming_traffic_policy: str or ~azure.mgmt.storagesync.models.IncomingTrafficPolicy + :type incoming_traffic_policy: str or ~microsoft_storage_sync.models.IncomingTrafficPolicy """ _attribute_map = { @@ -2376,7 +2378,7 @@ class SubscriptionState(msrest.serialization.Model): :param state: State of Azure Subscription. Possible values include: "Registered", "Unregistered", "Warned", "Suspended", "Deleted". - :type state: str or ~azure.mgmt.storagesync.models.Reason + :type state: str or ~microsoft_storage_sync.models.Reason :ivar istransitioning: Is Transitioning. :vartype istransitioning: bool :param properties: Subscription state properties. @@ -2406,7 +2408,7 @@ def __init__( self.properties = properties -class SyncGroup(ProxyResource): +class SyncGroup(Resource): """Sync Group object. Variables are only populated by the server, and will be ignored when sending a request. @@ -2454,7 +2456,7 @@ class SyncGroupArray(msrest.serialization.Model): """Array of SyncGroup. :param value: Collection of SyncGroup. - :type value: list[~azure.mgmt.storagesync.models.SyncGroup] + :type value: list[~microsoft_storage_sync.models.SyncGroup] """ _attribute_map = { @@ -2471,7 +2473,7 @@ def __init__( self.value = value -class SyncGroupCreateParameters(ProxyResource): +class SyncGroupCreateParameters(Resource): """The parameters used when creating a sync group. Variables are only populated by the server, and will be ignored when sending a request. @@ -2519,7 +2521,7 @@ class TriggerChangeDetectionParameters(msrest.serialization.Model): :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 ~azure.mgmt.storagesync.models.ChangeDetectionMode + :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] @@ -2566,7 +2568,7 @@ def __init__( self.server_certificate = server_certificate -class Workflow(ProxyResource): +class Workflow(Resource): """Workflow resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -2583,9 +2585,9 @@ class Workflow(ProxyResource): :type last_step_name: str :param status: workflow status. Possible values include: "active", "expired", "succeeded", "aborted", "failed". - :type status: str or ~azure.mgmt.storagesync.models.WorkflowStatus + :type status: str or ~microsoft_storage_sync.models.WorkflowStatus :param operation: operation direction. Possible values include: "do", "undo", "cancel". - :type operation: str or ~azure.mgmt.storagesync.models.OperationDirection + :type operation: str or ~microsoft_storage_sync.models.OperationDirection :param steps: workflow steps. :type steps: str :param last_operation_id: workflow last operation identifier. @@ -2631,7 +2633,7 @@ class WorkflowArray(msrest.serialization.Model): """Array of Workflow. :param value: Collection of workflow items. - :type value: list[~azure.mgmt.storagesync.models.Workflow] + :type value: list[~microsoft_storage_sync.models.Workflow] """ _attribute_map = { 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 index af70197f1f2..ab5cc6338c3 100644 --- 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 @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class CloudEndpointOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,14 +61,15 @@ def _create_initial( ): # type: (...) -> "models.CloudEndpoint" cls = kwargs.pop('cls', None) # type: ClsType["models.CloudEndpoint"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.CloudEndpointCreateParameters(storage_account_resource_id=storage_account_resource_id, azure_file_share_name=azure_file_share_name, storage_account_tenant_id=storage_account_tenant_id, friendly_name=friendly_name) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -116,10 +117,10 @@ def _create_initial( 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 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}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} # type: ignore def begin_create( self, @@ -133,7 +134,7 @@ def begin_create( friendly_name=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.CloudEndpoint" + # type: (...) -> LROPoller """Create a new CloudEndpoint. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -156,13 +157,17 @@ def begin_create( :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[~azure.mgmt.storagesync.models.CloudEndpoint] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either CloudEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.CloudEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.CloudEndpoint"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._create_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -176,6 +181,9 @@ def begin_create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response @@ -187,15 +195,11 @@ def get_long_running_output(pipeline_response): 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}'} + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} # type: ignore def get( self, @@ -217,16 +221,17 @@ def get( :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: ~azure.mgmt.storagesync.models.CloudEndpoint + :return: CloudEndpoint, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.CloudEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CloudEndpoint"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -260,10 +265,10 @@ def get( deserialized = self._deserialize('CloudEndpoint', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + 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}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} # type: ignore def _delete_initial( self, @@ -275,11 +280,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -319,9 +325,9 @@ def _delete_initial( 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) + return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} # type: ignore def begin_delete( self, @@ -331,7 +337,7 @@ def begin_delete( cloud_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Delete a given CloudEndpoint. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -346,13 +352,17 @@ def begin_delete( :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -362,19 +372,18 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}'} # type: ignore def list_by_sync_group( self, @@ -383,7 +392,7 @@ def list_by_sync_group( sync_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.CloudEndpointArray" + # type: (...) -> Iterable["models.CloudEndpointArray"] """Get a CloudEndpoint List. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -393,18 +402,19 @@ def list_by_sync_group( :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: ~azure.mgmt.storagesync.models.CloudEndpointArray + :return: An iterator like instance of either CloudEndpointArray or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~microsoft_storage_sync.models.CloudEndpointArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CloudEndpointArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_sync_group.metadata['url'] + url = self.list_by_sync_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -412,13 +422,13 @@ def prepare_request(next_link=None): 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -450,7 +460,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_sync_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints'} + list_by_sync_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints'} # type: ignore def _pre_backup_initial( self, @@ -463,14 +473,15 @@ def _pre_backup_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.BackupRequest(azure_file_share=azure_file_share) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._pre_backup_initial.metadata['url'] + url = self._pre_backup_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -514,9 +525,9 @@ def _pre_backup_initial( 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) + 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'} + _pre_backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup'} # type: ignore def begin_pre_backup( self, @@ -527,7 +538,7 @@ def begin_pre_backup( azure_file_share=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Pre Backup a given CloudEndpoint. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -544,13 +555,17 @@ def begin_pre_backup( :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._pre_backup_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -561,19 +576,18 @@ def begin_pre_backup( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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'} + begin_pre_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup'} # type: ignore def _post_backup_initial( self, @@ -586,14 +600,15 @@ def _post_backup_initial( ): # type: (...) -> "models.PostBackupResponse" cls = kwargs.pop('cls', None) # type: ClsType["models.PostBackupResponse"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.BackupRequest(azure_file_share=azure_file_share) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._post_backup_initial.metadata['url'] + url = self._post_backup_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -640,10 +655,10 @@ def _post_backup_initial( 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 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'} + _post_backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup'} # type: ignore def begin_post_backup( self, @@ -654,7 +669,7 @@ def begin_post_backup( azure_file_share=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PostBackupResponse" + # type: (...) -> LROPoller """Post Backup a given CloudEndpoint. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -671,13 +686,17 @@ def begin_post_backup( :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[~azure.mgmt.storagesync.models.PostBackupResponse] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PostBackupResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.PostBackupResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.PostBackupResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._post_backup_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -688,6 +707,9 @@ def begin_post_backup( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response @@ -700,15 +722,11 @@ def get_long_running_output(pipeline_response): 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'} + begin_post_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup'} # type: ignore def _pre_restore_initial( self, @@ -723,20 +741,21 @@ def _pre_restore_initial( status=None, # type: Optional[str] source_azure_file_share_uri=None, # type: Optional[str] backup_metadata_property_bag=None, # type: Optional[str] - restore_file_spec=None, # type: Optional[List["RestoreFileSpec"]] + restore_file_spec=None, # type: Optional[List["models.RestoreFileSpec"]] pause_wait_for_sync_drain_time_period_in_seconds=None, # type: Optional[int] **kwargs # type: Any ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.PreRestoreRequest(partition=partition, replica_group=replica_group, request_id=request_id_parameter, azure_file_share_uri=azure_file_share_uri, status=status, source_azure_file_share_uri=source_azure_file_share_uri, backup_metadata_property_bag=backup_metadata_property_bag, restore_file_spec=restore_file_spec, pause_wait_for_sync_drain_time_period_in_seconds=pause_wait_for_sync_drain_time_period_in_seconds) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._pre_restore_initial.metadata['url'] + url = self._pre_restore_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -775,9 +794,9 @@ def _pre_restore_initial( 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) + 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'} + _pre_restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore'} # type: ignore def begin_pre_restore( self, @@ -792,11 +811,11 @@ def begin_pre_restore( status=None, # type: Optional[str] source_azure_file_share_uri=None, # type: Optional[str] backup_metadata_property_bag=None, # type: Optional[str] - restore_file_spec=None, # type: Optional[List["RestoreFileSpec"]] + restore_file_spec=None, # type: Optional[List["models.RestoreFileSpec"]] pause_wait_for_sync_drain_time_period_in_seconds=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Pre Restore a given CloudEndpoint. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -822,7 +841,7 @@ def begin_pre_restore( :param backup_metadata_property_bag: Pre Restore backup metadata property bag. :type backup_metadata_property_bag: str :param restore_file_spec: Pre Restore restore file spec array. - :type restore_file_spec: list[~azure.mgmt.storagesync.models.RestoreFileSpec] + :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 @@ -830,13 +849,17 @@ def begin_pre_restore( :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._pre_restore_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -855,19 +878,18 @@ def begin_pre_restore( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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'} + begin_pre_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore'} # type: ignore def restoreheartbeat( self, @@ -889,16 +911,17 @@ def restoreheartbeat( :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) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.restoreheartbeat.metadata['url'] + url = self.restoreheartbeat.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -930,9 +953,9 @@ def restoreheartbeat( 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) + return cls(pipeline_response, None, response_headers) - restoreheartbeat.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/restoreheartbeat'} + restoreheartbeat.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/restoreheartbeat'} # type: ignore def _post_restore_initial( self, @@ -947,19 +970,20 @@ def _post_restore_initial( status=None, # type: Optional[str] source_azure_file_share_uri=None, # type: Optional[str] failed_file_list=None, # type: Optional[str] - restore_file_spec=None, # type: Optional[List["RestoreFileSpec"]] + restore_file_spec=None, # type: Optional[List["models.RestoreFileSpec"]] **kwargs # type: Any ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.PostRestoreRequest(partition=partition, replica_group=replica_group, request_id=request_id_parameter, azure_file_share_uri=azure_file_share_uri, status=status, source_azure_file_share_uri=source_azure_file_share_uri, failed_file_list=failed_file_list, restore_file_spec=restore_file_spec) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._post_restore_initial.metadata['url'] + url = self._post_restore_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -998,9 +1022,9 @@ def _post_restore_initial( 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) + 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'} + _post_restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore'} # type: ignore def begin_post_restore( self, @@ -1015,10 +1039,10 @@ def begin_post_restore( status=None, # type: Optional[str] source_azure_file_share_uri=None, # type: Optional[str] failed_file_list=None, # type: Optional[str] - restore_file_spec=None, # type: Optional[List["RestoreFileSpec"]] + restore_file_spec=None, # type: Optional[List["models.RestoreFileSpec"]] **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Post Restore a given CloudEndpoint. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -1044,18 +1068,22 @@ def begin_post_restore( :param failed_file_list: Post Restore Azure failed file list. :type failed_file_list: str :param restore_file_spec: Post Restore restore file spec array. - :type restore_file_spec: list[~azure.mgmt.storagesync.models.RestoreFileSpec] + :type restore_file_spec: list[~microsoft_storage_sync.models.RestoreFileSpec] :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._post_restore_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -1073,19 +1101,18 @@ def begin_post_restore( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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'} + begin_post_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore'} # type: ignore def _trigger_change_detection_initial( self, @@ -1100,14 +1127,15 @@ def _trigger_change_detection_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.TriggerChangeDetectionParameters(directory_path=directory_path, change_detection_mode=change_detection_mode, paths=paths) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._trigger_change_detection_initial.metadata['url'] + url = self._trigger_change_detection_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -1146,9 +1174,9 @@ def _trigger_change_detection_initial( 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) + 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'} + _trigger_change_detection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/triggerChangeDetection'} # type: ignore def begin_trigger_change_detection( self, @@ -1161,7 +1189,7 @@ def begin_trigger_change_detection( paths=None, # type: Optional[List[str]] **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """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. @@ -1177,7 +1205,7 @@ def begin_trigger_change_detection( :type directory_path: str :param change_detection_mode: Change Detection Mode. Applies to a directory specified in directoryPath parameter. - :type change_detection_mode: str or ~azure.mgmt.storagesync.models.ChangeDetectionMode + :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] @@ -1185,13 +1213,17 @@ def begin_trigger_change_detection( :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._trigger_change_detection_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -1204,16 +1236,15 @@ def begin_trigger_change_detection( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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'} + begin_trigger_change_detection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/triggerChangeDetection'} # type: ignore 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 index ea39945c8df..e5d8254fd10 100644 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_operation_operations.py +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_operation_operations.py @@ -18,7 +18,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -30,7 +30,7 @@ class OperationOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -49,29 +49,30 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> "models.OperationEntityListResult" + # type: (...) -> Iterable["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: ~azure.mgmt.storagesync.models.OperationEntityListResult + :return: An iterator like instance of either OperationEntityListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~microsoft_storage_sync.models.OperationEntityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationEntityListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -103,4 +104,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.StorageSync/operations'} + list.metadata = {'url': '/providers/Microsoft.StorageSync/operations'} # type: ignore 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 index a3bba402f5b..6baf2bcba6d 100644 --- 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 @@ -29,7 +29,7 @@ class OperationStatusOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,16 +64,17 @@ def get( :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: ~azure.mgmt.storagesync.models.OperationStatus + :return: OperationStatus, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.OperationStatus :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatus"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -107,7 +108,7 @@ def get( deserialized = self._deserialize('OperationStatus', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + 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}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/locations/{locationName}/workflows/{workflowId}/operations/{operationId}'} # type: ignore diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_private_endpoint_connection_operations.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_private_endpoint_connection_operations.py index d4d9caf828d..61066ffc1ad 100644 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_private_endpoint_connection_operations.py +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_private_endpoint_connection_operations.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PrivateEndpointConnectionOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,16 +66,17 @@ def get( with the Azure resource. :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.storagesync.models.PrivateEndpointConnection + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), @@ -105,10 +106,10 @@ def get( deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore def _create_initial( self, @@ -121,14 +122,15 @@ def _create_initial( ): # type: (...) -> "models.PrivateEndpointConnection" cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _properties = models.PrivateEndpointConnection(private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), @@ -173,10 +175,10 @@ def _create_initial( 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 cls(pipeline_response, deserialized, response_headers) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore def begin_create( self, @@ -187,7 +189,7 @@ def begin_create( private_link_service_connection_state=None, # type: Optional["models.PrivateLinkServiceConnectionState"] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> LROPoller """Update the state of specified private endpoint connection associated with the storage sync service. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -199,21 +201,25 @@ def begin_create( with the Azure resource. :type private_endpoint_connection_name: str :param private_endpoint: The resource of private end point. - :type private_endpoint: ~azure.mgmt.storagesync.models.PrivateEndpoint + :type private_endpoint: ~microsoft_storage_sync.models.PrivateEndpoint :param private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. - :type private_link_service_connection_state: ~azure.mgmt.storagesync.models.PrivateLinkServiceConnectionState + :type private_link_service_connection_state: ~microsoft_storage_sync.models.PrivateLinkServiceConnectionState :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 PrivateEndpointConnection - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storagesync.models.PrivateEndpointConnection] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._create_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -224,6 +230,9 @@ def begin_create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -231,15 +240,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) 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}/privateEndpointConnections/{privateEndpointConnectionName}'} + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore def _delete_initial( self, @@ -250,11 +255,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), @@ -289,9 +295,9 @@ def _delete_initial( 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) + return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore def begin_delete( self, @@ -300,7 +306,7 @@ def begin_delete( private_endpoint_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Deletes the specified private endpoint connection associated with the storage sync service. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -315,13 +321,17 @@ def begin_delete( :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -330,19 +340,18 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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}/privateEndpointConnections/{privateEndpointConnectionName}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore def list_by_storage_sync_service( self, @@ -350,7 +359,7 @@ def list_by_storage_sync_service( storage_sync_service_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnectionListResult" + # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] """Get a PrivateEndpointConnection List. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -358,31 +367,32 @@ def list_by_storage_sync_service( :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: PrivateEndpointConnectionListResult or the result of cls(response) - :rtype: ~azure.mgmt.storagesync.models.PrivateEndpointConnectionListResult + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~microsoft_storage_sync.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_storage_sync_service.metadata['url'] + url = self.list_by_storage_sync_service.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -414,4 +424,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections'} + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections'} # type: ignore diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_private_link_resource_operations.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_private_link_resource_operations.py index a6532d2b66b..9a291e68c68 100644 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_private_link_resource_operations.py +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_private_link_resource_operations.py @@ -29,7 +29,7 @@ class PrivateLinkResourceOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,16 +59,17 @@ def list_by_storage_sync_service( specified resource group. :type storage_sync_service_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkResourceListResult or the result of cls(response) - :rtype: ~azure.mgmt.storagesync.models.PrivateLinkResourceListResult + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.list_by_storage_sync_service.metadata['url'] + url = self.list_by_storage_sync_service.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), @@ -96,7 +97,7 @@ def list_by_storage_sync_service( deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateLinkResources'} + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateLinkResources'} # type: ignore 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 index e0fbef6a447..0e8a86a7fe3 100644 --- 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 @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class RegisteredServerOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -53,7 +53,7 @@ def list_by_storage_sync_service( storage_sync_service_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RegisteredServerArray" + # type: (...) -> Iterable["models.RegisteredServerArray"] """Get a given registered server list. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -61,31 +61,32 @@ def list_by_storage_sync_service( :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: ~azure.mgmt.storagesync.models.RegisteredServerArray + :return: An iterator like instance of either RegisteredServerArray or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~microsoft_storage_sync.models.RegisteredServerArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RegisteredServerArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_storage_sync_service.metadata['url'] + url = self.list_by_storage_sync_service.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -117,7 +118,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers'} + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers'} # type: ignore def get( self, @@ -136,16 +137,17 @@ def get( :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: ~azure.mgmt.storagesync.models.RegisteredServer + :return: RegisteredServer, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.RegisteredServer :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.RegisteredServer"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -178,10 +180,10 @@ def get( deserialized = self._deserialize('RegisteredServer', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} # type: ignore def _create_initial( self, @@ -201,14 +203,15 @@ def _create_initial( ): # type: (...) -> "models.RegisteredServer" cls = kwargs.pop('cls', None) # type: ClsType["models.RegisteredServer"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.RegisteredServerCreateParameters(server_certificate=server_certificate, agent_version=agent_version, server_os_version=server_os_version, last_heart_beat=last_heart_beat, server_role=server_role, cluster_id=cluster_id, cluster_name=cluster_name, server_id=registered_server_create_parameters_properties_server_id, friendly_name=friendly_name) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -254,10 +257,10 @@ def _create_initial( 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 cls(pipeline_response, deserialized, response_headers) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} # type: ignore def begin_create( self, @@ -275,7 +278,7 @@ def begin_create( friendly_name=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RegisteredServer" + # type: (...) -> LROPoller """Add a new registered server. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -306,13 +309,17 @@ def begin_create( :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[~azure.mgmt.storagesync.models.RegisteredServer] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RegisteredServer or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.RegisteredServer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.RegisteredServer"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._create_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -330,6 +337,9 @@ def begin_create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response @@ -341,15 +351,11 @@ def get_long_running_output(pipeline_response): 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}'} + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} # type: ignore def _delete_initial( self, @@ -360,11 +366,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -401,9 +408,9 @@ def _delete_initial( 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) + return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} # type: ignore def begin_delete( self, @@ -412,7 +419,7 @@ def begin_delete( server_id, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Delete the given registered server. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -425,13 +432,17 @@ def begin_delete( :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -440,19 +451,18 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}'} # type: ignore def _trigger_rollover_initial( self, @@ -464,14 +474,15 @@ def _trigger_rollover_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.TriggerRolloverRequest(server_certificate=server_certificate) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._trigger_rollover_initial.metadata['url'] + url = self._trigger_rollover_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -513,9 +524,9 @@ def _trigger_rollover_initial( 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) + return cls(pipeline_response, None, response_headers) - _trigger_rollover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover'} + _trigger_rollover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover'} # type: ignore def begin_trigger_rollover( self, @@ -525,7 +536,7 @@ def begin_trigger_rollover( server_certificate=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Triggers Server certificate rollover. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -540,13 +551,17 @@ def begin_trigger_rollover( :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._trigger_rollover_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -556,16 +571,15 @@ def begin_trigger_rollover( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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'} + begin_trigger_rollover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover'} # type: ignore 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 index 5cbea549bf4..e4128eb96fa 100644 --- 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 @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServerEndpointOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -67,14 +67,15 @@ def _create_initial( ): # type: (...) -> "models.ServerEndpoint" cls = kwargs.pop('cls', None) # type: ClsType["models.ServerEndpoint"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.ServerEndpointCreateParameters(server_local_path=server_local_path, cloud_tiering=cloud_tiering, volume_free_space_percent=volume_free_space_percent, tier_files_older_than_days=tier_files_older_than_days, friendly_name=friendly_name, server_resource_id=server_resource_id, offline_data_transfer=offline_data_transfer, offline_data_transfer_share_name=offline_data_transfer_share_name, initial_download_policy=initial_download_policy, local_cache_mode=local_cache_mode) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -121,10 +122,10 @@ def _create_initial( 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 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}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore def begin_create( self, @@ -144,7 +145,7 @@ def begin_create( local_cache_mode=None, # type: Optional[Union[str, "models.LocalCacheMode"]] **kwargs # type: Any ): - # type: (...) -> "models.ServerEndpoint" + # type: (...) -> LROPoller """Create a new ServerEndpoint. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -158,7 +159,7 @@ def begin_create( :param server_local_path: Server Local path. :type server_local_path: str :param cloud_tiering: Cloud Tiering. - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 @@ -169,25 +170,29 @@ def begin_create( :param server_resource_id: Server Resource Id. :type server_resource_id: str :param offline_data_transfer: Offline data transfer. - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 :param initial_download_policy: Policy for how namespace and files are recalled during FastDr. - :type initial_download_policy: str or ~azure.mgmt.storagesync.models.InitialDownloadPolicy + :type initial_download_policy: str or ~microsoft_storage_sync.models.InitialDownloadPolicy :param local_cache_mode: Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. - :type local_cache_mode: str or ~azure.mgmt.storagesync.models.LocalCacheMode + :type local_cache_mode: str or ~microsoft_storage_sync.models.LocalCacheMode :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[~azure.mgmt.storagesync.models.ServerEndpoint] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ServerEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.ServerEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.ServerEndpoint"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._create_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -207,6 +212,9 @@ def begin_create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response @@ -218,15 +226,11 @@ def get_long_running_output(pipeline_response): 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}'} + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore def _update_initial( self, @@ -244,14 +248,15 @@ def _update_initial( ): # type: (...) -> "models.ServerEndpoint" cls = kwargs.pop('cls', None) # type: ClsType["models.ServerEndpoint"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.ServerEndpointUpdateParameters(cloud_tiering=cloud_tiering, volume_free_space_percent=volume_free_space_percent, tier_files_older_than_days=tier_files_older_than_days, offline_data_transfer=offline_data_transfer, offline_data_transfer_share_name=offline_data_transfer_share_name, local_cache_mode=local_cache_mode) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._update_initial.metadata['url'] + url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -301,10 +306,10 @@ def _update_initial( 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 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}'} + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore def begin_update( self, @@ -320,7 +325,7 @@ def begin_update( local_cache_mode=None, # type: Optional[Union[str, "models.LocalCacheMode"]] **kwargs # type: Any ): - # type: (...) -> "models.ServerEndpoint" + # type: (...) -> LROPoller """Patch a given ServerEndpoint. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -332,30 +337,34 @@ def begin_update( :param server_endpoint_name: Name of Server Endpoint object. :type server_endpoint_name: str :param cloud_tiering: Cloud Tiering. - :type cloud_tiering: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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: Offline data transfer. - :type offline_data_transfer: str or ~azure.mgmt.storagesync.models.FeatureStatus + :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 :param local_cache_mode: Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. - :type local_cache_mode: str or ~azure.mgmt.storagesync.models.LocalCacheMode + :type local_cache_mode: str or ~microsoft_storage_sync.models.LocalCacheMode :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[~azure.mgmt.storagesync.models.ServerEndpoint] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ServerEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.ServerEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.ServerEndpoint"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._update_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -371,6 +380,9 @@ def begin_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response @@ -382,15 +394,11 @@ def get_long_running_output(pipeline_response): 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}'} + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore def get( self, @@ -412,16 +420,17 @@ def get( :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: ~azure.mgmt.storagesync.models.ServerEndpoint + :return: ServerEndpoint, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.ServerEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServerEndpoint"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -455,10 +464,10 @@ def get( deserialized = self._deserialize('ServerEndpoint', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + 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}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore def _delete_initial( self, @@ -470,11 +479,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -512,9 +522,9 @@ def _delete_initial( 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) + return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore def begin_delete( self, @@ -524,7 +534,7 @@ def begin_delete( server_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Delete a given ServerEndpoint. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -539,13 +549,17 @@ def begin_delete( :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -555,19 +569,18 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}'} # type: ignore def list_by_sync_group( self, @@ -576,7 +589,7 @@ def list_by_sync_group( sync_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServerEndpointArray" + # type: (...) -> Iterable["models.ServerEndpointArray"] """Get a ServerEndpoint list. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -586,18 +599,19 @@ def list_by_sync_group( :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: ~azure.mgmt.storagesync.models.ServerEndpointArray + :return: An iterator like instance of either ServerEndpointArray or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~microsoft_storage_sync.models.ServerEndpointArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServerEndpointArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_sync_group.metadata['url'] + url = self.list_by_sync_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -605,13 +619,13 @@ def prepare_request(next_link=None): 'syncGroupName': self._serialize.url("sync_group_name", sync_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -643,7 +657,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_sync_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints'} + list_by_sync_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints'} # type: ignore def _recall_action_initial( self, @@ -657,14 +671,15 @@ def _recall_action_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.RecallActionParameters(pattern=pattern, recall_path=recall_path) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._recall_action_initial.metadata['url'] + url = self._recall_action_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -707,9 +722,9 @@ def _recall_action_initial( 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) + 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'} + _recall_action_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction'} # type: ignore def begin_recall_action( self, @@ -721,7 +736,7 @@ def begin_recall_action( recall_path=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Recall a server endpoint. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -740,13 +755,17 @@ def begin_recall_action( :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._recall_action_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -758,16 +777,15 @@ def begin_recall_action( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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'} + begin_recall_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction'} # type: ignore 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 index 6a8ed02c229..f08e39a3770 100644 --- 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 @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class StorageSyncServiceOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,19 +61,20 @@ def check_name_availability( :param name: The name to check for availability. :type name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.storagesync.models.CheckNameAvailabilityResult + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.CheckNameAvailabilityParameters(name=name) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_name_availability.metadata['url'] + url = self.check_name_availability.metadata['url'] # type: ignore 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), @@ -105,10 +106,10 @@ def check_name_availability( deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/checkNameAvailability'} + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/checkNameAvailability'} # type: ignore def _create_initial( self, @@ -121,14 +122,15 @@ def _create_initial( ): # type: (...) -> "models.StorageSyncService" cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncService"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.StorageSyncServiceCreateParameters(location=location, tags=tags, incoming_traffic_policy=incoming_traffic_policy) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -172,10 +174,10 @@ def _create_initial( 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 cls(pipeline_response, deserialized, response_headers) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore def begin_create( self, @@ -186,7 +188,7 @@ def begin_create( incoming_traffic_policy=None, # type: Optional[Union[str, "models.IncomingTrafficPolicy"]] **kwargs # type: Any ): - # type: (...) -> "models.StorageSyncService" + # type: (...) -> LROPoller """Create a new StorageSyncService. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -204,18 +206,22 @@ def begin_create( characters and a value with a length no greater than 256 characters. :type tags: dict[str, str] :param incoming_traffic_policy: Incoming Traffic Policy. - :type incoming_traffic_policy: str or ~azure.mgmt.storagesync.models.IncomingTrafficPolicy + :type incoming_traffic_policy: str or ~microsoft_storage_sync.models.IncomingTrafficPolicy :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 StorageSyncService - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storagesync.models.StorageSyncService] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either StorageSyncService or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.StorageSyncService] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncService"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._create_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -226,6 +232,9 @@ def begin_create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('StorageSyncService', pipeline_response) @@ -233,15 +242,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) 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}'} + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore def get( self, @@ -257,16 +262,17 @@ def get( :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: ~azure.mgmt.storagesync.models.StorageSyncService + :return: StorageSyncService, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.StorageSyncService :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncService"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -298,10 +304,10 @@ def get( deserialized = self._deserialize('StorageSyncService', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore def _update_initial( self, @@ -313,14 +319,15 @@ def _update_initial( ): # type: (...) -> "models.StorageSyncService" cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncService"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.StorageSyncServiceUpdateParameters(tags=tags, incoming_traffic_policy=incoming_traffic_policy) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._update_initial.metadata['url'] + url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -369,10 +376,10 @@ def _update_initial( 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 cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore def begin_update( self, @@ -382,7 +389,7 @@ def begin_update( incoming_traffic_policy=None, # type: Optional[Union[str, "models.IncomingTrafficPolicy"]] **kwargs # type: Any ): - # type: (...) -> "models.StorageSyncService" + # type: (...) -> LROPoller """Patch a given StorageSyncService. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -392,18 +399,22 @@ def begin_update( :param tags: The user-specified tags associated with the storage sync service. :type tags: dict[str, str] :param incoming_traffic_policy: Incoming Traffic Policy. - :type incoming_traffic_policy: str or ~azure.mgmt.storagesync.models.IncomingTrafficPolicy + :type incoming_traffic_policy: str or ~microsoft_storage_sync.models.IncomingTrafficPolicy :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 StorageSyncService - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storagesync.models.StorageSyncService] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either StorageSyncService or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~microsoft_storage_sync.models.StorageSyncService] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncService"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._update_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -413,6 +424,9 @@ def begin_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response @@ -424,15 +438,11 @@ def get_long_running_output(pipeline_response): 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}'} + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore def _delete_initial( self, @@ -442,11 +452,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -484,9 +495,9 @@ def _delete_initial( 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) + return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore def begin_delete( self, @@ -494,7 +505,7 @@ def begin_delete( storage_sync_service_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Delete a given StorageSyncService. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -505,13 +516,17 @@ def begin_delete( :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, storage_sync_service_name=storage_sync_service_name, @@ -519,55 +534,55 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + 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}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}'} # type: ignore def list_by_resource_group( self, resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageSyncServiceArray" + # type: (...) -> Iterable["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: ~azure.mgmt.storagesync.models.StorageSyncServiceArray + :return: An iterator like instance of either StorageSyncServiceArray or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~microsoft_storage_sync.models.StorageSyncServiceArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncServiceArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_resource_group.metadata['url'] + url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -599,39 +614,40 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices'} + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices'} # type: ignore def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.StorageSyncServiceArray" + # type: (...) -> Iterable["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: ~azure.mgmt.storagesync.models.StorageSyncServiceArray + :return: An iterator like instance of either StorageSyncServiceArray or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~microsoft_storage_sync.models.StorageSyncServiceArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSyncServiceArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_subscription.metadata['url'] + url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -663,4 +679,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/storageSyncServices'} + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/storageSyncServices'} # type: ignore 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 index f184b95dc74..a3e206dbc3f 100644 --- 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 @@ -18,7 +18,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -30,7 +30,7 @@ class SyncGroupOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -51,7 +51,7 @@ def list_by_storage_sync_service( storage_sync_service_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SyncGroupArray" + # type: (...) -> Iterable["models.SyncGroupArray"] """Get a SyncGroup List. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -59,31 +59,32 @@ def list_by_storage_sync_service( :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: ~azure.mgmt.storagesync.models.SyncGroupArray + :return: An iterator like instance of either SyncGroupArray or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~microsoft_storage_sync.models.SyncGroupArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SyncGroupArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_storage_sync_service.metadata['url'] + url = self.list_by_storage_sync_service.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -115,7 +116,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups'} + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups'} # type: ignore def create( self, @@ -137,19 +138,20 @@ def create( :param properties: The parameters used to create the sync group. :type properties: object :keyword callable cls: A custom type or function that will be passed the direct response - :return: SyncGroup or the result of cls(response) - :rtype: ~azure.mgmt.storagesync.models.SyncGroup + :return: SyncGroup, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.SyncGroup :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SyncGroup"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.SyncGroupCreateParameters(properties=properties) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self.create.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -187,10 +189,10 @@ def create( deserialized = self._deserialize('SyncGroup', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} # type: ignore def get( self, @@ -209,16 +211,17 @@ def get( :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: ~azure.mgmt.storagesync.models.SyncGroup + :return: SyncGroup, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.SyncGroup :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SyncGroup"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -251,10 +254,10 @@ def get( deserialized = self._deserialize('SyncGroup', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} # type: ignore def delete( self, @@ -273,16 +276,17 @@ def delete( :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) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.delete.metadata['url'] + url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -314,6 +318,6 @@ def delete( 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) + return cls(pipeline_response, None, response_headers) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}'} # type: ignore 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 index 6c72459d457..bfbf489058b 100644 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_workflow_operations.py +++ b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/operations/_workflow_operations.py @@ -18,7 +18,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -30,7 +30,7 @@ class WorkflowOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.storagesync.models + :type models: ~microsoft_storage_sync.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -51,7 +51,7 @@ def list_by_storage_sync_service( storage_sync_service_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WorkflowArray" + # type: (...) -> Iterable["models.WorkflowArray"] """Get a Workflow List. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -59,31 +59,32 @@ def list_by_storage_sync_service( :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: ~azure.mgmt.storagesync.models.WorkflowArray + :return: An iterator like instance of either WorkflowArray or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~microsoft_storage_sync.models.WorkflowArray] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowArray"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_storage_sync_service.metadata['url'] + url = self.list_by_storage_sync_service.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'storageSyncServiceName': self._serialize.url("storage_sync_service_name", storage_sync_service_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -115,7 +116,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows'} + list_by_storage_sync_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows'} # type: ignore def get( self, @@ -134,16 +135,17 @@ def get( :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: ~azure.mgmt.storagesync.models.Workflow + :return: Workflow, or the result of cls(response) + :rtype: ~microsoft_storage_sync.models.Workflow :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Workflow"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -176,10 +178,10 @@ def get( deserialized = self._deserialize('Workflow', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}'} # type: ignore def abort( self, @@ -198,16 +200,17 @@ def abort( :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) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" # Construct URL - url = self.abort.metadata['url'] + url = self.abort.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -238,6 +241,6 @@ def abort( 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) + return cls(pipeline_response, None, response_headers) - abort.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}/abort'} + abort.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}/abort'} # type: ignore diff --git a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/setup.py b/src/storagesync/azext_storagesync/vendored_sdks/storagesync/setup.py deleted file mode 100644 index 0ed28f1e938..00000000000 --- a/src/storagesync/azext_storagesync/vendored_sdks/storagesync/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -# coding: utf-8 - -from setuptools import setup, find_packages - -NAME = "microsoftstoragesync" -VERSION = "1.0.0" - -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["msrest>=0.6.0", "azure-core<2.0.0,>=1.2.0"] - -setup( - name=NAME, - version=VERSION, - description="MicrosoftStorageSync", - author_email="", - url="", - keywords=["Swagger", "MicrosoftStorageSync"], - install_requires=REQUIRES, - packages=find_packages(), - include_package_data=True, - long_description="""\ - Microsoft Storage Sync Service API. - """ -) diff --git a/src/storagesync/report.md b/src/storagesync/report.md index 8fcb728cd8f..14e7d088e76 100644 --- a/src/storagesync/report.md +++ b/src/storagesync/report.md @@ -144,7 +144,6 @@ create a storagesync private-endpoint-connection. |**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name| |**--storage-sync-service-name**|string|The name of the storage sync service name within the specified resource group.|storage_sync_service_name| |**--private-endpoint-connection-name**|string|The name of the private endpoint connection associated with the Azure resource|private_endpoint_connection_name| -|**--private-endpoint**|object|The resource of private end point.|private_endpoint| |**--private-link-service-connection-state**|object|A collection of information about the state of the connection between service consumer and provider.|private_link_service_connection_state| ### storagesync private-endpoint-connection delete @@ -252,8 +251,8 @@ create a storagesync server-endpoint. |**--server-resource-id**|string|Server Resource Id.|server_resource_id| |**--offline-data-transfer**|choice|Offline data transfer|offline_data_transfer| |**--offline-data-transfer-share-name**|string|Offline data transfer share name|offline_data_transfer_share_name| -|**--initial-download-policy**|sealed-choice|Policy for how namespace and files are recalled during FastDr.|initial_download_policy| -|**--local-cache-mode**|sealed-choice|Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access.|local_cache_mode| +|**--initial-download-policy**|choice|Policy for how namespace and files are recalled during FastDr.|initial_download_policy| +|**--local-cache-mode**|choice|Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access.|local_cache_mode| ### storagesync server-endpoint delete delete a storagesync server-endpoint. @@ -310,7 +309,7 @@ update a storagesync server-endpoint. |**--tier-files-older-than-days**|integer|Tier files older than days.|tier_files_older_than_days| |**--offline-data-transfer**|choice|Offline data transfer|offline_data_transfer| |**--offline-data-transfer-share-name**|string|Offline data transfer share name|offline_data_transfer_share_name| -|**--local-cache-mode**|sealed-choice|Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access.|local_cache_mode| +|**--local-cache-mode**|choice|Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access.|local_cache_mode| ### storagesync storage-sync-service create create a storagesync storage-sync-service. diff --git a/src/storagesync/setup.py b/src/storagesync/setup.py index 91cd4229583..5ceddbc951e 100644 --- a/src/storagesync/setup.py +++ b/src/storagesync/setup.py @@ -9,9 +9,12 @@ from codecs import open from setuptools import setup, find_packages -# TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. VERSION = '0.1.0' +try: + from .manual.version import VERSION +except ImportError: + pass # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -27,8 +30,11 @@ 'License :: OSI Approved :: MIT License', ] -# TODO: Add any additional SDK dependencies here DEPENDENCIES = [] +try: + from .manual.dependency import DEPENDENCIES +except ImportError: + pass with open('README.md', 'r', encoding='utf-8') as f: README = f.read() @@ -39,11 +45,9 @@ 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', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/storagesync', long_description=README + '\n\n' + HISTORY, license='MIT', classifiers=CLASSIFIERS,