diff --git a/src/databox/azext_databox/__init__.py b/src/databox/azext_databox/__init__.py index f7ea258697c..d4314b0a3a4 100644 --- a/src/databox/azext_databox/__init__.py +++ b/src/databox/azext_databox/__init__.py @@ -1,32 +1,50 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- from azure.cli.core import AzCommandsLoader +from azext_databox.generated._help import helps # pylint: disable=unused-import +try: + from azext_databox.manual._help import helps # pylint: disable=reimported +except ImportError: + pass -import azext_databox._help # pylint: disable=unused-import - -class DataBoxCommandsLoader(AzCommandsLoader): +class DataBoxManagementClientCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType - from azext_databox._client_factory import cf_databox + from azext_databox.generated._client_factory import cf_databox_cl databox_custom = CliCommandType( operations_tmpl='azext_databox.custom#{}', - client_factory=cf_databox) - super(DataBoxCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=databox_custom) + client_factory=cf_databox_cl) + parent = super(DataBoxManagementClientCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=databox_custom) def load_command_table(self, args): - from azext_databox.commands import load_command_table + from azext_databox.generated.commands import load_command_table load_command_table(self, args) + try: + from azext_databox.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass return self.command_table def load_arguments(self, command): - from azext_databox._params import load_arguments + from azext_databox.generated._params import load_arguments load_arguments(self, command) + try: + from azext_databox.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass -COMMAND_LOADER_CLS = DataBoxCommandsLoader +COMMAND_LOADER_CLS = DataBoxManagementClientCommandsLoader diff --git a/src/databox/azext_databox/_client_factory.py b/src/databox/azext_databox/_client_factory.py deleted file mode 100644 index 441837babe7..00000000000 --- a/src/databox/azext_databox/_client_factory.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -def cf_databox(cli_ctx, *_): - from azure.cli.core.commands.client_factory import get_mgmt_service_client - from azext_databox.vendored_sdks.databox import DataBoxManagementClient - return get_mgmt_service_client(cli_ctx, DataBoxManagementClient) - - -def cf_jobs(cli_ctx, *_): - return cf_databox(cli_ctx).jobs diff --git a/src/databox/azext_databox/_help.py b/src/databox/azext_databox/_help.py deleted file mode 100644 index 0c8d9cad8f8..00000000000 --- a/src/databox/azext_databox/_help.py +++ /dev/null @@ -1,101 +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. -# -------------------------------------------------------------------------------------------- - -# pylint: disable=too-many-lines -# pylint: disable=line-too-long -from knack.help_files import helps # pylint: disable=unused-import - - -helps['databox job'] = """ - type: group - short-summary: Commands to manage databox job. -""" - -helps['databox job create'] = """ - type: command - short-summary: Create a new job with the specified parameters. - examples: - - name: Create a databox job to use both storage account and managed disk as data destination. - text: |- - az databox job create --resource-group "SdkRg4981" --name "SdkJob3971" --location \\ - "westus" --sku "DataBox" --contact-name "Public SDK Test" \\ - --phone "1234567890" --email-list "testing@microsoft.com" \\ - --street-address1 "16 TOWNSEND ST" --street-address2 "Unit 1" --city "San Francisco" \\ - --state-or-province "CA" --country "US" --postal-code "94107" --company-name "Microsoft" \\ - --storage-account sa1 sa2 --staging-storage-account sa \\ - --resource-group-for-managed-disk /subscriptions/sub/resourceGroups/rg - - - name: Create a databoxdisk job to use storage account as data destination. - text: |- - az databox job create --resource-group "SdkRg4981" --name "SdkJob3971" --location \\ - "westus" --sku "DataBoxDisk" --expected-data-size 1 --contact-name "Public SDK Test" \\ - --phone "1234567890" --email-list "testing@microsoft.com" --street-address1 "16 TOWNSEND ST" \\ - --street-address2 "Unit 1" --city "San Francisco" --state-or-province "CA" --country "US" \\ - --postal-code "94107" --company-name "Microsoft" --storage-account sa1 -""" - -helps['databox job update'] = """ - type: command - short-summary: Update an existing job with the specified parameters. - examples: - - name: Update the job "SdkJob3971" with the specified parameters. - text: |- - az databox job update --resource-group "SdkRg4981" --name "SdkJob3971" \\ - --contact-name "Update Job" --phone "1234567890" \\ - --email-list "testing@microsoft.com" \\ - --street-address1 "16 TOWNSEND ST" \\ - --city "San Francisco" --state-or-province "CA" \\ - --country "US" --postal-code "94107" \\ - --company-name "Microsoft" \\ -""" - -helps['databox job delete'] = """ - type: command - short-summary: Delete a job. - examples: - - name: Delete the job "SdkJob3971" in resource group "SdkRg4981". - text: |- - az databox job delete --resource-group "SdkRg4981" --name "SdkJob3971" -""" - -helps['databox job show'] = """ - type: command - short-summary: Get information about the specified job. - examples: - - name: Get the information about the job "SdkJob3971". - text: |- - az databox job show --resource-group "SdkRg4981" --name "SdkJob3971" -""" - -helps['databox job list'] = """ - type: command - short-summary: List all the jobs available under the given resource group or the given subscription. - examples: - - name: List all the jobs available under the current subscription. - text: |- - az databox job list - - name: List all the jobs available under the resource group "SdkRg4981". - text: |- - az databox job list --resource-group "SdkRg4981" -""" - -helps['databox job cancel'] = """ - type: command - short-summary: Cancel a job. - examples: - - name: Cancel the job "SdkJob3971" under resource group "SdkRg4981". - text: |- - az databox job cancel --resource-group "SdkRg4981" --name "SdkJob3971" --reason "CancelTest" -""" - -helps['databox job list-credentials'] = """ - type: command - short-summary: List the unencrypted secrets related to the job. - examples: - - name: List the unencrypted secrets related to the job "TJ-636646322037905056". - text: |- - az databox job list-credentials --resource-group "bvttoolrg6" --name "TJ-636646322037905056" -""" diff --git a/src/databox/azext_databox/_params.py b/src/databox/azext_databox/_params.py deleted file mode 100644 index c9d09d4467c..00000000000 --- a/src/databox/azext_databox/_params.py +++ /dev/null @@ -1,75 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long -# pylint: disable=too-many-lines -# pylint: disable=too-many-statements - -from azure.cli.core.commands.parameters import ( - tags_type, - get_enum_type, - get_location_type -) -from azure.cli.core.commands.validators import get_default_location_from_resource_group -from knack.arguments import CLIArgumentType - - -def load_arguments(self, _): - storage_accounts_type = CLIArgumentType(help='Space-separated list of the destination storage account. It can be the name or resource ID of storage account.', arg_group='Storage Account', nargs='+') - staging_storage_account_type = CLIArgumentType(help='The name or ID of the destination storage account that can be used to copy the vhd for staging.', arg_group='Managed Disk') - resource_group_for_managed_disk_type = CLIArgumentType(help='The name or ID of the destination resource group where the Compute disks should be created.', arg_group='Managed Disk') - job_name_type = CLIArgumentType(options_list=['--name', '-n'], help='The name of the job resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only') - - with self.argument_context('databox job create') as c: - c.argument('job_name', job_name_type) - c.argument('location', arg_type=get_location_type(self.cli_ctx), default=None, - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('sku', arg_type=get_enum_type(['DataBox', 'DataBoxDisk', 'DataBoxHeavy']), - help='The sku type of DataBox.') - c.argument('expected_data_size', type=int, help='The expected size of the data which needs to be transferred in this job, in terabytes.The maximum usable capacity is up to 35 TB. This is only needed when sku is DataBoxDisk.') - c.argument('contact_name', help='Contact name of the person.', arg_group='Contact Details') - c.argument('phone', help='Phone number of the contact person.', arg_group='Contact Details') - c.argument('mobile', help='Mobile number of the contact person.', arg_group='Contact Details') - c.argument('email_list', help='Space-separated list of Email addresses to be notified about job progress.', arg_group='Contact Details', nargs='+') - c.argument('street_address1', help='Street Address line 1.', arg_group='Shipping Address') - c.argument('street_address2', help='Street Address line 2.', arg_group='Shipping Address') - c.argument('street_address3', help='Street Address line 3.', arg_group='Shipping Address') - c.argument('city', help='Name of the City.', arg_group='Shipping Address') - c.argument('state_or_province', help='Name of the State or Province.', arg_group='Shipping Address') - c.argument('country', help='Name of the Country. Ex: US', arg_group='Shipping Address') - c.argument('postal_code', help='Postal code.', arg_group='Shipping Address') - c.argument('company_name', help='Name of the company.', arg_group='Shipping Address') - c.extra('storage_accounts', arg_type=storage_accounts_type) - c.extra('staging_storage_account', arg_type=staging_storage_account_type) - c.extra('resource_group_for_managed_disk', arg_type=resource_group_for_managed_disk_type) - c.ignore('destination_account_details') - - with self.argument_context('databox job update') as c: - c.argument('job_name', job_name_type) - c.argument('contact_name', help='Contact name of the person.', arg_group='Contact Details') - c.argument('phone', help='Phone number of the contact person.', arg_group='Contact Details') - c.argument('mobile', help='Mobile number of the contact person.', arg_group='Contact Details') - c.argument('email_list', help='List of Email addresses to be notified about job progress.', arg_group='Contact Details', nargs='+') - c.argument('street_address1', help='Street Address line 1.', arg_group='Shipping Address') - c.argument('street_address2', help='Street Address line 2.', arg_group='Shipping Address') - c.argument('street_address3', help='Street Address line 3.', arg_group='Shipping Address') - c.argument('city', help='Name of the City.', arg_group='Shipping Address') - c.argument('state_or_province', help='Name of the State or Province.', arg_group='Shipping Address') - c.argument('country', help='Name of the Country. Ex: US', arg_group='Shipping Address') - c.argument('postal_code', help='Postal code.', arg_group='Shipping Address') - c.argument('company_name', help='Name of the company.', arg_group='Shipping Address') - - with self.argument_context('databox job delete') as c: - c.argument('job_name', job_name_type) - - with self.argument_context('databox job show') as c: - c.argument('job_name', job_name_type) - - with self.argument_context('databox job cancel') as c: - c.argument('job_name', job_name_type) - c.argument('reason', help='Reason for cancellation.') - - with self.argument_context('databox job list-credentials') as c: - c.argument('job_name', job_name_type) diff --git a/src/databox/azext_databox/_validators.py b/src/databox/azext_databox/_validators.py deleted file mode 100644 index a4339304141..00000000000 --- a/src/databox/azext_databox/_validators.py +++ /dev/null @@ -1,85 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -# pylint: disable=line-too-long -from azure.cli.core.commands.client_factory import get_subscription_id -from msrestazure.tools import resource_id - - -def validate_create_input_parameters(cmd, namespace): - _parse_storage_account_details(cmd, namespace) - _parse_managed_disk_details(cmd, namespace) - _validate_expected_data_size_for_databoxdisk(namespace) - _validate_destination_account_details(namespace) - - -def _parse_storage_account_details(cmd, namespace): - """Parse storage account details for destination.""" - from msrestazure.tools import is_valid_resource_id - - if not namespace.destination_account_details: - namespace.destination_account_details = [] - - if namespace.storage_accounts: - for storage_account in namespace.storage_accounts: - if storage_account and not is_valid_resource_id(storage_account): - storage_account = resource_id( - subscription=get_subscription_id(cmd.cli_ctx), - resource_group=namespace.resource_group_name, - namespace='Microsoft.Storage', - type='storageAccounts', - name=storage_account - ) - - if storage_account: - storage_account_details = {'storage_account_id': storage_account, - 'data_destination_type': 'StorageAccount'} - namespace.destination_account_details.append(storage_account_details) - - del namespace.storage_accounts - - -def _parse_managed_disk_details(cmd, namespace): - """Parse managed disk details for destination.""" - from msrestazure.tools import is_valid_resource_id - - if not namespace.destination_account_details: - namespace.destination_account_details = [] - - subscription = get_subscription_id(cmd.cli_ctx) - if namespace.staging_storage_account and not is_valid_resource_id(namespace.staging_storage_account): - namespace.staging_storage_account = resource_id( - subscription=subscription, - resource_group=namespace.resource_group_name, - namespace='Microsoft.Storage', - type='storageAccounts', - name=namespace.staging_storage_account - ) - - if namespace.resource_group_for_managed_disk and not is_valid_resource_id( - namespace.resource_group_for_managed_disk): - namespace.resource_group_for_managed_disk = '/subscriptions/' + subscription + '/resourceGroups/' + namespace.resource_group_for_managed_disk - - if namespace.staging_storage_account and namespace.resource_group_for_managed_disk: - managed_disk_details = {'staging_storage_account_id': namespace.staging_storage_account, - 'resource_group_id': namespace.resource_group_for_managed_disk, - 'data_destination_type': 'ManagedDisk'} - namespace.destination_account_details.append(managed_disk_details) - - del namespace.staging_storage_account - del namespace.resource_group_for_managed_disk - - -def _validate_expected_data_size_for_databoxdisk(namespace): - if namespace.sku == 'DataBoxDisk' and not namespace.expected_data_size: - raise ValueError( - "You must provide '--expected-data-size' when the 'sku' is 'DataBoxDisk'.") - - -def _validate_destination_account_details(namespace): - if not namespace.destination_account_details: - raise ValueError( - "You must provide at least one '--storage-account' or the combination of '--staging-storage-account' and " - "'--resource-group-for-managed-disk'") diff --git a/src/databox/azext_databox/action.py b/src/databox/azext_databox/action.py new file mode 100644 index 00000000000..d95d53bf711 --- /dev/null +++ b/src/databox/azext_databox/action.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/databox/azext_databox/azext_metadata.json b/src/databox/azext_databox/azext_metadata.json index 13025150393..cfc30c747c7 100644 --- a/src/databox/azext_databox/azext_metadata.json +++ b/src/databox/azext_databox/azext_metadata.json @@ -1,4 +1,4 @@ { "azext.isExperimental": true, - "azext.minCliCoreVersion": "2.3.1" + "azext.minCliCoreVersion": "2.15.0" } \ No newline at end of file diff --git a/src/databox/azext_databox/commands.py b/src/databox/azext_databox/commands.py deleted file mode 100644 index c5c6314fb9a..00000000000 --- a/src/databox/azext_databox/commands.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -# pylint: disable=line-too-long -# pylint: disable=too-many-lines -# pylint: disable=too-many-statements -# pylint: disable=too-many-locals -from azext_databox._validators import validate_create_input_parameters -from azure.cli.core.commands import CliCommandType - - -def load_command_table(self, _): - - from azext_databox._client_factory import cf_jobs - databox_jobs = CliCommandType( - operations_tmpl='azext_databox.vendored_sdks.databox.operations._jobs_operations#JobsOperations.{}', - client_factory=cf_jobs) - with self.command_group('databox job', databox_jobs, client_factory=cf_jobs, is_experimental=True) as g: - g.custom_command('create', 'create_databox_job', validator=validate_create_input_parameters) - g.custom_command('update', 'update_databox_job') - g.custom_command('delete', 'delete_databox_job', confirmation=True) - g.custom_show_command('show', 'get_databox_job') - g.custom_command('list', 'list_databox_job') - g.custom_command('cancel', 'cancel_databox_job', confirmation=True) - g.custom_command('list-credentials', 'list_credentials_databox_job') diff --git a/src/databox/azext_databox/custom.py b/src/databox/azext_databox/custom.py index 37ccab20460..dbe9d5f9742 100644 --- a/src/databox/azext_databox/custom.py +++ b/src/databox/azext_databox/custom.py @@ -1,135 +1,17 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long -# pylint: disable=too-many-statements -# pylint: disable=too-many-lines -# pylint: disable=too-many-locals -# pylint: disable=unused-argument -# pylint: disable=too-many-branches - - -def create_databox_job(client, - resource_group_name, - job_name, - location, - sku, - contact_name, - phone, - city, - email_list, - street_address1, - postal_code, - country, - state_or_province, - destination_account_details, - expected_data_size=None, - tags=None, - mobile=None, - street_address2=None, - street_address3=None, - company_name=None,): - body = {} - body['location'] = location # str - body['tags'] = tags # dictionary - body.setdefault('sku', {})['name'] = sku # str - body.setdefault('details', {})['job_details_type'] = sku - body.setdefault('details', {})['expected_data_size_in_terabytes'] = expected_data_size - body.setdefault('details', {}).setdefault('contact_details', {})['contact_name'] = contact_name # str - body.setdefault('details', {}).setdefault('contact_details', {})['phone'] = phone # str - body.setdefault('details', {}).setdefault('contact_details', {})['mobile'] = mobile # str - body.setdefault('details', {}).setdefault('contact_details', {})['email_list'] = email_list - body.setdefault('details', {}).setdefault('shipping_address', {})['street_address1'] = street_address1 # str - body.setdefault('details', {}).setdefault('shipping_address', {})['street_address2'] = street_address2 # str - body.setdefault('details', {}).setdefault('shipping_address', {})['street_address3'] = street_address3 # str - body.setdefault('details', {}).setdefault('shipping_address', {})['city'] = city # str - body.setdefault('details', {}).setdefault('shipping_address', {})['state_or_province'] = state_or_province # str - body.setdefault('details', {}).setdefault('shipping_address', {})['country'] = country # str - body.setdefault('details', {}).setdefault('shipping_address', {})['postal_code'] = postal_code # str - body.setdefault('details', {}).setdefault('shipping_address', {})['company_name'] = company_name # str - - body.setdefault('details', {})['destination_account_details'] = destination_account_details - - return client.create(resource_group_name=resource_group_name, job_name=job_name, job_resource=body) - - -def update_databox_job(client, - resource_group_name, - job_name, - contact_name=None, - phone=None, - email_list=None, - street_address1=None, - postal_code=None, - country=None, - mobile=None, - city=None, - street_address2=None, - street_address3=None, - state_or_province=None, - company_name=None): - job_resource = get_databox_job(client, resource_group_name, job_name) - job_details = job_resource.details - contact_details = job_details.contact_details - shipping_address = job_details.shipping_address - - body = {} - body.setdefault('details', {}).setdefault('contact_details', {})[ - 'contact_name'] = contact_details.contact_name if contact_name is None else contact_name # str - body.setdefault('details', {}).setdefault('contact_details', {})[ - 'phone'] = contact_details.phone if phone is None else phone # str - body.setdefault('details', {}).setdefault('contact_details', {})[ - 'mobile'] = contact_details.mobile if mobile is None else mobile # str - body.setdefault('details', {}).setdefault('contact_details', {})[ - 'email_list'] = contact_details.email_list if email_list is None else email_list - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'street_address1'] = shipping_address.street_address1 if street_address1 is None else street_address1 # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'street_address2'] = shipping_address.street_address2 if street_address2 is None else street_address2 # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'street_address3'] = shipping_address.street_address3 if street_address3 is None else street_address3 # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'city'] = shipping_address.city if city is None else city # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'state_or_province'] = shipping_address.state_or_province if state_or_province is None else state_or_province # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'country'] = shipping_address.country if country is None else country # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'postal_code'] = shipping_address.postal_code if postal_code is None else postal_code # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'company_name'] = shipping_address.company_name if company_name is None else company_name # str - - return client.update(resource_group_name=resource_group_name, job_name=job_name, job_resource_update_parameter=body) - - -def delete_databox_job(client, - resource_group_name, - job_name): - return client.delete(resource_group_name=resource_group_name, job_name=job_name) - - -def get_databox_job(client, - resource_group_name, - job_name): - return client.get(resource_group_name=resource_group_name, job_name=job_name, expand='details') - - -def list_databox_job(client, - resource_group_name=None): - if resource_group_name is not None: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list() - - -def cancel_databox_job(client, - resource_group_name, - job_name, - reason): - return client.cancel(resource_group_name=resource_group_name, job_name=job_name, reason=reason) - - -def list_credentials_databox_job(client, - resource_group_name, - job_name): - return client.list_credentials(resource_group_name=resource_group_name, job_name=job_name) +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/databox/azext_databox/generated/__init__.py b/src/databox/azext_databox/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/databox/azext_databox/generated/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/databox/azext_databox/generated/_client_factory.py b/src/databox/azext_databox/generated/_client_factory.py new file mode 100644 index 00000000000..58b4176b5b9 --- /dev/null +++ b/src/databox/azext_databox/generated/_client_factory.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + + +def cf_databox_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_databox.vendored_sdks.databox import DataBoxManagementClient + return get_mgmt_service_client(cli_ctx, + DataBoxManagementClient) + + +def cf_job(cli_ctx, *_): + return cf_databox_cl(cli_ctx).jobs + + +def cf_service(cli_ctx, *_): + return cf_databox_cl(cli_ctx).service diff --git a/src/databox/azext_databox/generated/_help.py b/src/databox/azext_databox/generated/_help.py new file mode 100644 index 00000000000..e908a1d5b32 --- /dev/null +++ b/src/databox/azext_databox/generated/_help.py @@ -0,0 +1,417 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['databox job'] = """ + type: group + short-summary: Manage job with databox +""" + +helps['databox job list'] = """ + type: command + short-summary: "Lists all the jobs available under the given resource group. And Lists all the jobs available \ +under the subscription." + examples: + - name: JobsListByResourceGroup + text: |- + az databox job list --resource-group "SdkRg5154" + - name: JobsList + text: |- + az databox job list +""" + +helps['databox job show'] = """ + type: command + short-summary: "Gets information about the specified job." + examples: + - name: JobsGet + text: |- + az databox job show --expand "details" --name "SdkJob952" --resource-group "SdkRg5154" + - name: JobsGetCmk + text: |- + az databox job show --expand "details" --name "SdkJob1735" --resource-group "SdkRg7937" + - name: JobsGetExport + text: |- + az databox job show --expand "details" --name "SdkJob6429" --resource-group "SdkRg8091" +""" + +helps['databox job create'] = """ + type: command + short-summary: "Creates a new job with the specified parameters. Existing job cannot be updated with this API and \ +should instead be updated with the Update job API." + parameters: + - name: --sku + short-summary: "The sku type." + long-summary: | + Usage: --sku name=XX display-name=XX family=XX + + name: Required. The sku name. + display-name: The display name of the sku. + family: The sku family. + examples: + - name: JobsCreate + text: |- + az databox job create --name "SdkJob952" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/\ +databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"jobDetailsType\\":\\"DataBox\\",\ +\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\ +\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 \ +TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg5154" + - name: JobsCreateDevicePassword + text: |- + az databox job create --name "SdkJob9640" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"sharePassword\\":\\"\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8\ +ff7-4a25-95c7-ce9da541242f/resourceGroups/databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\ +2\\"}}],\\"devicePassword\\":\\"\\",\\"jobDetailsType\\":\\"DataBox\\",\\"shippingAddress\\":{\\"addres\ +sType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"po\ +stalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg7478" + - name: JobsCreateDoubleEncryption + text: |- + az databox job create --name "SdkJob6599" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/\ +databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"jobDetailsType\\":\\"DataBox\\",\ +\\"preferences\\":{\\"encryptionPreferences\\":{\\"doubleEncryption\\":\\"Enabled\\"}},\\"shippingAddress\\":{\\"addres\ +sType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"po\ +stalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg608" + - name: JobsCreateExport + text: |- + az databox job create --name "SdkJob6429" --location "westus" --transfer-type "ExportFromAzure" \ +--details "{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"]\ +,\\"phone\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataExportDetails\\":[{\\"accountDetails\\":{\\"dataA\ +ccountType\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resour\ +ceGroups/akvenkat/providers/Microsoft.Storage/storageAccounts/aaaaaa2\\"},\\"transferConfiguration\\":{\\"transferAllDe\ +tails\\":{\\"include\\":{\\"dataAccountType\\":\\"StorageAccount\\",\\"transferAllBlobs\\":true,\\"transferAllFiles\\":\ +true}},\\"transferConfigurationType\\":\\"TransferAll\\"}}],\\"jobDetailsType\\":\\"DataBox\\",\\"shippingAddress\\":{\ +\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\ +\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg8091" + - name: JobsCreateWithUserAssignedIdentity + text: |- + az databox job create --name "SdkJob5337" --type "UserAssigned" --user-assigned-identities \ +"{\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdentity/us\ +erAssignedIdentities/sdkIdentity\\":{}}" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/\ +databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount2\\"}}],\\"jobDetailsType\\":\\"DataBox\\"\ +,\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsof\ +t\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 \ +TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg7552" +""" + +helps['databox job update'] = """ + type: command + short-summary: "Updates the properties of an existing job." + parameters: + - name: --shipping-address + short-summary: "Shipping address of the customer." + long-summary: | + Usage: --shipping-address street-address1=XX street-address2=XX street-address3=XX city=XX \ +state-or-province=XX country=XX postal-code=XX zip-extended-code=XX company-name=XX address-type=XX + + street-address1: Required. Street Address line 1. + street-address2: Street Address line 2. + street-address3: Street Address line 3. + city: Name of the City. + state-or-province: Name of the State or Province. + country: Required. Name of the Country. + postal-code: Postal code. + zip-extended-code: Extended Zip Code. + company-name: Name of the company. + address-type: Type of address. + - name: --user-assigned + short-summary: "User assigned identity properties." + long-summary: | + Usage: --user-assigned resource-id=XX + + resource-id: Arm resource id for user assigned identity to be used to fetch MSI token. + - name: --notification-preference + short-summary: "Notification preference for a job stage." + long-summary: | + Usage: --notification-preference stage-name=XX send-notification=XX + + stage-name: Required. Name of the stage. + send-notification: Required. Notification is required or not. + + Multiple actions can be specified by using more than one --notification-preference argument. + examples: + - name: JobsPatch + text: |- + az databox job update --name "SdkJob952" --contact-name "Update Job" --email-list \ +"testing@microsoft.com" --phone "1234567890" --phone-extension "1234" --shipping-address address-type="Commercial" \ +city="San Francisco" company-name="Microsoft" country="US" postal-code="94107" state-or-province="CA" \ +street-address1="16 TOWNSEND ST" street-address2="Unit 1" --resource-group "SdkRg5154" + - name: JobsPatchCmk + text: |- + az databox job update --name "SdkJob1735" --kek-type "CustomerManaged" --kek-url \ +"https://sdkkeyvault.vault.azure.net/keys/SSDKEY/" --kek-vault-resource-id "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9d\ +a541242f/resourceGroups/akvenkat/providers/Microsoft.KeyVault/vaults/SDKKeyVault" --resource-group "SdkRg7937" + - name: JobsPatchSystemAssignedToUserAssigned + text: |- + az databox job update --name "SdkJob2965" --resource-identity-type "SystemAssigned,UserAssigned" \ +--user-assigned-identities "{\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/M\ +icrosoft.ManagedIdentity/userAssignedIdentities/sdkIdentity\\":{}}" --type "UserAssigned" --user-assigned \ +resource-id="/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIde\ +ntity/userAssignedIdentities/sdkIdentity" --kek-type "CustomerManaged" --kek-url "https://sdkkeyvault.vault.azure.net/k\ +eys/SSDKEY/" --kek-vault-resource-id "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/provi\ +ders/Microsoft.KeyVault/vaults/SDKKeyVault" --resource-group "SdkRg9765" +""" + +helps['databox job delete'] = """ + type: command + short-summary: "Deletes a job." + examples: + - name: JobsDelete + text: |- + az databox job delete --name "SdkJob952" --resource-group "SdkRg5154" +""" + +helps['databox job book-shipment-pick-up'] = """ + type: command + short-summary: "Book shipment pick up." + examples: + - name: BookShipmentPickupPost + text: |- + az databox job book-shipment-pick-up --name "TJ-636646322037905056" --resource-group "bvttoolrg6" \ +--end-time "2019-09-22T18:30:00Z" --shipment-location "Front desk" --start-time "2019-09-20T18:30:00Z" +""" + +helps['databox job cancel'] = """ + type: command + short-summary: "CancelJob." + examples: + - name: JobsCancelPost + text: |- + az databox job cancel --reason "CancelTest" --name "SdkJob952" --resource-group "SdkRg5154" +""" + +helps['databox job list-credentials'] = """ + type: command + short-summary: "This method gets the unencrypted secrets related to the job." + examples: + - name: JobsListCredentials + text: |- + az databox job list-credentials --name "TJ-636646322037905056" --resource-group "bvttoolrg6" +""" + +helps['databox job wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databox job is met. + examples: + - name: Pause executing next line of CLI script until the databox job is successfully created. + text: |- + az databox job wait --expand "details" --name "SdkJob6429" --resource-group "SdkRg8091" --created + - name: Pause executing next line of CLI script until the databox job is successfully updated. + text: |- + az databox job wait --expand "details" --name "SdkJob6429" --resource-group "SdkRg8091" --updated + - name: Pause executing next line of CLI script until the databox job is successfully deleted. + text: |- + az databox job wait --expand "details" --name "SdkJob6429" --resource-group "SdkRg8091" --deleted +""" + +helps['databox service'] = """ + type: group + short-summary: Manage service with databox +""" + +helps['databox service list-available-sku-by-resource-group'] = """ + type: command + short-summary: "This method provides the list of available skus for the given subscription, resource group and \ +location." + examples: + - name: AvailableSkusPost + text: |- + az databox service list-available-sku-by-resource-group --country "US" --available-sku-request-location \ +"westus" --transfer-type "ImportToAzure" --location "westus" --resource-group "bvttoolrg6" +""" + +helps['databox service region-configuration'] = """ + type: command + short-summary: "This API provides configuration details specific to given region/location at Subscription level." + parameters: + - name: --data-box-schedule-availability-request + short-summary: "Request body to get the availability for scheduling data box orders orders." + long-summary: | + Usage: --data-box-schedule-availability-request storage-location=XX sku-name=XX country=XX + + storage-location: Required. Location for data transfer. For locations check: \ +https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + sku-name: Required. Sku Name for which the order is to be scheduled. + country: Country in which storage location should be supported. + - name: --disk-schedule-availability-request + short-summary: "Request body to get the availability for scheduling disk orders." + long-summary: | + Usage: --disk-schedule-availability-request expected-data-size-in-terabytes=XX storage-location=XX \ +sku-name=XX country=XX + + expected-data-size-in-terabytes: Required. The expected size of the data, which needs to be transferred in \ +this job, in terabytes. + storage-location: Required. Location for data transfer. For locations check: \ +https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + sku-name: Required. Sku Name for which the order is to be scheduled. + country: Country in which storage location should be supported. + - name: --heavy-schedule-availability-request + short-summary: "Request body to get the availability for scheduling heavy orders." + long-summary: | + Usage: --heavy-schedule-availability-request storage-location=XX sku-name=XX country=XX + + storage-location: Required. Location for data transfer. For locations check: \ +https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + sku-name: Required. Sku Name for which the order is to be scheduled. + country: Country in which storage location should be supported. + examples: + - name: RegionConfiguration + text: |- + az databox service region-configuration --location "westus" --schedule-availability-request \ +"{\\"skuName\\":\\"DataBox\\",\\"storageLocation\\":\\"westus\\"}" +""" + +helps['databox service region-configuration-by-resource-group'] = """ + type: command + short-summary: "This API provides configuration details specific to given region/location at Resource group \ +level." + parameters: + - name: --data-box-schedule-availability-request + short-summary: "Request body to get the availability for scheduling data box orders orders." + long-summary: | + Usage: --data-box-schedule-availability-request storage-location=XX sku-name=XX country=XX + + storage-location: Required. Location for data transfer. For locations check: \ +https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + sku-name: Required. Sku Name for which the order is to be scheduled. + country: Country in which storage location should be supported. + - name: --disk-schedule-availability-request + short-summary: "Request body to get the availability for scheduling disk orders." + long-summary: | + Usage: --disk-schedule-availability-request expected-data-size-in-terabytes=XX storage-location=XX \ +sku-name=XX country=XX + + expected-data-size-in-terabytes: Required. The expected size of the data, which needs to be transferred in \ +this job, in terabytes. + storage-location: Required. Location for data transfer. For locations check: \ +https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + sku-name: Required. Sku Name for which the order is to be scheduled. + country: Country in which storage location should be supported. + - name: --heavy-schedule-availability-request + short-summary: "Request body to get the availability for scheduling heavy orders." + long-summary: | + Usage: --heavy-schedule-availability-request storage-location=XX sku-name=XX country=XX + + storage-location: Required. Location for data transfer. For locations check: \ +https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + sku-name: Required. Sku Name for which the order is to be scheduled. + country: Country in which storage location should be supported. + examples: + - name: RegionConfigurationByResourceGroup + text: |- + az databox service region-configuration-by-resource-group --location "westus" \ +--schedule-availability-request "{\\"skuName\\":\\"DataBox\\",\\"storageLocation\\":\\"westus\\"}" --resource-group \ +"SdkRg4981" +""" + +helps['databox service validate-address'] = """ + type: command + short-summary: "[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer \ +shipping address and provide alternate addresses if any." + parameters: + - name: --shipping-address + short-summary: "Shipping address of the customer." + long-summary: | + Usage: --shipping-address street-address1=XX street-address2=XX street-address3=XX city=XX \ +state-or-province=XX country=XX postal-code=XX zip-extended-code=XX company-name=XX address-type=XX + + street-address1: Required. Street Address line 1. + street-address2: Street Address line 2. + street-address3: Street Address line 3. + city: Name of the City. + state-or-province: Name of the State or Province. + country: Required. Name of the Country. + postal-code: Postal code. + zip-extended-code: Extended Zip Code. + company-name: Name of the company. + address-type: Type of address. + examples: + - name: ValidateAddressPost + text: |- + az databox service validate-address --location "westus" --device-type "DataBox" --shipping-address \ +address-type="Commercial" city="San Francisco" company-name="Microsoft" country="US" postal-code="94107" \ +state-or-province="CA" street-address1="16 TOWNSEND ST" street-address2="Unit 1" --validation-type "ValidateAddress" +""" + +helps['databox service validate-input'] = """ + type: command + short-summary: "This method does all necessary pre-job creation validation under subscription." + parameters: + - name: --create-job-validations + short-summary: "It does all pre-job creation validations." + long-summary: | + Usage: --create-job-validations individual-request-details=XX + + individual-request-details: Required. List of request details contain validationType and its request as \ +key and value respectively. + examples: + - name: ValidateInputs + text: |- + az databox service validate-input --location "westus" --validation-request \ +"{\\"individualRequestDetails\\":[{\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountType\\":\\"StorageAcco\ +unt\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/provider\ +s/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"deviceType\\":\\"DataBox\\",\\"transferType\\":\\"Im\ +portToAzure\\",\\"validationType\\":\\"ValidateDataTransferDetails\\"},{\\"deviceType\\":\\"DataBox\\",\\"shippingAddre\ +ss\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\\ +":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"},\\"transportPreferences\\":{\\"preferredShipmentType\\":\\"MicrosoftManaged\\"\ +},\\"validationType\\":\\"ValidateAddress\\"},{\\"validationType\\":\\"ValidateSubscriptionIsAllowedToCreateJob\\"},{\\\ +"country\\":\\"US\\",\\"deviceType\\":\\"DataBox\\",\\"location\\":\\"westus\\",\\"transferType\\":\\"ImportToAzure\\",\ +\\"validationType\\":\\"ValidateSkuAvailability\\"},{\\"deviceType\\":\\"DataBox\\",\\"validationType\\":\\"ValidateCre\ +ateOrderLimit\\"},{\\"deviceType\\":\\"DataBox\\",\\"preference\\":{\\"transportPreferences\\":{\\"preferredShipmentTyp\ +e\\":\\"MicrosoftManaged\\"}},\\"validationType\\":\\"ValidatePreferences\\"}],\\"validationCategory\\":\\"JobCreationV\ +alidation\\"}" +""" + +helps['databox service validate-input-by-resource-group'] = """ + type: command + short-summary: "This method does all necessary pre-job creation validation under resource group." + parameters: + - name: --create-job-validations + short-summary: "It does all pre-job creation validations." + long-summary: | + Usage: --create-job-validations individual-request-details=XX + + individual-request-details: Required. List of request details contain validationType and its request as \ +key and value respectively. + examples: + - name: ValidateInputsByResourceGroup + text: |- + az databox service validate-input-by-resource-group --location "westus" --resource-group "SdkRg6861" \ +--validation-request "{\\"individualRequestDetails\\":[{\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountT\ +ype\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroup\ +s/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"deviceType\\":\\"DataBox\\",\\"\ +transferType\\":\\"ImportToAzure\\",\\"validationType\\":\\"ValidateDataTransferDetails\\"},{\\"deviceType\\":\\"DataBo\ +x\\",\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Micr\ +osoft\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 \ +TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit 1\\"},\\"transportPreferences\\":{\\"preferredShipmentType\\":\\"MicrosoftM\ +anaged\\"},\\"validationType\\":\\"ValidateAddress\\"},{\\"validationType\\":\\"ValidateSubscriptionIsAllowedToCreateJo\ +b\\"},{\\"country\\":\\"US\\",\\"deviceType\\":\\"DataBox\\",\\"location\\":\\"westus\\",\\"transferType\\":\\"ImportTo\ +Azure\\",\\"validationType\\":\\"ValidateSkuAvailability\\"},{\\"deviceType\\":\\"DataBox\\",\\"validationType\\":\\"Va\ +lidateCreateOrderLimit\\"},{\\"deviceType\\":\\"DataBox\\",\\"preference\\":{\\"transportPreferences\\":{\\"preferredSh\ +ipmentType\\":\\"MicrosoftManaged\\"}},\\"validationType\\":\\"ValidatePreferences\\"}],\\"validationCategory\\":\\"Job\ +CreationValidation\\"}" +""" diff --git a/src/databox/azext_databox/generated/_params.py b/src/databox/azext_databox/generated/_params.py new file mode 100644 index 00000000000..58f3d870ba5 --- /dev/null +++ b/src/databox/azext_databox/generated/_params.py @@ -0,0 +1,208 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import ( + get_default_location_from_resource_group, + validate_file_or_dict +) +from azext_databox.action import ( + AddSku, + AddShippingAddress, + AddUserAssigned, + AddNotificationPreference, + AddDataBoxScheduleAvailabilityRequest, + AddDiskScheduleAvailabilityRequest, + AddHeavyScheduleAvailabilityRequest, + AddCreateJobValidations +) + + +def load_arguments(self, _): + + with self.argument_context('databox job list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('skip_token', type=str, help='$skipToken is supported on Get list of jobs, which provides the next ' + 'page in the list of jobs.') + + with self.argument_context('databox job show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only', id_part='name') + c.argument('expand', type=str, help='$expand is supported on details parameter for job, which provides details ' + 'on the job stages.') + + with self.argument_context('databox job create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='The sku type.') + c.argument('type_', options_list=['--type'], type=str, help='Identity type', arg_group='Identity') + c.argument('user_assigned_identities', type=validate_file_or_dict, help='User Assigned Identities Expected ' + 'value: json-string/@json-file.', arg_group='Identity') + c.argument('transfer_type', arg_type=get_enum_type(['ImportToAzure', 'ExportFromAzure']), help='Type of the ' + 'data transfer.') + c.argument('details', type=validate_file_or_dict, help='Details of a job run. This field will only be sent for ' + 'expand details filter. Expected value: json-string/@json-file.') + c.argument('delivery_type', arg_type=get_enum_type(['NonScheduled', 'Scheduled']), + help='Delivery type of Job.') + c.argument('scheduled_date_time', help='Scheduled date time.', arg_group='Delivery Info') + + with self.argument_context('databox job update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only', id_part='name') + c.argument('if_match', type=str, help='Defines the If-Match condition. The patch will be performed only if the ' + 'ETag of the job on the server matches this value.') + c.argument('tags', tags_type) + c.argument('shipping_address', action=AddShippingAddress, nargs='+', help='Shipping address of the customer.', + arg_group='Details') + c.argument('kek_type', arg_type=get_enum_type(['MicrosoftManaged', 'CustomerManaged']), help='Type of ' + 'encryption key used for key encryption.', arg_group='Details Key Encryption Key') + c.argument('kek_url', type=str, help='Key encryption key. It is required in case of Customer managed KekType.', + arg_group='Details Key Encryption Key') + c.argument('kek_vault_resource_id', type=str, help='Kek vault resource id. It is required in case of Customer ' + 'managed KekType.', arg_group='Details Key Encryption Key') + c.argument('type_', options_list=['--type'], type=str, help='Managed service identity type.', + arg_group='Details Key Encryption Key Identity Properties') + c.argument('user_assigned', action=AddUserAssigned, nargs='+', help='User assigned identity properties.', + arg_group='Details Key Encryption Key Identity Properties') + c.argument('contact_name', type=str, help='Contact name of the person.', arg_group='Details Contact Details') + c.argument('phone', type=str, help='Phone number of the contact person.', arg_group='Details Contact Details') + c.argument('phone_extension', type=str, help='Phone extension number of the contact person.', + arg_group='Details Contact Details') + c.argument('mobile', type=str, help='Mobile number of the contact person.', + arg_group='Details Contact Details') + c.argument('email_list', nargs='+', help='List of Email-ids to be notified about job progress.', + arg_group='Details Contact Details') + c.argument('notification_preference', action=AddNotificationPreference, nargs='+', help='Notification ' + 'preference for a job stage.', arg_group='Details Contact Details') + c.argument('resource_identity_type', type=str, help='Identity type', arg_group='Identity') + c.argument('user_assigned_identities', type=validate_file_or_dict, help='User Assigned Identities Expected ' + 'value: json-string/@json-file.', arg_group='Identity') + + with self.argument_context('databox job delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only', id_part='name') + + with self.argument_context('databox job book-shipment-pick-up') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only', id_part='name') + c.argument('start_time', help='Minimum date after which the pick up should commence, this must be in local ' + 'time of pick up area.') + c.argument('end_time', help='Maximum date before which the pick up should commence, this must be in local time ' + 'of pick up area.') + c.argument('shipment_location', type=str, help='Shipment Location in the pickup place. Eg.front desk') + + with self.argument_context('databox job cancel') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only', id_part='name') + c.argument('reason', type=str, help='Reason for cancellation.') + + with self.argument_context('databox job list-credentials') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only') + + with self.argument_context('databox job wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only', id_part='name') + c.argument('expand', type=str, help='$expand is supported on details parameter for job, which provides details ' + 'on the job stages.') + + with self.argument_context('databox service list-available-sku-by-resource-group') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('transfer_type', arg_type=get_enum_type(['ImportToAzure', 'ExportFromAzure']), help='Type of the ' + 'transfer.') + c.argument('country', type=str, help='ISO country code. Country for hardware shipment. For codes check: ' + 'https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements') + c.argument('available_sku_request_location', type=str, help='Location for data transfer. For locations check: ' + 'https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01') + c.argument('sku_names', nargs='+', help='Sku Names to filter for available skus') + + with self.argument_context('databox service region-configuration') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx), id_part='name') + c.argument('data_box_schedule_availability_request', action=AddDataBoxScheduleAvailabilityRequest, nargs='+', + help='Request body to get the availability for scheduling data box orders orders.', + arg_group='ScheduleAvailabilityRequest') + c.argument('disk_schedule_availability_request', action=AddDiskScheduleAvailabilityRequest, nargs='+', + help='Request body to get the availability for scheduling disk orders.', + arg_group='ScheduleAvailabilityRequest') + c.argument('heavy_schedule_availability_request', action=AddHeavyScheduleAvailabilityRequest, nargs='+', + help='Request body to get the availability for scheduling heavy orders.', + arg_group='ScheduleAvailabilityRequest') + c.argument('sku_name', arg_type=get_enum_type(['DataBox', 'DataBoxDisk', 'DataBoxHeavy']), help='Type of the ' + 'device.', arg_group='Transport Availability Request') + + with self.argument_context('databox service region-configuration-by-resource-group') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group, id_part='name') + c.argument('data_box_schedule_availability_request', action=AddDataBoxScheduleAvailabilityRequest, nargs='+', + help='Request body to get the availability for scheduling data box orders orders.', + arg_group='ScheduleAvailabilityRequest') + c.argument('disk_schedule_availability_request', action=AddDiskScheduleAvailabilityRequest, nargs='+', + help='Request body to get the availability for scheduling disk orders.', + arg_group='ScheduleAvailabilityRequest') + c.argument('heavy_schedule_availability_request', action=AddHeavyScheduleAvailabilityRequest, nargs='+', + help='Request body to get the availability for scheduling heavy orders.', + arg_group='ScheduleAvailabilityRequest') + c.argument('sku_name', arg_type=get_enum_type(['DataBox', 'DataBoxDisk', 'DataBoxHeavy']), help='Type of the ' + 'device.', arg_group='Transport Availability Request') + + with self.argument_context('databox service validate-address') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx), id_part='name') + c.argument('validation_type', arg_type=get_enum_type(['ValidateAddress', 'ValidateSubscriptionIsAllowedToCreate' + 'Job', 'ValidatePreferences', 'ValidateCreateOrderLimit', + 'ValidateSkuAvailability', + 'ValidateDataTransferDetails']), help='Identifies the ' + 'type of validation request.') + c.argument('shipping_address', action=AddShippingAddress, nargs='+', help='Shipping address of the customer.') + c.argument('device_type', arg_type=get_enum_type(['DataBox', 'DataBoxDisk', 'DataBoxHeavy']), help='Device ' + 'type to be used for the job.') + c.argument('preferred_shipment_type', arg_type=get_enum_type(['CustomerManaged', 'MicrosoftManaged']), + help='Indicates Shipment Logistics type that the customer preferred.', arg_group='Transport ' + 'Preferences') + + with self.argument_context('databox service validate-input') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx), id_part='name') + c.argument('create_job_validations', action=AddCreateJobValidations, nargs='+', help='It does all pre-job ' + 'creation validations.', arg_group='ValidationRequest') + + with self.argument_context('databox service validate-input-by-resource-group') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group, id_part='name') + c.argument('create_job_validations', action=AddCreateJobValidations, nargs='+', help='It does all pre-job ' + 'creation validations.', arg_group='ValidationRequest') diff --git a/src/databox/azext_databox/vendored_sdks/databox/version.py b/src/databox/azext_databox/generated/_validators.py similarity index 93% rename from src/databox/azext_databox/vendored_sdks/databox/version.py rename to src/databox/azext_databox/generated/_validators.py index c995f7836ce..b33a44c1ebf 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/version.py +++ b/src/databox/azext_databox/generated/_validators.py @@ -1,4 +1,3 @@ -# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for @@ -8,5 +7,3 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- - -VERSION = "0.2.0" diff --git a/src/databox/azext_databox/generated/action.py b/src/databox/azext_databox/generated/action.py new file mode 100644 index 00000000000..fd9a9773a5e --- /dev/null +++ b/src/databox/azext_databox/generated/action.py @@ -0,0 +1,252 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access + +import argparse +from collections import defaultdict +from knack.util import CLIError + + +class AddSku(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.sku = 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] + if kl == 'name': + d['name'] = v[0] + elif kl == 'display-name': + d['display_name'] = v[0] + elif kl == 'family': + d['family'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter sku. All possible keys are: name, ' + 'display-name, family'.format(k)) + return d + + +class AddShippingAddress(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.shipping_address = 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] + if kl == 'street-address1': + d['street_address1'] = v[0] + elif kl == 'street-address2': + d['street_address2'] = v[0] + elif kl == 'street-address3': + d['street_address3'] = v[0] + elif kl == 'city': + d['city'] = v[0] + elif kl == 'state-or-province': + d['state_or_province'] = v[0] + elif kl == 'country': + d['country'] = v[0] + elif kl == 'postal-code': + d['postal_code'] = v[0] + elif kl == 'zip-extended-code': + d['zip_extended_code'] = v[0] + elif kl == 'company-name': + d['company_name'] = v[0] + elif kl == 'address-type': + d['address_type'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter shipping_address. All possible keys are: ' + 'street-address1, street-address2, street-address3, city, state-or-province, country, ' + 'postal-code, zip-extended-code, company-name, address-type'.format(k)) + return d + + +class AddUserAssigned(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.user_assigned = 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] + if kl == 'resource-id': + d['resource_id'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter user_assigned. All possible keys are: ' + 'resource-id'.format(k)) + return d + + +class AddNotificationPreference(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddNotificationPreference, self).__call__(parser, namespace, action, option_string) + + 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] + if kl == 'stage-name': + d['stage_name'] = v[0] + elif kl == 'send-notification': + d['send_notification'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter notification_preference. All possible ' + 'keys are: stage-name, send-notification'.format(k)) + return d + + +class AddDataBoxScheduleAvailabilityRequest(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.data_box_schedule_availability_request = 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] + if kl == 'storage-location': + d['storage_location'] = v[0] + elif kl == 'country': + d['country'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter data_box_schedule_availability_request. ' + 'All possible keys are: storage-location, country'.format(k)) + d['sku_name'] = 'DataBox' + return d + + +class AddDiskScheduleAvailabilityRequest(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.disk_schedule_availability_request = 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] + if kl == 'expected-data-size-in-terabytes': + d['expected_data_size_in_terabytes'] = v[0] + elif kl == 'storage-location': + d['storage_location'] = v[0] + elif kl == 'country': + d['country'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter disk_schedule_availability_request. All ' + 'possible keys are: expected-data-size-in-terabytes, storage-location, country'.format(k)) + d['sku_name'] = 'DataBoxDisk' + return d + + +class AddHeavyScheduleAvailabilityRequest(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.heavy_schedule_availability_request = 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] + if kl == 'storage-location': + d['storage_location'] = v[0] + elif kl == 'country': + d['country'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter heavy_schedule_availability_request. All ' + 'possible keys are: storage-location, country'.format(k)) + d['sku_name'] = 'DataBoxHeavy' + return d + + +class AddCreateJobValidations(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.create_job_validations = 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 = {} + d['validation_category'] = "JobCreationValidation" + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'individual-request-details': + d['individual_request_details'] = v + else: + raise CLIError('Unsupported Key {} is provided for parameter create_job_validations. All possible keys ' + 'are: individual-request-details'.format(k)) + d['validation_category'] = 'JobCreationValidation' + return d diff --git a/src/databox/azext_databox/generated/commands.py b/src/databox/azext_databox/generated/commands.py new file mode 100644 index 00000000000..09461f45071 --- /dev/null +++ b/src/databox/azext_databox/generated/commands.py @@ -0,0 +1,48 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_databox.generated._client_factory import cf_job + databox_job = CliCommandType( + operations_tmpl='azext_databox.vendored_sdks.databox.operations._jobs_operations#JobsOperations.{}', + client_factory=cf_job) + with self.command_group('databox job', databox_job, client_factory=cf_job) as g: + g.custom_command('list', 'databox_job_list') + g.custom_show_command('show', 'databox_job_show') + g.custom_command('create', 'databox_job_create', supports_no_wait=True) + g.custom_command('update', 'databox_job_update', supports_no_wait=True) + g.custom_command('delete', 'databox_job_delete', supports_no_wait=True, confirmation=True) + g.custom_command('book-shipment-pick-up', 'databox_job_book_shipment_pick_up') + g.custom_command('cancel', 'databox_job_cancel') + g.custom_command('list-credentials', 'databox_job_list_credentials') + g.custom_wait_command('wait', 'databox_job_show') + + from azext_databox.generated._client_factory import cf_service + databox_service = CliCommandType( + operations_tmpl='azext_databox.vendored_sdks.databox.operations._service_operations#ServiceOperations.{}', + client_factory=cf_service) + with self.command_group('databox service', databox_service, client_factory=cf_service) as g: + g.custom_command('list-available-sku-by-resource-group', + 'databox_service_list_available_sku_by_resource_group') + g.custom_command('region-configuration', 'databox_service_region_configuration') + g.custom_command('region-configuration-by-resource-group', 'databox_service_region_configuration_by_resource_gr' + 'oup') + g.custom_command('validate-address', 'databox_service_validate_address') + g.custom_command('validate-input', 'databox_service_validate_input') + g.custom_command('validate-input-by-resource-group', 'databox_service_validate_input_by_resource_group') + + with self.command_group('databox', is_experimental=True): + pass diff --git a/src/databox/azext_databox/generated/custom.py b/src/databox/azext_databox/generated/custom.py new file mode 100644 index 00000000000..cede9a233d1 --- /dev/null +++ b/src/databox/azext_databox/generated/custom.py @@ -0,0 +1,269 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.util import CLIError +from azure.cli.core.util import sdk_no_wait + + +def databox_job_list(client, + resource_group_name=None, + skip_token=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name, + skip_token=skip_token) + return client.list(skip_token=skip_token) + + +def databox_job_show(client, + resource_group_name, + job_name, + expand=None): + return client.get(resource_group_name=resource_group_name, + job_name=job_name, + expand=expand) + + +def databox_job_create(client, + resource_group_name, + job_name, + location, + sku, + transfer_type, + tags=None, + type_=None, + user_assigned_identities=None, + details=None, + delivery_type=None, + scheduled_date_time=None, + no_wait=False): + job_resource = {} + job_resource['location'] = location + job_resource['tags'] = tags + job_resource['sku'] = sku + job_resource['identity'] = {} + job_resource['identity']['type'] = type_ + job_resource['identity']['user_assigned_identities'] = user_assigned_identities + job_resource['details'] = details + job_resource['delivery_type'] = delivery_type + job_resource['delivery_info'] = {} + job_resource['delivery_info']['scheduled_date_time'] = scheduled_date_time + return sdk_no_wait(no_wait, + client.begin_create, + resource_group_name=resource_group_name, + job_name=job_name, + job_resource=job_resource) + + +def databox_job_update(client, + resource_group_name, + job_name, + if_match=None, + tags=None, + shipping_address=None, + kek_type=None, + kek_url=None, + kek_vault_resource_id=None, + type_=None, + user_assigned=None, + contact_name=None, + phone=None, + phone_extension=None, + mobile=None, + email_list=None, + notification_preference=None, + resource_identity_type=None, + user_assigned_identities=None, + no_wait=False): + job_resource_update_parameter = {} + job_resource_update_parameter['tags'] = tags + job_resource_update_parameter['details'] = {} + job_resource_update_parameter['details']['shipping_address'] = shipping_address + job_resource_update_parameter['details']['key_encryption_key'] = {} + job_resource_update_parameter['details']['key_encryption_key']['kek_type'] = kek_type + job_resource_update_parameter['details']['key_encryption_key']['kek_url'] = kek_url + job_resource_update_parameter['details']['key_encryption_key']['kek_vault_resource_id'] = kek_vault_resource_id + job_resource_update_parameter['contact_details'] = {} + job_resource_update_parameter['contact_details']['contact_name'] = contact_name + job_resource_update_parameter['contact_details']['phone'] = phone + job_resource_update_parameter['contact_details']['phone_extension'] = phone_extension + job_resource_update_parameter['contact_details']['mobile'] = mobile + job_resource_update_parameter['contact_details']['email_list'] = email_list + job_resource_update_parameter['contact_details']['notification_preference'] = notification_preference + job_resource_update_parameter['identity'] = {} + job_resource_update_parameter['identity']['type'] = resource_identity_type + job_resource_update_parameter['identity']['user_assigned_identities'] = user_assigned_identities + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + job_name=job_name, + if_match=if_match, + job_resource_update_parameter=job_resource_update_parameter) + + +def databox_job_delete(client, + resource_group_name, + job_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + job_name=job_name) + + +def databox_job_book_shipment_pick_up(client, + resource_group_name, + job_name, + start_time, + end_time, + shipment_location): + shipment_pick_up_request = {} + shipment_pick_up_request['start_time'] = start_time + shipment_pick_up_request['end_time'] = end_time + shipment_pick_up_request['shipment_location'] = shipment_location + return client.book_shipment_pick_up(resource_group_name=resource_group_name, + job_name=job_name, + shipment_pick_up_request=shipment_pick_up_request) + + +def databox_job_cancel(client, + resource_group_name, + job_name, + reason): + cancellation_reason = {} + cancellation_reason['reason'] = reason + return client.cancel(resource_group_name=resource_group_name, + job_name=job_name, + cancellation_reason=cancellation_reason) + + +def databox_job_list_credentials(client, + resource_group_name, + job_name): + return client.list_credentials(resource_group_name=resource_group_name, + job_name=job_name) + + +def databox_service_list_available_sku_by_resource_group(client, + resource_group_name, + location, + transfer_type, + country, + available_sku_request_location, + sku_names=None): + available_sku_request = {} + available_sku_request['transfer_type'] = transfer_type + available_sku_request['country'] = country + available_sku_request['location'] = available_sku_request_location + available_sku_request['sku_names'] = sku_names + return client.list_available_skus_by_resource_group(resource_group_name=resource_group_name, + location=location, + available_sku_request=available_sku_request) + + +def databox_service_region_configuration(client, + location, + data_box_schedule_availability_request=None, + disk_schedule_availability_request=None, + heavy_schedule_availability_request=None, + sku_name=None): + all_schedule_availability_request = [] + if data_box_schedule_availability_request is not None: + all_schedule_availability_request.append(data_box_schedule_availability_request) + if disk_schedule_availability_request is not None: + all_schedule_availability_request.append(disk_schedule_availability_request) + if heavy_schedule_availability_request is not None: + all_schedule_availability_request.append(heavy_schedule_availability_request) + if len(all_schedule_availability_request) > 1: + raise CLIError('at most one of data_box_schedule_availability_request, disk_schedule_availability_request, ' + 'heavy_schedule_availability_request is needed for schedule_availability_request!') + schedule_availability_request = all_schedule_availability_request[0] if len(all_schedule_availability_request) == \ + 1 else None + region_configuration_request = {} + region_configuration_request['schedule_availability_request'] = schedule_availability_request + region_configuration_request['transport_availability_request'] = {} + region_configuration_request['transport_availability_request']['sku_name'] = sku_name + return client.region_configuration(location=location, + region_configuration_request=region_configuration_request) + + +def databox_service_region_configuration_by_resource_group(client, + resource_group_name, + location, + data_box_schedule_availability_request=None, + disk_schedule_availability_request=None, + heavy_schedule_availability_request=None, + sku_name=None): + all_schedule_availability_request = [] + if data_box_schedule_availability_request is not None: + all_schedule_availability_request.append(data_box_schedule_availability_request) + if disk_schedule_availability_request is not None: + all_schedule_availability_request.append(disk_schedule_availability_request) + if heavy_schedule_availability_request is not None: + all_schedule_availability_request.append(heavy_schedule_availability_request) + if len(all_schedule_availability_request) > 1: + raise CLIError('at most one of data_box_schedule_availability_request, disk_schedule_availability_request, ' + 'heavy_schedule_availability_request is needed for schedule_availability_request!') + schedule_availability_request = all_schedule_availability_request[0] if len(all_schedule_availability_request) == \ + 1 else None + region_configuration_request = {} + region_configuration_request['schedule_availability_request'] = schedule_availability_request + region_configuration_request['transport_availability_request'] = {} + region_configuration_request['transport_availability_request']['sku_name'] = sku_name + return client.region_configuration_by_resource_group(resource_group_name=resource_group_name, + location=location, + region_configuration_request=region_configuration_request) + + +def databox_service_validate_address(client, + location, + validation_type, + shipping_address, + device_type, + preferred_shipment_type=None): + validate_address = {} + validate_address['shipping_address'] = shipping_address + validate_address['device_type'] = device_type + validate_address['transport_preferences'] = {} + validate_address['transport_preferences']['preferred_shipment_type'] = preferred_shipment_type + return client.validate_address(location=location, + validate_address=validate_address) + + +def databox_service_validate_input(client, + location, + create_job_validations=None): + all_validation_request = [] + if create_job_validations is not None: + all_validation_request.append(create_job_validations) + if len(all_validation_request) > 1: + raise CLIError('at most one of create_job_validations is needed for validation_request!') + if len(all_validation_request) != 1: + raise CLIError('validation_request is required. but none of create_job_validations is provided!') + validation_request = all_validation_request[0] if len(all_validation_request) == 1 else None + return client.validate_inputs(location=location, + validation_request=validation_request) + + +def databox_service_validate_input_by_resource_group(client, + resource_group_name, + location, + create_job_validations=None): + all_validation_request = [] + if create_job_validations is not None: + all_validation_request.append(create_job_validations) + if len(all_validation_request) > 1: + raise CLIError('at most one of create_job_validations is needed for validation_request!') + if len(all_validation_request) != 1: + raise CLIError('validation_request is required. but none of create_job_validations is provided!') + validation_request = all_validation_request[0] if len(all_validation_request) == 1 else None + return client.validate_inputs_by_resource_group(resource_group_name=resource_group_name, + location=location, + validation_request=validation_request) diff --git a/src/databox/azext_databox/manual/__init__.py b/src/databox/azext_databox/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/databox/azext_databox/manual/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/databox/azext_databox/tests/__init__.py b/src/databox/azext_databox/tests/__init__.py new file mode 100644 index 00000000000..70488e93851 --- /dev/null +++ b/src/databox/azext_databox/tests/__init__.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +import inspect +import logging +import os +import sys +import traceback +import datetime as dt + +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +logger = logging.getLogger('azure.cli.testsdk') +logger.addHandler(logging.StreamHandler()) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] +test_map = dict() +SUCCESSED = "successed" +FAILED = "failed" + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func).lower() + module_path = __path__[0].lower() + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + logger.info("Found manual override for %s(...)", func.__name__) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + logger.info("running %s()...", func.__name__) + try: + test_map[func.__name__] = dict() + test_map[func.__name__]["result"] = SUCCESSED + test_map[func.__name__]["error_message"] = "" + test_map[func.__name__]["error_stack"] = "" + test_map[func.__name__]["error_normalized"] = "" + test_map[func.__name__]["start_dt"] = dt.datetime.utcnow() + ret = func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, + JMESPathCheckAssertionError) as e: + use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE") + if use_exception_cache is None or use_exception_cache.lower() != "true": + raise + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + test_map[func.__name__]["result"] = FAILED + test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] + test_map[func.__name__]["error_stack"] = traceback.format_exc().replace( + "\r\n", " ").replace("\n", " ")[:500] + logger.info("--------------------------------------") + logger.info("step exception: %s", e) + logger.error("--------------------------------------") + logger.error("step exception in %s: %s", func.__name__, e) + logger.info(traceback.format_exc()) + exceptions.append((func.__name__, sys.exc_info())) + else: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + return ret + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +def calc_coverage(filename): + filename = filename.split(".")[0] + coverage_name = filename + "_coverage.md" + with open(coverage_name, "w") as f: + f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n") + total = len(test_map) + covered = 0 + for k, v in test_map.items(): + if not k.startswith("step_"): + total -= 1 + continue + if v["result"] == SUCCESSED: + covered += 1 + f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|" + "{end_dt}|\n".format(step_name=k, **v)) + f.write("Coverage: {}/{}\n".format(covered, total)) + print("Create coverage\n", file=sys.stderr) + + +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/databox/azext_databox/tests/latest/__init__.py b/src/databox/azext_databox/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/databox/azext_databox/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/databox/azext_databox/tests/latest/example_steps.py b/src/databox/azext_databox/tests/latest/example_steps.py new file mode 100644 index 00000000000..6a565dd2408 --- /dev/null +++ b/src/databox/azext_databox/tests/latest/example_steps.py @@ -0,0 +1,405 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +from .. import try_manual + + +# EXAMPLE: /Jobs/put/JobsCreate +@try_manual +def step_job_create(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=None): + if checks is None: + checks = [] + test.cmd('az databox job create ' + '--name "{myJob}" ' + '--location "westus" ' + '--transfer-type "ImportToAzure" ' + '--details "{{\\"contactDetails\\":{{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@m' + 'icrosoft.com\\"],\\"phone\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"}},\\"dataImportDetails\\":[' + '{{\\"accountDetails\\":{{\\"dataAccountType\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscripti' + 'ons/{subscription_id}/resourcegroups/{rg_4}/providers/Microsoft.Storage/storageAccounts/{sa}\\"}}}}],\\"j' + 'obDetailsType\\":\\"DataBox\\",\\"shippingAddress\\":{{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"S' + 'an Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"' + 'stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit ' + '1\\"}}}}" ' + '--sku name="DataBox" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Jobs/put/JobsCreateDevicePassword +@try_manual +def step_job_create2(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=None): + if checks is None: + checks = [] + test.cmd('az databox job create ' + '--name "{myJob4}" ' + '--location "westus" ' + '--transfer-type "ImportToAzure" ' + '--details "{{\\"contactDetails\\":{{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@m' + 'icrosoft.com\\"],\\"phone\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"}},\\"dataImportDetails\\":[' + '{{\\"accountDetails\\":{{\\"dataAccountType\\":\\"StorageAccount\\",\\"sharePassword\\":\\"\\",\\"storageAccountId\\":\\"/subscriptions/{subscription_id}/resourceGroups/{rg_5}/providers/Microsoft' + '.Storage/storageAccounts/{sa_2}\\"}}}}],\\"devicePassword\\":\\"\\",\\"jobDetailsType\\":' + '\\"DataBox\\",\\"shippingAddress\\":{{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San ' + 'Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"sta' + 'teOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit ' + '1\\"}}}}" ' + '--sku name="DataBox" ' + '--resource-group "{rg_6}"', + checks=checks) + + +# EXAMPLE: /Jobs/put/JobsCreateDoubleEncryption +@try_manual +def step_job_create3(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=None): + if checks is None: + checks = [] + test.cmd('az databox job create ' + '--name "{myJob5}" ' + '--location "westus" ' + '--transfer-type "ImportToAzure" ' + '--details "{{\\"contactDetails\\":{{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@m' + 'icrosoft.com\\"],\\"phone\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"}},\\"dataImportDetails\\":[' + '{{\\"accountDetails\\":{{\\"dataAccountType\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscripti' + 'ons/{subscription_id}/resourcegroups/{rg_4}/providers/Microsoft.Storage/storageAccounts/{sa}\\"}}}}],\\"j' + 'obDetailsType\\":\\"DataBox\\",\\"preferences\\":{{\\"encryptionPreferences\\":{{\\"doubleEncryption\\":' + '\\"Enabled\\"}}}},\\"shippingAddress\\":{{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San ' + 'Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"sta' + 'teOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit ' + '1\\"}}}}" ' + '--sku name="DataBox" ' + '--resource-group "{rg_7}"', + checks=checks) + + +# EXAMPLE: /Jobs/put/JobsCreateExport +@try_manual +def step_job_create4(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=None): + if checks is None: + checks = [] + test.cmd('az databox job create ' + '--name "{myJob3}" ' + '--location "westus" ' + '--transfer-type "ExportFromAzure" ' + '--details "{{\\"contactDetails\\":{{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@m' + 'icrosoft.com\\"],\\"phone\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"}},\\"dataExportDetails\\":[' + '{{\\"accountDetails\\":{{\\"dataAccountType\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscripti' + 'ons/{subscription_id}/resourceGroups/{rg_8}/providers/Microsoft.Storage/storageAccounts/{sa_3}\\"}},\\"tr' + 'ansferConfiguration\\":{{\\"transferAllDetails\\":{{\\"include\\":{{\\"dataAccountType\\":\\"StorageAccou' + 'nt\\",\\"transferAllBlobs\\":true,\\"transferAllFiles\\":true}}}},\\"transferConfigurationType\\":\\"Tran' + 'sferAll\\"}}}}],\\"jobDetailsType\\":\\"DataBox\\",\\"shippingAddress\\":{{\\"addressType\\":\\"Commercia' + 'l\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"postalCod' + 'e\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND ' + 'ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}}}" ' + '--sku name="DataBox" ' + '--resource-group "{rg_3}"', + checks=checks) + + +# EXAMPLE: /Jobs/put/JobsCreateWithUserAssignedIdentity +@try_manual +def step_job_create5(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=None): + if checks is None: + checks = [] + test.cmd('az databox job create ' + '--name "{myJob6}" ' + '--type "UserAssigned" ' + '--user-assigned-identities "{{\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akven' + 'kat/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sdkIdentity\\":{{}}}}" ' + '--location "westus" ' + '--transfer-type "ImportToAzure" ' + '--details "{{\\"contactDetails\\":{{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@m' + 'icrosoft.com\\"],\\"phone\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"}},\\"dataImportDetails\\":[' + '{{\\"accountDetails\\":{{\\"dataAccountType\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscripti' + 'ons/{subscription_id}/resourceGroups/{rg_5}/providers/Microsoft.Storage/storageAccounts/{sa_2}\\"}}}}],\\' + '"jobDetailsType\\":\\"DataBox\\",\\"shippingAddress\\":{{\\"addressType\\":\\"Commercial\\",\\"city\\":\\' + '"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",' + '\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit ' + '1\\"}}}}" ' + '--sku name="DataBox" ' + '--resource-group "{rg_9}"', + checks=checks) + + +# EXAMPLE: /Jobs/get/JobsGet +@try_manual +def step_job_show(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, checks=None): + if checks is None: + checks = [] + test.cmd('az databox job show ' + '--expand "details" ' + '--name "{myJob}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Jobs/get/JobsGetCmk +@try_manual +def step_job_show2(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, checks=None): + if checks is None: + checks = [] + test.cmd('az databox job show ' + '--expand "details" ' + '--name "{myJob2}" ' + '--resource-group "{rg_2}"', + checks=checks) + + +# EXAMPLE: /Jobs/get/JobsGetExport +@try_manual +def step_job_show3(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, checks=None): + if checks is None: + checks = [] + test.cmd('az databox job show ' + '--expand "details" ' + '--name "{myJob3}" ' + '--resource-group "{rg_3}"', + checks=checks) + + +# EXAMPLE: /Jobs/get/JobsList +@try_manual +def step_job_list(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, checks=None): + if checks is None: + checks = [] + test.cmd('az databox job list ' + '-g ""', + checks=checks) + + +# EXAMPLE: /Jobs/get/JobsListByResourceGroup +@try_manual +def step_job_list2(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, checks=None): + if checks is None: + checks = [] + test.cmd('az databox job list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Jobs/patch/JobsPatch +@try_manual +def step_job_update(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=None): + if checks is None: + checks = [] + test.cmd('az databox job update ' + '--name "{myJob}" ' + '--contact-name "Update Job" ' + '--email-list "testing@microsoft.com" ' + '--phone "1234567890" ' + '--phone-extension "1234" ' + '--shipping-address address-type="Commercial" city="San Francisco" company-name="Microsoft" country="US" ' + 'postal-code="94107" state-or-province="CA" street-address1="16 TOWNSEND ST" street-address2="Unit 1" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Jobs/patch/JobsPatchCmk +@try_manual +def step_job_update2(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=None): + if checks is None: + checks = [] + test.cmd('az databox job update ' + '--name "{myJob2}" ' + '--kek-type "CustomerManaged" ' + '--kek-url "https://sdkkeyvault.vault.azure.net/keys/SSDKEY/" ' + '--kek-vault-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg_8}/providers/Microsoft.KeyVa' + 'ult/vaults/SDKKeyVault" ' + '--resource-group "{rg_2}"', + checks=checks) + + +# EXAMPLE: /Jobs/patch/JobsPatchSystemAssignedToUserAssigned +@try_manual +def step_job_update3(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=None): + if checks is None: + checks = [] + test.cmd('az databox job update ' + '--name "{myJob7}" ' + '--resource-identity-type "SystemAssigned,UserAssigned" ' + '--user-assigned-identities "{{\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akven' + 'kat/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sdkIdentity\\":{{}}}}" ' + '--type "UserAssigned" ' + '--user-assigned resource-id="/subscriptions/{subscription_id}/resourceGroups/{rg_8}/providers/Microsoft.M' + 'anagedIdentity/userAssignedIdentities/sdkIdentity" ' + '--kek-type "CustomerManaged" ' + '--kek-url "https://sdkkeyvault.vault.azure.net/keys/SSDKEY/" ' + '--kek-vault-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg_8}/providers/Microsoft.KeyVa' + 'ult/vaults/SDKKeyVault" ' + '--resource-group "{rg_10}"', + checks=checks) + + +# EXAMPLE: /Jobs/post/BookShipmentPickupPost +@try_manual +def step_job_book_shipment_pick_up(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, + rg_13, checks=None): + if checks is None: + checks = [] + test.cmd('az databox job book-shipment-pick-up ' + '--name "{myJob8}" ' + '--resource-group "{rg_11}" ' + '--end-time "2019-09-22T18:30:00Z" ' + '--shipment-location "Front desk" ' + '--start-time "2019-09-20T18:30:00Z"', + checks=checks) + + +# EXAMPLE: /Jobs/post/JobsCancelPost +@try_manual +def step_job_cancel(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=None): + if checks is None: + checks = [] + test.cmd('az databox job cancel ' + '--reason "CancelTest" ' + '--name "{myJob}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Jobs/post/JobsListCredentials +@try_manual +def step_job_list_credentials(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=None): + if checks is None: + checks = [] + test.cmd('az databox job list-credentials ' + '--name "{myJob8}" ' + '--resource-group "{rg_11}"', + checks=checks) + + +# EXAMPLE: /Jobs/delete/JobsDelete +@try_manual +def step_job_delete(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=None): + if checks is None: + checks = [] + test.cmd('az databox job delete -y ' + '--name "{myJob}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Service/post/AvailableSkusPost +@try_manual +def step_service_list_available_sku_by_resource_group(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, + rg_11, rg_12, rg_13, checks=None): + if checks is None: + checks = [] + test.cmd('az databox service list-available-sku-by-resource-group ' + '--country "US" ' + '--available-sku-request-location "westus" ' + '--transfer-type "ImportToAzure" ' + '--location "westus" ' + '--resource-group "{rg_11}"', + checks=checks) + + +# EXAMPLE: /Service/post/RegionConfiguration +@try_manual +def step_service_region_configuration(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, + rg_13, checks=None): + if checks is None: + checks = [] + test.cmd('az databox service region-configuration ' + '--location "westus" ' + '--schedule-availability-request "{{\\"skuName\\":\\"DataBox\\",\\"storageLocation\\":\\"westus\\"}}"', + checks=checks) + + +# EXAMPLE: /Service/post/RegionConfigurationByResourceGroup +@try_manual +def step_service_region_configuration2(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, + rg_13, checks=None): + if checks is None: + checks = [] + test.cmd('az databox service region-configuration-by-resource-group ' + '--location "westus" ' + '--schedule-availability-request "{{\\"skuName\\":\\"DataBox\\",\\"storageLocation\\":\\"westus\\"}}" ' + '--resource-group "{rg_12}"', + checks=checks) + + +# EXAMPLE: /Service/post/ValidateAddressPost +@try_manual +def step_service_validate_address(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=None): + if checks is None: + checks = [] + test.cmd('az databox service validate-address ' + '--location "westus" ' + '--device-type "DataBox" ' + '--shipping-address address-type="Commercial" city="San Francisco" company-name="Microsoft" country="US" ' + 'postal-code="94107" state-or-province="CA" street-address1="16 TOWNSEND ST" street-address2="Unit 1" ' + '--validation-type "ValidateAddress"', + checks=checks) + + +# EXAMPLE: /Service/post/ValidateInputs +@try_manual +def step_service_validate_input(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=None): + if checks is None: + checks = [] + test.cmd('az databox service validate-input ' + '--location "westus" ' + '--validation-request "{{\\"individualRequestDetails\\":[{{\\"dataImportDetails\\":[{{\\"accountDetails\\"' + ':{{\\"dataAccountType\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/{subscription_id}/' + 'resourcegroups/{rg_4}/providers/Microsoft.Storage/storageAccounts/{sa}\\"}}}}],\\"deviceType\\":\\"DataBo' + 'x\\",\\"transferType\\":\\"ImportToAzure\\",\\"validationType\\":\\"ValidateDataTransferDetails\\"}},{{\\' + '"deviceType\\":\\"DataBox\\",\\"shippingAddress\\":{{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San' + ' Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"st' + 'ateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit ' + '1\\"}},\\"transportPreferences\\":{{\\"preferredShipmentType\\":\\"MicrosoftManaged\\"}},\\"validationTyp' + 'e\\":\\"ValidateAddress\\"}},{{\\"validationType\\":\\"ValidateSubscriptionIsAllowedToCreateJob\\"}},{{\\' + '"country\\":\\"US\\",\\"deviceType\\":\\"DataBox\\",\\"location\\":\\"westus\\",\\"transferType\\":\\"Imp' + 'ortToAzure\\",\\"validationType\\":\\"ValidateSkuAvailability\\"}},{{\\"deviceType\\":\\"DataBox\\",\\"va' + 'lidationType\\":\\"ValidateCreateOrderLimit\\"}},{{\\"deviceType\\":\\"DataBox\\",\\"preference\\":{{\\"t' + 'ransportPreferences\\":{{\\"preferredShipmentType\\":\\"MicrosoftManaged\\"}}}},\\"validationType\\":\\"V' + 'alidatePreferences\\"}}],\\"validationCategory\\":\\"JobCreationValidation\\"}}"', + checks=checks) + + +# EXAMPLE: /Service/post/ValidateInputsByResourceGroup +@try_manual +def step_service_validate_input_by_resource_group(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, + rg_11, rg_12, rg_13, checks=None): + if checks is None: + checks = [] + test.cmd('az databox service validate-input-by-resource-group ' + '--location "westus" ' + '--resource-group "{rg_13}" ' + '--validation-request "{{\\"individualRequestDetails\\":[{{\\"dataImportDetails\\":[{{\\"accountDetails\\"' + ':{{\\"dataAccountType\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/{subscription_id}/' + 'resourcegroups/{rg_4}/providers/Microsoft.Storage/storageAccounts/{sa}\\"}}}}],\\"deviceType\\":\\"DataBo' + 'x\\",\\"transferType\\":\\"ImportToAzure\\",\\"validationType\\":\\"ValidateDataTransferDetails\\"}},{{\\' + '"deviceType\\":\\"DataBox\\",\\"shippingAddress\\":{{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San' + ' Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"st' + 'ateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit ' + '1\\"}},\\"transportPreferences\\":{{\\"preferredShipmentType\\":\\"MicrosoftManaged\\"}},\\"validationTyp' + 'e\\":\\"ValidateAddress\\"}},{{\\"validationType\\":\\"ValidateSubscriptionIsAllowedToCreateJob\\"}},{{\\' + '"country\\":\\"US\\",\\"deviceType\\":\\"DataBox\\",\\"location\\":\\"westus\\",\\"transferType\\":\\"Imp' + 'ortToAzure\\",\\"validationType\\":\\"ValidateSkuAvailability\\"}},{{\\"deviceType\\":\\"DataBox\\",\\"va' + 'lidationType\\":\\"ValidateCreateOrderLimit\\"}},{{\\"deviceType\\":\\"DataBox\\",\\"preference\\":{{\\"t' + 'ransportPreferences\\":{{\\"preferredShipmentType\\":\\"MicrosoftManaged\\"}}}},\\"validationType\\":\\"V' + 'alidatePreferences\\"}}],\\"validationCategory\\":\\"JobCreationValidation\\"}}"', + checks=checks) + diff --git a/src/databox/azext_databox/tests/latest/test_databox_scenario.py b/src/databox/azext_databox/tests/latest/test_databox_scenario.py index 40d34369c2b..d32235e6ed9 100644 --- a/src/databox/azext_databox/tests/latest/test_databox_scenario.py +++ b/src/databox/azext_databox/tests/latest/test_databox_scenario.py @@ -1,141 +1,141 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- import os +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from azure.cli.testsdk import StorageAccountPreparer +from .example_steps import step_job_create +from .example_steps import step_job_show +from .example_steps import step_job_list2 +from .example_steps import step_job_list +from .example_steps import step_job_book_shipment_pick_up +from .example_steps import step_job_list_credentials +from .example_steps import step_job_cancel +from .example_steps import step_job_update +from .example_steps import step_service_validate_address +from .example_steps import step_service_list_available_sku_by_resource_group +from .example_steps import step_job_delete +from .. import ( + try_manual, + raise_if, + calc_coverage +) -from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer, JMESPathCheck) TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) -class DataBoxScenarioTest(ScenarioTest): +# Env setup_scenario +@try_manual +def setup_scenario(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + pass + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + pass + + +# Testcase: Scenario +@try_manual +def call_scenario(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + setup_scenario(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_job_create(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, checks=[ + test.check("name", "{myJob}", case_sensitive=False), + test.check("location", "westus", case_sensitive=False), + test.check("transferType", "ImportToAzure", case_sensitive=False), + test.check("sku.name", "DataBox", case_sensitive=False), + ]) + # STEP NOT FOUND: JobsGet5 + # STEP NOT FOUND: JobsGet4 + # STEP NOT FOUND: JobsGet3 + # STEP NOT FOUND: JobsGet2 + # STEP NOT FOUND: JobsGet1 + step_job_show(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, checks=[ + test.check("name", "{myJob}", case_sensitive=False), + test.check("location", "westus", case_sensitive=False), + test.check("transferType", "ImportToAzure", case_sensitive=False), + test.check("sku.name", "DataBox", case_sensitive=False), + ]) + step_job_list2(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, checks=[ + test.check('length(@)', 1), + ]) + step_job_list(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, checks=[ + test.check('length(@)', 8), + ]) + # STEP NOT FOUND: OperationsGet + # STEP NOT FOUND: ServiceValidateInputsByResourceGroup + # STEP NOT FOUND: AvailableSkusByResourceGroup + step_job_book_shipment_pick_up(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, + rg_13, checks=[]) + step_job_list_credentials(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=[]) + step_job_cancel(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, checks=[]) + step_job_update(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, checks=[ + test.check("name", "{myJob}", case_sensitive=False), + ]) + # STEP NOT FOUND: ServiceRegionConfiguration + step_service_validate_address(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, + checks=[]) + # STEP NOT FOUND: ServiceValidateInputs + step_service_list_available_sku_by_resource_group(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, + rg_11, rg_12, rg_13, checks=[]) + step_job_delete(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13, checks=[]) + cleanup_scenario(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + + +# Test class for Scenario +@try_manual +class DataboxScenarioTest(ScenarioTest): + + def __init__(self, *args, **kwargs): + super(DataboxScenarioTest, self).__init__(*args, **kwargs) + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) - @ResourceGroupPreparer(name_prefix='cli_test_databox') - @StorageAccountPreparer(parameter_name='storage_account_1') - @StorageAccountPreparer(parameter_name='storage_account_2') - def test_databox(self, storage_account_1, storage_account_2): - job_name = self.create_random_name('job', 24) self.kwargs.update({ - 'job_name': job_name, - 'storage_account_1': storage_account_1, - 'storage_account_2': storage_account_2 + 'myJob': 'SdkJob952', + 'myJob2': 'SdkJob1735', + 'myJob3': 'SdkJob6429', + 'myJob4': 'SdkJob9640', + 'myJob5': 'SdkJob6599', + 'myJob6': 'SdkJob5337', + 'myJob7': 'SdkJob2965', + 'myJob8': 'TJ-636646322037905056', }) - # Create a databox job with sku 'DataBox'. - self.cmd('databox job create ' - '--resource-group {rg} ' - '--name {job_name} ' - '--location westus ' - '--sku DataBox ' - '--contact-name "Public SDK Test" ' - '--phone 14258828080 ' - '--email-list testing@microsoft.com ' - '--street-address1 "1 MICROSOFT WAY" ' - '--city Redmond ' - '--state-or-province WA ' - '--country US ' - '--postal-code 98052 ' - '--company-name Microsoft ' - '--storage-account {storage_account_1} {storage_account_2} ' - '--staging-storage-account {storage_account_1} ' - '--resource-group-for-managed-disk rg-for-managed-disk', - checks=[JMESPathCheck('status', 'DeviceOrdered')]) - - self.cmd('databox job update ' - '--resource-group {rg} ' - '--name {job_name} ' - '--contact-name "Public SDK Test 1" ' - '--email-list testing1@microsoft.com', - checks=[]) - - self.cmd('databox job show ' - '--resource-group {rg} ' - '--name {job_name}', - checks=[ - JMESPathCheck('name', job_name), - JMESPathCheck('isCancellable', True), - JMESPathCheck('isDeletable', False), - JMESPathCheck('details.contactDetails.contactName', 'Public SDK Test 1'), - JMESPathCheck('details.contactDetails.emailList[0]', 'testing1@microsoft.com')]) - - self.cmd('databox job list ' - '--resource-group {rg}', - checks=[JMESPathCheck('length(@)', 1)]) - - self.cmd('databox job cancel ' - '--resource-group {rg} ' - '--name {job_name} ' - '--reason "CancelTest" ' - '-y', - checks=[]) - - self.cmd('databox job show ' - '--resource-group {rg} ' - '--name {job_name}', - checks=[ - JMESPathCheck('name', job_name), - JMESPathCheck('isCancellable', False), - JMESPathCheck('isDeletable', True)]) - - self.cmd('databox job delete ' - '--resource-group {rg} ' - '--name {job_name} ' - '-y', - checks=[]) - - self.cmd('databox job show ' - '--resource-group {rg} ' - '--name {job_name}', - expect_failure=True) - - # Create another databox job with sku 'DataBoxDisk'. - self.cmd('databox job create ' - '--resource-group {rg} ' - '--name {job_name} ' - '--location westus ' - '--sku DataBoxDisk ' - '--expected-data-size 1 ' - '--contact-name "Public SDK Test" ' - '--phone 14258828080 ' - '--email-list testing@microsoft.com ' - '--street-address1 "1 MICROSOFT WAY" ' - '--city Redmond ' - '--state-or-province WA ' - '--country US ' - '--postal-code 98052 ' - '--company-name Microsoft ' - '--storage-account {storage_account_1}', - checks=[JMESPathCheck('status', 'DeviceOrdered')]) - - self.cmd('databox job cancel ' - '--resource-group {rg} ' - '--name {job_name} ' - '--reason "CancelTest" ' - '-y', - checks=[]) - - self.cmd('databox job delete ' - '--resource-group {rg} ' - '--name {job_name} ' - '-y', - checks=[]) - - self.cmd('databox job show ' - '--resource-group {rg} ' - '--name {job_name}', - expect_failure=True) - - # DataBox service will create a lock 'DATABOX_SERVICE' on the storage account under the resource group when creating a job. In order to clean up the resource group, we need delete the lock first. - self.cmd('lock delete ' - '--name DATABOX_SERVICE ' - '-g {rg} ' - '--resource-name {storage_account_1} ' - '--resource-type Microsoft.Storage/storageAccounts') - - self.cmd('lock delete ' - '--name DATABOX_SERVICE ' - '-g {rg} ' - '--resource-name {storage_account_2} ' - '--resource-type Microsoft.Storage/storageAccounts') + + @ResourceGroupPreparer(name_prefix='clitestdatabox_databoxbvt'[:7], key='rg_4', parameter_name='rg_4') + @ResourceGroupPreparer(name_prefix='clitestdatabox_databoxbvt1'[:7], key='rg_5', parameter_name='rg_5') + @ResourceGroupPreparer(name_prefix='clitestdatabox_akvenkat'[:7], key='rg_8', parameter_name='rg_8') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg5154'[:7], key='rg', parameter_name='rg') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg7937'[:7], key='rg_2', parameter_name='rg_2') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg8091'[:7], key='rg_3', parameter_name='rg_3') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg7478'[:7], key='rg_6', parameter_name='rg_6') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg608'[:7], key='rg_7', parameter_name='rg_7') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg7552'[:7], key='rg_9', parameter_name='rg_9') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg9765'[:7], key='rg_10', parameter_name='rg_10') + @ResourceGroupPreparer(name_prefix='clitestdatabox_bvttoolrg6'[:7], key='rg_11', parameter_name='rg_11') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg4981'[:7], key='rg_12', parameter_name='rg_12') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg6861'[:7], key='rg_13', parameter_name='rg_13') + @StorageAccountPreparer(name_prefix='clitestdatabox_databoxbvttestaccount'[:7], key='sa', + resource_group_parameter_name='rg_4') + @StorageAccountPreparer(name_prefix='clitestdatabox_databoxbvttestaccount2'[:7], key='sa_2', + resource_group_parameter_name='rg_5') + @StorageAccountPreparer(name_prefix='clitestdatabox_aaaaaa2'[:7], key='sa_3', + resource_group_parameter_name='rg_8') + def test_databox_Scenario(self, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + call_scenario(self, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + calc_coverage(__file__) + raise_if() + diff --git a/src/databox/azext_databox/vendored_sdks/__init__.py b/src/databox/azext_databox/vendored_sdks/__init__.py index 7183870ee56..c9cfdc73e77 100644 --- a/src/databox/azext_databox/vendored_sdks/__init__.py +++ b/src/databox/azext_databox/vendored_sdks/__init__.py @@ -1,6 +1,12 @@ -# -------------------------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- -__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/databox/azext_databox/vendored_sdks/databox/__init__.py b/src/databox/azext_databox/vendored_sdks/databox/__init__.py index 1c85885ae27..f2d0b24d67c 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/__init__.py +++ b/src/databox/azext_databox/vendored_sdks/databox/__init__.py @@ -1,19 +1,16 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import DataBoxManagementClientConfiguration from ._data_box_management_client import DataBoxManagementClient -__all__ = ['DataBoxManagementClient', 'DataBoxManagementClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['DataBoxManagementClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/databox/azext_databox/vendored_sdks/databox/_configuration.py b/src/databox/azext_databox/vendored_sdks/databox/_configuration.py index adf67e024e2..c88976ea32f 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/_configuration.py +++ b/src/databox/azext_databox/vendored_sdks/databox/_configuration.py @@ -1,48 +1,70 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class DataBoxManagementClientConfiguration(Configuration): + """Configuration for DataBoxManagementClient. -class DataBoxManagementClientConfiguration(AzureConfiguration): - """Configuration for DataBoxManagementClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The Subscription Id + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Subscription Id. :type subscription_id: str - :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - super(DataBoxManagementClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-databox/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2020-11-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'databoxmanagementclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/databox/azext_databox/vendored_sdks/databox/_data_box_management_client.py b/src/databox/azext_databox/vendored_sdks/databox/_data_box_management_client.py index 7c2f11f5e82..1aa9939e4ff 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/_data_box_management_client.py +++ b/src/databox/azext_databox/vendored_sdks/databox/_data_box_management_client.py @@ -1,16 +1,21 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import DataBoxManagementClientConfiguration from .operations import Operations @@ -19,41 +24,56 @@ from . import models -class DataBoxManagementClient(SDKClient): - """DataBoxManagementClient - - :ivar config: Configuration for client. - :vartype config: DataBoxManagementClientConfiguration +class DataBoxManagementClient(object): + """DataBoxManagementClient. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.operations.Operations - :ivar jobs: Jobs operations - :vartype jobs: azure.mgmt.databox.operations.JobsOperations - :ivar service: Service operations - :vartype service: azure.mgmt.databox.operations.ServiceOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The Subscription Id + :vartype operations: data_box_management_client.operations.Operations + :ivar jobs: JobsOperations operations + :vartype jobs: data_box_management_client.operations.JobsOperations + :ivar service: ServiceOperations operations + :vartype service: data_box_management_client.operations.ServiceOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Subscription Id. :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__( - self, credentials, subscription_id, base_url=None): - - self.config = DataBoxManagementClientConfiguration(credentials, subscription_id, base_url) - super(DataBoxManagementClient, self).__init__(self.config.credentials, self.config) + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-09-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.jobs = JobsOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.service = ServiceOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> DataBoxManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/__init__.py b/src/databox/azext_databox/vendored_sdks/databox/aio/__init__.py new file mode 100644 index 00000000000..bb6b75a72db --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._data_box_management_client import DataBoxManagementClient +__all__ = ['DataBoxManagementClient'] diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/_configuration.py b/src/databox/azext_databox/vendored_sdks/databox/aio/_configuration.py new file mode 100644 index 00000000000..fd03ebc76bc --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class DataBoxManagementClientConfiguration(Configuration): + """Configuration for DataBoxManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-11-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'databoxmanagementclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/_data_box_management_client.py b/src/databox/azext_databox/vendored_sdks/databox/aio/_data_box_management_client.py new file mode 100644 index 00000000000..4c6ff4a0fc2 --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/_data_box_management_client.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, 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 import DataBoxManagementClientConfiguration +from .operations import Operations +from .operations import JobsOperations +from .operations import ServiceOperations +from .. import models + + +class DataBoxManagementClient(object): + """DataBoxManagementClient. + + :ivar operations: Operations operations + :vartype operations: data_box_management_client.aio.operations.Operations + :ivar jobs: JobsOperations operations + :vartype jobs: data_box_management_client.aio.operations.JobsOperations + :ivar service: ServiceOperations operations + :vartype service: data_box_management_client.aio.operations.ServiceOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Subscription Id. + :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__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.service = ServiceOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "DataBoxManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/operations/__init__.py b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/__init__.py new file mode 100644 index 00000000000..9c8fa7a8253 --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._jobs_operations import JobsOperations +from ._service_operations import ServiceOperations + +__all__ = [ + 'Operations', + 'JobsOperations', + 'ServiceOperations', +] diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_jobs_operations.py b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_jobs_operations.py new file mode 100644 index 00000000000..c29623a8349 --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_jobs_operations.py @@ -0,0 +1,844 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations: + """JobsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.JobResourceList"]: + """Lists all the jobs available under the subscription. + + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_management_client.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('JobResourceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.JobResourceList"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_management_client.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_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') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('JobResourceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + + async def get( + self, + resource_group_name: str, + job_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "models.JobResource": + """Gets information about the specified job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param expand: $expand is supported on details parameter for job, which provides details on the + job stages. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~data_box_management_client.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, 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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + job_name: str, + job_resource: "models.JobResource", + **kwargs + ) -> Optional["models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(job_resource, 'JobResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: "models.JobResource", + **kwargs + ) -> AsyncLROPoller["models.JobResource"]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param job_resource: Job details from request body. + :type job_resource: ~data_box_management_client.models.JobResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_management_client.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource=job_resource, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + job_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + # Construct 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + job_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[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 + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + job_name=job_name, + cls=lambda x,y,z: x, + **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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs + ) -> Optional["models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["models.JobResource"]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. + :type job_resource_update_parameter: ~data_box_management_client.models.JobResourceUpdateParameter + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the job on the server matches this value. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_management_client.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource_update_parameter=job_resource_update_parameter, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: "models.ShipmentPickUpRequest", + **kwargs + ) -> "models.ShipmentPickUpResponse": + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. + :type shipment_pick_up_request: ~data_box_management_client.models.ShipmentPickUpRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShipmentPickUpResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.ShipmentPickUpResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShipmentPickUpResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.book_shipment_pick_up.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + async def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: "models.CancellationReason", + **kwargs + ) -> None: + """CancelJob. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param cancellation_reason: Reason for cancellation. + :type cancellation_reason: ~data_box_management_client.models.CancellationReason + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.cancel.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(cancellation_reason, 'CancellationReason') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + def list_credentials( + self, + resource_group_name: str, + job_name: str, + **kwargs + ) -> AsyncIterable["models.UnencryptedCredentialsList"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UnencryptedCredentialsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_management_client.models.UnencryptedCredentialsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UnencryptedCredentialsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, 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') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UnencryptedCredentialsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials'} # type: ignore diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_operations.py b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_operations.py new file mode 100644 index 00000000000..eb01f77c203 --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.OperationList"]: + """This method gets all the operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_management_client.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct 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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_service_operations.py b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_service_operations.py new file mode 100644 index 00000000000..7537d022d9e --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_service_operations.py @@ -0,0 +1,456 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ServiceOperations: + """ServiceOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: "models.AvailableSkuRequest", + **kwargs + ) -> AsyncIterable["models.AvailableSkusResult"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param available_sku_request: Filters for showing the available skus. + :type available_sku_request: ~data_box_management_client.models.AvailableSkuRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_management_client.models.AvailableSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, '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') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AvailableSkusResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_available_skus_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + + async def validate_address( + self, + location: str, + validate_address: "models.ValidateAddress", + **kwargs + ) -> "models.AddressValidationOutput": + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The location of the resource. + :type location: str + :param validate_address: Shipping address of the customer. + :type validate_address: ~data_box_management_client.models.ValidateAddress + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AddressValidationOutput, or the result of cls(response) + :rtype: ~data_box_management_client.models.AddressValidationOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AddressValidationOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_address.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validate_address, 'ValidateAddress') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AddressValidationOutput', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: "models.ValidationRequest", + **kwargs + ) -> "models.ValidationResponse": + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~data_box_management_client.models.ValidationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validation_request, 'ValidationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate_inputs_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + async def validate_inputs( + self, + location: str, + validation_request: "models.ValidationRequest", + **kwargs + ) -> "models.ValidationResponse": + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~data_box_management_client.models.ValidationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_inputs.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validation_request, 'ValidationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + async def region_configuration( + self, + location: str, + region_configuration_request: "models.RegionConfigurationRequest", + **kwargs + ) -> "models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + :type region_configuration_request: ~data_box_management_client.models.RegionConfigurationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegionConfigurationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.region_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: "models.RegionConfigurationRequest", + **kwargs + ) -> "models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. + :type region_configuration_request: ~data_box_management_client.models.RegionConfigurationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegionConfigurationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.region_configuration_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore diff --git a/src/databox/azext_databox/vendored_sdks/databox/models/__init__.py b/src/databox/azext_databox/vendored_sdks/databox/models/__init__.py index ade07b1ec9a..14f8f8c755c 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/models/__init__.py +++ b/src/databox/azext_databox/vendored_sdks/databox/models/__init__.py @@ -1,27 +1,32 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- try: from ._models_py3 import AccountCredentialDetails + from ._models_py3 import AdditionalErrorInfo from ._models_py3 import AddressValidationOutput + from ._models_py3 import AddressValidationProperties + from ._models_py3 import ApiError from ._models_py3 import ApplianceNetworkConfiguration from ._models_py3 import ArmBaseObject from ._models_py3 import AvailableSkuRequest + from ._models_py3 import AvailableSkusResult + from ._models_py3 import AzureFileFilterDetails + from ._models_py3 import BlobFilterDetails from ._models_py3 import CancellationReason + from ._models_py3 import CloudError from ._models_py3 import ContactDetails from ._models_py3 import CopyLogDetails from ._models_py3 import CopyProgress from ._models_py3 import CreateJobValidations from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties + from ._models_py3 import DataAccountDetails from ._models_py3 import DataBoxAccountCopyLogDetails from ._models_py3 import DataBoxDiskCopyLogDetails from ._models_py3 import DataBoxDiskCopyProgress @@ -32,30 +37,36 @@ from ._models_py3 import DataBoxHeavyJobSecrets from ._models_py3 import DataBoxHeavySecret from ._models_py3 import DataBoxJobDetails - from ._models_py3 import DataboxJobSecrets from ._models_py3 import DataBoxScheduleAvailabilityRequest from ._models_py3 import DataBoxSecret - from ._models_py3 import DataDestinationDetailsValidationRequest - from ._models_py3 import DataDestinationDetailsValidationResponseProperties + from ._models_py3 import DataExportDetails + from ._models_py3 import DataImportDetails + from ._models_py3 import DataLocationToServiceLocationMap + from ._models_py3 import DataTransferDetailsValidationRequest + from ._models_py3 import DataTransferDetailsValidationResponseProperties + from ._models_py3 import DataboxJobSecrets from ._models_py3 import DcAccessSecurityCode - from ._models_py3 import DestinationAccountDetails - from ._models_py3 import DestinationManagedDiskDetails - from ._models_py3 import DestinationStorageAccountDetails - from ._models_py3 import DestinationToServiceLocationMap + from ._models_py3 import Details from ._models_py3 import DiskScheduleAvailabilityRequest from ._models_py3 import DiskSecret - from ._models_py3 import Error + from ._models_py3 import EncryptionPreferences + from ._models_py3 import ErrorDetail + from ._models_py3 import FilterFileDetails from ._models_py3 import HeavyScheduleAvailabilityRequest + from ._models_py3 import IdentityProperties from ._models_py3 import JobDeliveryInfo from ._models_py3 import JobDetails - from ._models_py3 import JobErrorDetails from ._models_py3 import JobResource + from ._models_py3 import JobResourceList from ._models_py3 import JobResourceUpdateParameter from ._models_py3 import JobSecrets from ._models_py3 import JobStages + from ._models_py3 import KeyEncryptionKey + from ._models_py3 import ManagedDiskDetails from ._models_py3 import NotificationPreference from ._models_py3 import Operation from ._models_py3 import OperationDisplay + from ._models_py3 import OperationList from ._models_py3 import PackageShippingDetails from ._models_py3 import Preferences from ._models_py3 import PreferencesValidationRequest @@ -63,6 +74,7 @@ from ._models_py3 import RegionConfigurationRequest from ._models_py3 import RegionConfigurationResponse from ._models_py3 import Resource + from ._models_py3 import ResourceIdentity from ._models_py3 import ScheduleAvailabilityRequest from ._models_py3 import ScheduleAvailabilityResponse from ._models_py3 import ShareCredentialDetails @@ -75,133 +87,179 @@ from ._models_py3 import SkuCapacity from ._models_py3 import SkuCost from ._models_py3 import SkuInformation + from ._models_py3 import StorageAccountDetails from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties + from ._models_py3 import TransferAllDetails + from ._models_py3 import TransferConfiguration + from ._models_py3 import TransferConfigurationTransferAllDetails + from ._models_py3 import TransferConfigurationTransferFilterDetails + from ._models_py3 import TransferFilterDetails from ._models_py3 import TransportAvailabilityDetails from ._models_py3 import TransportAvailabilityRequest from ._models_py3 import TransportAvailabilityResponse from ._models_py3 import TransportPreferences from ._models_py3 import UnencryptedCredentials + from ._models_py3 import UnencryptedCredentialsList from ._models_py3 import UpdateJobDetails + from ._models_py3 import UserAssignedIdentity + from ._models_py3 import UserAssignedProperties from ._models_py3 import ValidateAddress from ._models_py3 import ValidationInputRequest from ._models_py3 import ValidationInputResponse from ._models_py3 import ValidationRequest from ._models_py3 import ValidationResponse except (SyntaxError, ImportError): - from ._models import AccountCredentialDetails - from ._models import AddressValidationOutput - from ._models import ApplianceNetworkConfiguration - from ._models import ArmBaseObject - from ._models import AvailableSkuRequest - from ._models import CancellationReason - from ._models import ContactDetails - from ._models import CopyLogDetails - from ._models import CopyProgress - from ._models import CreateJobValidations - from ._models import CreateOrderLimitForSubscriptionValidationRequest - from ._models import CreateOrderLimitForSubscriptionValidationResponseProperties - from ._models import DataBoxAccountCopyLogDetails - from ._models import DataBoxDiskCopyLogDetails - from ._models import DataBoxDiskCopyProgress - from ._models import DataBoxDiskJobDetails - from ._models import DataBoxDiskJobSecrets - from ._models import DataBoxHeavyAccountCopyLogDetails - from ._models import DataBoxHeavyJobDetails - from ._models import DataBoxHeavyJobSecrets - from ._models import DataBoxHeavySecret - from ._models import DataBoxJobDetails - from ._models import DataboxJobSecrets - from ._models import DataBoxScheduleAvailabilityRequest - from ._models import DataBoxSecret - from ._models import DataDestinationDetailsValidationRequest - from ._models import DataDestinationDetailsValidationResponseProperties - from ._models import DcAccessSecurityCode - from ._models import DestinationAccountDetails - from ._models import DestinationManagedDiskDetails - from ._models import DestinationStorageAccountDetails - from ._models import DestinationToServiceLocationMap - from ._models import DiskScheduleAvailabilityRequest - from ._models import DiskSecret - from ._models import Error - from ._models import HeavyScheduleAvailabilityRequest - from ._models import JobDeliveryInfo - from ._models import JobDetails - from ._models import JobErrorDetails - from ._models import JobResource - from ._models import JobResourceUpdateParameter - from ._models import JobSecrets - from ._models import JobStages - from ._models import NotificationPreference - from ._models import Operation - from ._models import OperationDisplay - from ._models import PackageShippingDetails - from ._models import Preferences - from ._models import PreferencesValidationRequest - from ._models import PreferencesValidationResponseProperties - from ._models import RegionConfigurationRequest - from ._models import RegionConfigurationResponse - from ._models import Resource - from ._models import ScheduleAvailabilityRequest - from ._models import ScheduleAvailabilityResponse - from ._models import ShareCredentialDetails - from ._models import ShipmentPickUpRequest - from ._models import ShipmentPickUpResponse - from ._models import ShippingAddress - from ._models import Sku - from ._models import SkuAvailabilityValidationRequest - from ._models import SkuAvailabilityValidationResponseProperties - from ._models import SkuCapacity - from ._models import SkuCost - from ._models import SkuInformation - from ._models import SubscriptionIsAllowedToCreateJobValidationRequest - from ._models import SubscriptionIsAllowedToCreateJobValidationResponseProperties - from ._models import TransportAvailabilityDetails - from ._models import TransportAvailabilityRequest - from ._models import TransportAvailabilityResponse - from ._models import TransportPreferences - from ._models import UnencryptedCredentials - from ._models import UpdateJobDetails - from ._models import ValidateAddress - from ._models import ValidationInputRequest - from ._models import ValidationInputResponse - from ._models import ValidationRequest - from ._models import ValidationResponse -from ._paged_models import JobResourcePaged -from ._paged_models import OperationPaged -from ._paged_models import SkuInformationPaged -from ._paged_models import UnencryptedCredentialsPaged + from ._models import AccountCredentialDetails # type: ignore + from ._models import AdditionalErrorInfo # type: ignore + from ._models import AddressValidationOutput # type: ignore + from ._models import AddressValidationProperties # type: ignore + from ._models import ApiError # type: ignore + from ._models import ApplianceNetworkConfiguration # type: ignore + from ._models import ArmBaseObject # type: ignore + from ._models import AvailableSkuRequest # type: ignore + from ._models import AvailableSkusResult # type: ignore + from ._models import AzureFileFilterDetails # type: ignore + from ._models import BlobFilterDetails # type: ignore + from ._models import CancellationReason # type: ignore + from ._models import CloudError # type: ignore + from ._models import ContactDetails # type: ignore + from ._models import CopyLogDetails # type: ignore + from ._models import CopyProgress # type: ignore + from ._models import CreateJobValidations # type: ignore + from ._models import CreateOrderLimitForSubscriptionValidationRequest # type: ignore + from ._models import CreateOrderLimitForSubscriptionValidationResponseProperties # type: ignore + from ._models import DataAccountDetails # type: ignore + from ._models import DataBoxAccountCopyLogDetails # type: ignore + from ._models import DataBoxDiskCopyLogDetails # type: ignore + from ._models import DataBoxDiskCopyProgress # type: ignore + from ._models import DataBoxDiskJobDetails # type: ignore + from ._models import DataBoxDiskJobSecrets # type: ignore + from ._models import DataBoxHeavyAccountCopyLogDetails # type: ignore + from ._models import DataBoxHeavyJobDetails # type: ignore + from ._models import DataBoxHeavyJobSecrets # type: ignore + from ._models import DataBoxHeavySecret # type: ignore + from ._models import DataBoxJobDetails # type: ignore + from ._models import DataBoxScheduleAvailabilityRequest # type: ignore + from ._models import DataBoxSecret # type: ignore + from ._models import DataExportDetails # type: ignore + from ._models import DataImportDetails # type: ignore + from ._models import DataLocationToServiceLocationMap # type: ignore + from ._models import DataTransferDetailsValidationRequest # type: ignore + from ._models import DataTransferDetailsValidationResponseProperties # type: ignore + from ._models import DataboxJobSecrets # type: ignore + from ._models import DcAccessSecurityCode # type: ignore + from ._models import Details # type: ignore + from ._models import DiskScheduleAvailabilityRequest # type: ignore + from ._models import DiskSecret # type: ignore + from ._models import EncryptionPreferences # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import FilterFileDetails # type: ignore + from ._models import HeavyScheduleAvailabilityRequest # type: ignore + from ._models import IdentityProperties # type: ignore + from ._models import JobDeliveryInfo # type: ignore + from ._models import JobDetails # type: ignore + from ._models import JobResource # type: ignore + from ._models import JobResourceList # type: ignore + from ._models import JobResourceUpdateParameter # type: ignore + from ._models import JobSecrets # type: ignore + from ._models import JobStages # type: ignore + from ._models import KeyEncryptionKey # type: ignore + from ._models import ManagedDiskDetails # type: ignore + from ._models import NotificationPreference # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationList # type: ignore + from ._models import PackageShippingDetails # type: ignore + from ._models import Preferences # type: ignore + from ._models import PreferencesValidationRequest # type: ignore + from ._models import PreferencesValidationResponseProperties # type: ignore + from ._models import RegionConfigurationRequest # type: ignore + from ._models import RegionConfigurationResponse # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceIdentity # type: ignore + from ._models import ScheduleAvailabilityRequest # type: ignore + from ._models import ScheduleAvailabilityResponse # type: ignore + from ._models import ShareCredentialDetails # type: ignore + from ._models import ShipmentPickUpRequest # type: ignore + from ._models import ShipmentPickUpResponse # type: ignore + from ._models import ShippingAddress # type: ignore + from ._models import Sku # type: ignore + from ._models import SkuAvailabilityValidationRequest # type: ignore + from ._models import SkuAvailabilityValidationResponseProperties # type: ignore + from ._models import SkuCapacity # type: ignore + from ._models import SkuCost # type: ignore + from ._models import SkuInformation # type: ignore + from ._models import StorageAccountDetails # type: ignore + from ._models import SubscriptionIsAllowedToCreateJobValidationRequest # type: ignore + from ._models import SubscriptionIsAllowedToCreateJobValidationResponseProperties # type: ignore + from ._models import TransferAllDetails # type: ignore + from ._models import TransferConfiguration # type: ignore + from ._models import TransferConfigurationTransferAllDetails # type: ignore + from ._models import TransferConfigurationTransferFilterDetails # type: ignore + from ._models import TransferFilterDetails # type: ignore + from ._models import TransportAvailabilityDetails # type: ignore + from ._models import TransportAvailabilityRequest # type: ignore + from ._models import TransportAvailabilityResponse # type: ignore + from ._models import TransportPreferences # type: ignore + from ._models import UnencryptedCredentials # type: ignore + from ._models import UnencryptedCredentialsList # type: ignore + from ._models import UpdateJobDetails # type: ignore + from ._models import UserAssignedIdentity # type: ignore + from ._models import UserAssignedProperties # type: ignore + from ._models import ValidateAddress # type: ignore + from ._models import ValidationInputRequest # type: ignore + from ._models import ValidationInputResponse # type: ignore + from ._models import ValidationRequest # type: ignore + from ._models import ValidationResponse # type: ignore + from ._data_box_management_client_enums import ( - DataDestinationType, - ShareDestinationFormatType, AccessProtocol, - AddressValidationStatus, AddressType, - SkuName, - SkuDisabledReason, - NotificationStageName, - ValidationStatus, + AddressValidationStatus, + ClassDiscriminator, CopyStatus, + DataAccountType, + DoubleEncryption, + FilterFileType, + JobDeliveryType, + KekType, + LogCollectionLevel, + NotificationStageName, + OverallValidationStatus, + ShareDestinationFormatType, + SkuDisabledReason, + SkuName, StageName, StageStatus, + TransferConfigurationType, + TransferType, TransportShipmentTypes, - JobDeliveryType, - OverallValidationStatus, + ValidationInputDiscriminator, + ValidationStatus, ) __all__ = [ 'AccountCredentialDetails', + 'AdditionalErrorInfo', 'AddressValidationOutput', + 'AddressValidationProperties', + 'ApiError', 'ApplianceNetworkConfiguration', 'ArmBaseObject', 'AvailableSkuRequest', + 'AvailableSkusResult', + 'AzureFileFilterDetails', + 'BlobFilterDetails', 'CancellationReason', + 'CloudError', 'ContactDetails', 'CopyLogDetails', 'CopyProgress', 'CreateJobValidations', 'CreateOrderLimitForSubscriptionValidationRequest', 'CreateOrderLimitForSubscriptionValidationResponseProperties', + 'DataAccountDetails', 'DataBoxAccountCopyLogDetails', 'DataBoxDiskCopyLogDetails', 'DataBoxDiskCopyProgress', @@ -212,30 +270,36 @@ 'DataBoxHeavyJobSecrets', 'DataBoxHeavySecret', 'DataBoxJobDetails', - 'DataboxJobSecrets', 'DataBoxScheduleAvailabilityRequest', 'DataBoxSecret', - 'DataDestinationDetailsValidationRequest', - 'DataDestinationDetailsValidationResponseProperties', + 'DataExportDetails', + 'DataImportDetails', + 'DataLocationToServiceLocationMap', + 'DataTransferDetailsValidationRequest', + 'DataTransferDetailsValidationResponseProperties', + 'DataboxJobSecrets', 'DcAccessSecurityCode', - 'DestinationAccountDetails', - 'DestinationManagedDiskDetails', - 'DestinationStorageAccountDetails', - 'DestinationToServiceLocationMap', + 'Details', 'DiskScheduleAvailabilityRequest', 'DiskSecret', - 'Error', + 'EncryptionPreferences', + 'ErrorDetail', + 'FilterFileDetails', 'HeavyScheduleAvailabilityRequest', + 'IdentityProperties', 'JobDeliveryInfo', 'JobDetails', - 'JobErrorDetails', 'JobResource', + 'JobResourceList', 'JobResourceUpdateParameter', 'JobSecrets', 'JobStages', + 'KeyEncryptionKey', + 'ManagedDiskDetails', 'NotificationPreference', 'Operation', 'OperationDisplay', + 'OperationList', 'PackageShippingDetails', 'Preferences', 'PreferencesValidationRequest', @@ -243,6 +307,7 @@ 'RegionConfigurationRequest', 'RegionConfigurationResponse', 'Resource', + 'ResourceIdentity', 'ScheduleAvailabilityRequest', 'ScheduleAvailabilityResponse', 'ShareCredentialDetails', @@ -255,36 +320,49 @@ 'SkuCapacity', 'SkuCost', 'SkuInformation', + 'StorageAccountDetails', 'SubscriptionIsAllowedToCreateJobValidationRequest', 'SubscriptionIsAllowedToCreateJobValidationResponseProperties', + 'TransferAllDetails', + 'TransferConfiguration', + 'TransferConfigurationTransferAllDetails', + 'TransferConfigurationTransferFilterDetails', + 'TransferFilterDetails', 'TransportAvailabilityDetails', 'TransportAvailabilityRequest', 'TransportAvailabilityResponse', 'TransportPreferences', 'UnencryptedCredentials', + 'UnencryptedCredentialsList', 'UpdateJobDetails', + 'UserAssignedIdentity', + 'UserAssignedProperties', 'ValidateAddress', 'ValidationInputRequest', 'ValidationInputResponse', 'ValidationRequest', 'ValidationResponse', - 'OperationPaged', - 'JobResourcePaged', - 'UnencryptedCredentialsPaged', - 'SkuInformationPaged', - 'DataDestinationType', - 'ShareDestinationFormatType', 'AccessProtocol', - 'AddressValidationStatus', 'AddressType', - 'SkuName', - 'SkuDisabledReason', - 'NotificationStageName', - 'ValidationStatus', + 'AddressValidationStatus', + 'ClassDiscriminator', 'CopyStatus', + 'DataAccountType', + 'DoubleEncryption', + 'FilterFileType', + 'JobDeliveryType', + 'KekType', + 'LogCollectionLevel', + 'NotificationStageName', + 'OverallValidationStatus', + 'ShareDestinationFormatType', + 'SkuDisabledReason', + 'SkuName', 'StageName', 'StageStatus', + 'TransferConfigurationType', + 'TransferType', 'TransportShipmentTypes', - 'JobDeliveryType', - 'OverallValidationStatus', + 'ValidationInputDiscriminator', + 'ValidationStatus', ] diff --git a/src/databox/azext_databox/vendored_sdks/databox/models/_data_box_management_client_enums.py b/src/databox/azext_databox/vendored_sdks/databox/models/_data_box_management_client_enums.py index 4cbea094a21..7d1d81567b8 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/models/_data_box_management_client_enums.py +++ b/src/databox/azext_databox/vendored_sdks/databox/models/_data_box_management_client_enums.py @@ -1,147 +1,237 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): -class DataDestinationType(str, Enum): - - storage_account = "StorageAccount" #: Storage Accounts . - managed_disk = "ManagedDisk" #: Azure Managed disk storage. - - -class ShareDestinationFormatType(str, Enum): - - unknown_type = "UnknownType" #: Unknown format. - hcs = "HCS" #: Storsimple data format. - block_blob = "BlockBlob" #: Azure storage block blob format. - page_blob = "PageBlob" #: Azure storage page blob format. - azure_file = "AzureFile" #: Azure storage file format. - managed_disk = "ManagedDisk" #: Azure Compute Disk. - - -class AccessProtocol(str, Enum): - - smb = "SMB" #: Server Message Block protocol(SMB). - nfs = "NFS" #: Network File System protocol(NFS). - - -class AddressValidationStatus(str, Enum): - - valid = "Valid" #: Address provided is valid. - invalid = "Invalid" #: Address provided is invalid or not supported. - ambiguous = "Ambiguous" #: Address provided is ambiguous, please choose one of the alternate addresses returned. - - -class AddressType(str, Enum): - - none = "None" #: Address type not known. - residential = "Residential" #: Residential Address. - commercial = "Commercial" #: Commercial Address. - - -class SkuName(str, Enum): - - data_box = "DataBox" #: Databox. - data_box_disk = "DataBoxDisk" #: DataboxDisk. - data_box_heavy = "DataBoxHeavy" #: DataboxHeavy. - - -class SkuDisabledReason(str, Enum): - - none = "None" #: SKU is not disabled. - country = "Country" #: SKU is not available in the requested country. - region = "Region" #: SKU is not available to push data to the requested Azure region. - feature = "Feature" #: Required features are not enabled for the SKU. - offer_type = "OfferType" #: Subscription does not have required offer types for the SKU. - no_subscription_info = "NoSubscriptionInfo" #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification. - - -class NotificationStageName(str, Enum): - - device_prepared = "DevicePrepared" #: Notification at device prepared stage. - dispatched = "Dispatched" #: Notification at device dispatched stage. - delivered = "Delivered" #: Notification at device delivered stage. - picked_up = "PickedUp" #: Notification at device picked up from user stage. - at_azure_dc = "AtAzureDC" #: Notification at device received at azure datacenter stage. - data_copy = "DataCopy" #: Notification at data copy started stage. - - -class ValidationStatus(str, Enum): - - valid = "Valid" #: Validation is successful - invalid = "Invalid" #: Validation is not successful - skipped = "Skipped" #: Validation is skipped - - -class CopyStatus(str, Enum): - - not_started = "NotStarted" #: Data copy hasn't started yet. - in_progress = "InProgress" #: Data copy is in progress. - completed = "Completed" #: Data copy completed. - completed_with_errors = "CompletedWithErrors" #: Data copy completed with errors. - failed = "Failed" #: Data copy failed. No data was copied. - not_returned = "NotReturned" #: No copy triggered as device was not returned. - hardware_error = "HardwareError" #: The Device has hit hardware issues. - device_formatted = "DeviceFormatted" #: Data copy failed. The Device was formatted by user. - device_metadata_modified = "DeviceMetadataModified" #: Data copy failed. Device metadata was modified by user. - storage_account_not_accessible = "StorageAccountNotAccessible" #: Data copy failed. Storage Account was not accessible during copy. - unsupported_data = "UnsupportedData" #: Data copy failed. The Device data content is not supported. - - -class StageName(str, Enum): - - device_ordered = "DeviceOrdered" #: An order has been created. - device_prepared = "DevicePrepared" #: A device has been prepared for the order. - dispatched = "Dispatched" #: Device has been dispatched to the user of the order. - delivered = "Delivered" #: Device has been delivered to the user of the order. - picked_up = "PickedUp" #: Device has been picked up from user and in transit to azure datacenter. - at_azure_dc = "AtAzureDC" #: Device has been received at azure datacenter from the user. - data_copy = "DataCopy" #: Data copy from the device at azure datacenter. - completed = "Completed" #: Order has completed. - completed_with_errors = "CompletedWithErrors" #: Order has completed with errors. - cancelled = "Cancelled" #: Order has been cancelled. - failed_issue_reported_at_customer = "Failed_IssueReportedAtCustomer" #: Order has failed due to issue reported by user. - failed_issue_detected_at_azure_dc = "Failed_IssueDetectedAtAzureDC" #: Order has failed due to issue detected at azure datacenter. - aborted = "Aborted" #: Order has been aborted. - completed_with_warnings = "CompletedWithWarnings" #: Order has completed with warnings. - ready_to_dispatch_from_azure_dc = "ReadyToDispatchFromAzureDC" #: Device is ready to be handed to customer from Azure DC. - ready_to_receive_at_azure_dc = "ReadyToReceiveAtAzureDC" #: Device can be dropped off at Azure DC. - - -class StageStatus(str, Enum): - - none = "None" #: No status available yet. - in_progress = "InProgress" #: Stage is in progress. - succeeded = "Succeeded" #: Stage has succeeded. - failed = "Failed" #: Stage has failed. - cancelled = "Cancelled" #: Stage has been cancelled. - cancelling = "Cancelling" #: Stage is cancelling. - succeeded_with_errors = "SucceededWithErrors" #: Stage has succeeded with errors. - - -class TransportShipmentTypes(str, Enum): - - customer_managed = "CustomerManaged" #: Shipment Logistics is handled by the customer. - microsoft_managed = "MicrosoftManaged" #: Shipment Logistics is handled by Microsoft. - - -class JobDeliveryType(str, Enum): - - non_scheduled = "NonScheduled" #: Non Scheduled job. - scheduled = "Scheduled" #: Scheduled job. - - -class OverallValidationStatus(str, Enum): - - all_valid_to_proceed = "AllValidToProceed" #: Every input request is valid. - inputs_revisit_required = "InputsRevisitRequired" #: Some input requests are not valid. - certain_input_validations_skipped = "CertainInputValidationsSkipped" #: Certain input validations skipped. + SMB = "SMB" #: Server Message Block protocol(SMB). + NFS = "NFS" #: Network File System protocol(NFS). + +class AddressType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of address. + """ + + NONE = "None" #: Address type not known. + RESIDENTIAL = "Residential" #: Residential Address. + COMMERCIAL = "Commercial" #: Commercial Address. + +class AddressValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The address validation status. + """ + + VALID = "Valid" #: Address provided is valid. + INVALID = "Invalid" #: Address provided is invalid or not supported. + AMBIGUOUS = "Ambiguous" #: Address provided is ambiguous, please choose one of the alternate addresses returned. + +class ClassDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates the type of job details. + """ + + DATA_BOX = "DataBox" #: Data Box orders. + DATA_BOX_DISK = "DataBoxDisk" #: Data Box Disk orders. + DATA_BOX_HEAVY = "DataBoxHeavy" #: Data Box Heavy orders. + +class CopyStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Status of the copy + """ + + NOT_STARTED = "NotStarted" #: Data copy hasn't started yet. + IN_PROGRESS = "InProgress" #: Data copy is in progress. + COMPLETED = "Completed" #: Data copy completed. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" #: Data copy completed with errors. + FAILED = "Failed" #: Data copy failed. No data was copied. + NOT_RETURNED = "NotReturned" #: No copy triggered as device was not returned. + HARDWARE_ERROR = "HardwareError" #: The Device has hit hardware issues. + DEVICE_FORMATTED = "DeviceFormatted" #: Data copy failed. The Device was formatted by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" #: Data copy failed. Device metadata was modified by user. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" #: Data copy failed. Storage Account was not accessible during copy. + UNSUPPORTED_DATA = "UnsupportedData" #: Data copy failed. The Device data content is not supported. + +class DataAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the account. + """ + + STORAGE_ACCOUNT = "StorageAccount" #: Storage Accounts . + MANAGED_DISK = "ManagedDisk" #: Azure Managed disk storage. + +class DoubleEncryption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines secondary layer of software-based encryption enablement. + """ + + ENABLED = "Enabled" #: Software-based encryption is enabled. + DISABLED = "Disabled" #: Software-based encryption is disabled. + +class FilterFileType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the filter file. + """ + + AZURE_BLOB = "AzureBlob" #: Filter file is of the type AzureBlob. + AZURE_FILE = "AzureFile" #: Filter file is of the type AzureFiles. + +class JobDeliveryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Delivery type of Job. + """ + + NON_SCHEDULED = "NonScheduled" #: Non Scheduled job. + SCHEDULED = "Scheduled" #: Scheduled job. + +class KekType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of encryption key used for key encryption. + """ + + MICROSOFT_MANAGED = "MicrosoftManaged" #: Key encryption key is managed by Microsoft. + CUSTOMER_MANAGED = "CustomerManaged" #: Key encryption key is managed by the Customer. + +class LogCollectionLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Level of the logs to be collected. + """ + + ERROR = "Error" #: Only Errors will be collected in the logs. + VERBOSE = "Verbose" #: Verbose logging (includes Errors, CRC, size information and others). + +class NotificationStageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of the stage. + """ + + DEVICE_PREPARED = "DevicePrepared" #: Notification at device prepared stage. + DISPATCHED = "Dispatched" #: Notification at device dispatched stage. + DELIVERED = "Delivered" #: Notification at device delivered stage. + PICKED_UP = "PickedUp" #: Notification at device picked up from user stage. + AT_AZURE_DC = "AtAzureDC" #: Notification at device received at Azure datacenter stage. + DATA_COPY = "DataCopy" #: Notification at data copy started stage. + +class OverallValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Overall validation status. + """ + + ALL_VALID_TO_PROCEED = "AllValidToProceed" #: Every input request is valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" #: Some input requests are not valid. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" #: Certain input validations skipped. + +class ShareDestinationFormatType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the share. + """ + + UNKNOWN_TYPE = "UnknownType" #: Unknown format. + HCS = "HCS" #: Storsimple data format. + BLOCK_BLOB = "BlockBlob" #: Azure storage block blob format. + PAGE_BLOB = "PageBlob" #: Azure storage page blob format. + AZURE_FILE = "AzureFile" #: Azure storage file format. + MANAGED_DISK = "ManagedDisk" #: Azure Compute Disk. + AZURE_PREMIUM_FILES = "AzurePremiumFiles" #: Azure storage Premium Files format. + +class SkuDisabledReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Reason why the Sku is disabled. + """ + + NONE = "None" #: SKU is not disabled. + COUNTRY = "Country" #: SKU is not available in the requested country. + REGION = "Region" #: SKU is not available to push data to the requested Azure region. + FEATURE = "Feature" #: Required features are not enabled for the SKU. + OFFER_TYPE = "OfferType" #: Subscription does not have required offer types for the SKU. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification. + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DATA_BOX = "DataBox" #: Data Box. + DATA_BOX_DISK = "DataBoxDisk" #: Data Box Disk. + DATA_BOX_HEAVY = "DataBoxHeavy" #: Data Box Heavy. + +class StageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of the stage which is in progress. + """ + + DEVICE_ORDERED = "DeviceOrdered" #: An order has been created. + DEVICE_PREPARED = "DevicePrepared" #: A device has been prepared for the order. + DISPATCHED = "Dispatched" #: Device has been dispatched to the user of the order. + DELIVERED = "Delivered" #: Device has been delivered to the user of the order. + PICKED_UP = "PickedUp" #: Device has been picked up from user and in transit to Azure datacenter. + AT_AZURE_DC = "AtAzureDC" #: Device has been received at Azure datacenter from the user. + DATA_COPY = "DataCopy" #: Data copy from the device at Azure datacenter. + COMPLETED = "Completed" #: Order has completed. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" #: Order has completed with errors. + CANCELLED = "Cancelled" #: Order has been cancelled. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" #: Order has failed due to issue reported by user. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" #: Order has failed due to issue detected at Azure datacenter. + ABORTED = "Aborted" #: Order has been aborted. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" #: Order has completed with warnings. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" #: Device is ready to be handed to customer from Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" #: Device can be dropped off at Azure DC. + +class StageStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the job stage. + """ + + NONE = "None" #: No status available yet. + IN_PROGRESS = "InProgress" #: Stage is in progress. + SUCCEEDED = "Succeeded" #: Stage has succeeded. + FAILED = "Failed" #: Stage has failed. + CANCELLED = "Cancelled" #: Stage has been cancelled. + CANCELLING = "Cancelling" #: Stage is cancelling. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" #: Stage has succeeded with errors. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" #: Stage is stuck until customer takes some action. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" #: Stage has succeeded with warnings. + +class TransferConfigurationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the configuration for transfer. + """ + + TRANSFER_ALL = "TransferAll" #: Transfer all the data. + TRANSFER_USING_FILTER = "TransferUsingFilter" #: Transfer using filter. + +class TransferType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the transfer. + """ + + IMPORT_TO_AZURE = "ImportToAzure" #: Import data to azure. + EXPORT_FROM_AZURE = "ExportFromAzure" #: Export data from azure. + +class TransportShipmentTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Transport Shipment Type supported for given region. + """ + + CUSTOMER_MANAGED = "CustomerManaged" #: Shipment Logistics is handled by the customer. + MICROSOFT_MANAGED = "MicrosoftManaged" #: Shipment Logistics is handled by Microsoft. + +class ValidationInputDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Identifies the type of validation request. + """ + + VALIDATE_ADDRESS = "ValidateAddress" #: Identify request and response of address validation. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" #: Identify request and response for validation of subscription permission to create job. + VALIDATE_PREFERENCES = "ValidatePreferences" #: Identify request and response of preference validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" #: Identify request and response of create order limit for subscription validation. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" #: Identify request and response of active job limit for sku availability. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" #: Identify request and response of data transfer details validation. + +class ValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Create order limit validation status. + """ + + VALID = "Valid" #: Validation is successful. + INVALID = "Invalid" #: Validation is not successful. + SKIPPED = "Skipped" #: Validation is skipped. diff --git a/src/databox/azext_databox/vendored_sdks/databox/models/_models.py b/src/databox/azext_databox/vendored_sdks/databox/models/_models.py index 34a4d7aa419..c341be4b47a 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/models/_models.py +++ b/src/databox/azext_databox/vendored_sdks/databox/models/_models.py @@ -1,76 +1,98 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from azure.core.exceptions import HttpResponseError +import msrest.serialization -class AccountCredentialDetails(Model): +class AccountCredentialDetails(msrest.serialization.Model): """Credential details of the account. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar account_name: Name of the account. :vartype account_name: str - :ivar data_destination_type: Data Destination Type. Possible values - include: 'StorageAccount', 'ManagedDisk' - :vartype data_destination_type: str or - ~azure.mgmt.databox.models.DataDestinationType - :ivar account_connection_string: Connection string of the account endpoint - to use the account as a storage endpoint on the device. + :ivar data_account_type: Type of the account. Possible values include: "StorageAccount", + "ManagedDisk". + :vartype data_account_type: str or ~data_box_management_client.models.DataAccountType + :ivar account_connection_string: Connection string of the account endpoint to use the account + as a storage endpoint on the device. :vartype account_connection_string: str - :ivar share_credential_details: Per share level unencrypted access - credentials. + :ivar share_credential_details: Per share level unencrypted access credentials. :vartype share_credential_details: - list[~azure.mgmt.databox.models.ShareCredentialDetails] + list[~data_box_management_client.models.ShareCredentialDetails] """ _validation = { 'account_name': {'readonly': True}, - 'data_destination_type': {'readonly': True}, + 'data_account_type': {'readonly': True}, 'account_connection_string': {'readonly': True}, 'share_credential_details': {'readonly': True}, } _attribute_map = { 'account_name': {'key': 'accountName', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'DataDestinationType'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, 'account_connection_string': {'key': 'accountConnectionString', 'type': 'str'}, 'share_credential_details': {'key': 'shareCredentialDetails', 'type': '[ShareCredentialDetails]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AccountCredentialDetails, self).__init__(**kwargs) self.account_name = None - self.data_destination_type = None + self.data_account_type = None self.account_connection_string = None self.share_credential_details = None -class AddressValidationOutput(Model): +class AdditionalErrorInfo(msrest.serialization.Model): + """Additional error info. + + :param type: Additional error type. + :type type: str + :param info: Additional error info. + :type info: object + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(AdditionalErrorInfo, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.info = kwargs.get('info', None) + + +class AddressValidationOutput(msrest.serialization.Model): """Output of the address validation api. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. + :param validation_type: Identifies the type of validation response.Constant filled by server. + Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar validation_status: The address validation status. Possible values - include: 'Valid', 'Invalid', 'Ambiguous' - :vartype validation_status: str or - ~azure.mgmt.databox.models.AddressValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar validation_status: The address validation status. Possible values include: "Valid", + "Invalid", "Ambiguous". + :vartype validation_status: str or ~data_box_management_client.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: - list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~data_box_management_client.models.ShippingAddress] """ _validation = { @@ -80,23 +102,139 @@ class AddressValidationOutput(Model): } _attribute_map = { - 'error': {'key': 'properties.error', 'type': 'Error'}, - 'validation_status': {'key': 'properties.validationStatus', 'type': 'AddressValidationStatus'}, + 'validation_type': {'key': 'properties.validationType', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'CloudError'}, + 'validation_status': {'key': 'properties.validationStatus', 'type': 'str'}, 'alternate_addresses': {'key': 'properties.alternateAddresses', 'type': '[ShippingAddress]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AddressValidationOutput, self).__init__(**kwargs) + self.validation_type = None # type: Optional[str] + self.error = None + self.validation_status = None + self.alternate_addresses = None + + +class ValidationInputResponse(msrest.serialization.Model): + """Minimum properties that should be present in each individual validation response. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AddressValidationProperties, CreateOrderLimitForSubscriptionValidationResponseProperties, DataTransferDetailsValidationResponseProperties, PreferencesValidationResponseProperties, SkuAvailabilityValidationResponseProperties, SubscriptionIsAllowedToCreateJobValidationResponseProperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~data_box_management_client.models.CloudError + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + } + + _subtype_map = { + 'validation_type': {'ValidateAddress': 'AddressValidationProperties', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} + } + + def __init__( + self, + **kwargs + ): + super(ValidationInputResponse, self).__init__(**kwargs) + self.validation_type = None # type: Optional[str] self.error = None + + +class AddressValidationProperties(ValidationInputResponse): + """The address validation output. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~data_box_management_client.models.CloudError + :ivar validation_status: The address validation status. Possible values include: "Valid", + "Invalid", "Ambiguous". + :vartype validation_status: str or ~data_box_management_client.models.AddressValidationStatus + :ivar alternate_addresses: List of alternate addresses. + :vartype alternate_addresses: list[~data_box_management_client.models.ShippingAddress] + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'validation_status': {'readonly': True}, + 'alternate_addresses': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'validation_status': {'key': 'validationStatus', 'type': 'str'}, + 'alternate_addresses': {'key': 'alternateAddresses', 'type': '[ShippingAddress]'}, + } + + def __init__( + self, + **kwargs + ): + super(AddressValidationProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateAddress' # type: str self.validation_status = None self.alternate_addresses = None -class ApplianceNetworkConfiguration(Model): +class ApiError(msrest.serialization.Model): + """ApiError. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. + :type error: ~data_box_management_client.models.ErrorDetail + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiError, self).__init__(**kwargs) + self.error = kwargs['error'] + + +class ApplianceNetworkConfiguration(msrest.serialization.Model): """The Network Adapter configuration of a DataBox. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the network. :vartype name: str @@ -114,17 +252,19 @@ class ApplianceNetworkConfiguration(Model): 'mac_address': {'key': 'macAddress', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ApplianceNetworkConfiguration, self).__init__(**kwargs) self.name = None self.mac_address = None -class ArmBaseObject(Model): +class ArmBaseObject(msrest.serialization.Model): """Base class for all objects under resource. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the object. :vartype name: str @@ -146,38 +286,36 @@ class ArmBaseObject(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ArmBaseObject, self).__init__(**kwargs) self.name = None self.id = None self.type = None -class AvailableSkuRequest(Model): +class AvailableSkuRequest(msrest.serialization.Model): """The filters for showing the available skus. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. - :ivar transfer_type: Required. Type of the transfer. Default value: - "ImportToAzure" . - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. - For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType + :param country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. :type country: str - :param location: Required. Location for data transfer. For locations - check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type location: str - :param sku_names: Sku Names to filter for available skus - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + :param sku_names: Sku Names to filter for available skus. + :type sku_names: list[str or ~data_box_management_client.models.SkuName] """ _validation = { - 'transfer_type': {'required': True, 'constant': True}, + 'transfer_type': {'required': True}, 'country': {'required': True}, 'location': {'required': True}, } @@ -186,19 +324,104 @@ class AvailableSkuRequest(Model): 'transfer_type': {'key': 'transferType', 'type': 'str'}, 'country': {'key': 'country', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, - 'sku_names': {'key': 'skuNames', 'type': '[SkuName]'}, + 'sku_names': {'key': 'skuNames', 'type': '[str]'}, } - transfer_type = "ImportToAzure" - - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AvailableSkuRequest, self).__init__(**kwargs) - self.country = kwargs.get('country', None) - self.location = kwargs.get('location', None) + self.transfer_type = kwargs['transfer_type'] + self.country = kwargs['country'] + self.location = kwargs['location'] self.sku_names = kwargs.get('sku_names', None) -class CancellationReason(Model): +class AvailableSkusResult(msrest.serialization.Model): + """The available skus operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of available skus. + :vartype value: list[~data_box_management_client.models.SkuInformation] + :param next_link: Link for the next set of skus. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInformation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableSkusResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class AzureFileFilterDetails(msrest.serialization.Model): + """Filter details to transfer Azure files. + + :param file_prefix_list: Prefix list of the Azure files to be transferred. + :type file_prefix_list: list[str] + :param file_path_list: List of full path of the files to be transferred. + :type file_path_list: list[str] + :param file_share_list: List of file shares to be transferred. + :type file_share_list: list[str] + """ + + _attribute_map = { + 'file_prefix_list': {'key': 'filePrefixList', 'type': '[str]'}, + 'file_path_list': {'key': 'filePathList', 'type': '[str]'}, + 'file_share_list': {'key': 'fileShareList', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFileFilterDetails, self).__init__(**kwargs) + self.file_prefix_list = kwargs.get('file_prefix_list', None) + self.file_path_list = kwargs.get('file_path_list', None) + self.file_share_list = kwargs.get('file_share_list', None) + + +class BlobFilterDetails(msrest.serialization.Model): + """Filter details to transfer Azure Blobs. + + :param blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :type blob_prefix_list: list[str] + :param blob_path_list: List of full path of the blobs to be transferred. + :type blob_path_list: list[str] + :param container_list: List of blob containers to be transferred. + :type container_list: list[str] + """ + + _attribute_map = { + 'blob_prefix_list': {'key': 'blobPrefixList', 'type': '[str]'}, + 'blob_path_list': {'key': 'blobPathList', 'type': '[str]'}, + 'container_list': {'key': 'containerList', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobFilterDetails, self).__init__(**kwargs) + self.blob_prefix_list = kwargs.get('blob_prefix_list', None) + self.blob_path_list = kwargs.get('blob_path_list', None) + self.container_list = kwargs.get('container_list', None) + + +class CancellationReason(msrest.serialization.Model): """Reason for cancellation. All required parameters must be populated in order to send to Azure. @@ -215,30 +438,34 @@ class CancellationReason(Model): 'reason': {'key': 'reason', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CancellationReason, self).__init__(**kwargs) - self.reason = kwargs.get('reason', None) + self.reason = kwargs['reason'] -class CloudError(Model): - """The error information object. +class CloudError(msrest.serialization.Model): + """Cloud error. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: Error code string. - :vartype code: str - :ivar message: Descriptive error information. - :vartype message: str - :param target: Error target + :param code: Cloud error code. + :type code: str + :param message: Cloud error message. + :type message: str + :param target: Cloud error target. :type target: str - :param details: More detailed error information. - :type details: list[~azure.mgmt.databox.models.CloudError] + :ivar details: Cloud error details. + :vartype details: list[~data_box_management_client.models.CloudError] + :ivar additional_info: Cloud error additional info. + :vartype additional_info: list[~data_box_management_client.models.AdditionalErrorInfo] """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { @@ -246,29 +473,22 @@ class CloudError(Model): 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, 'details': {'key': 'details', 'type': '[CloudError]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[AdditionalErrorInfo]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudError, self).__init__(**kwargs) - self.code = None - self.message = None + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + self.details = None + self.additional_info = None -class ContactDetails(Model): +class ContactDetails(msrest.serialization.Model): """Contact Details. All required parameters must be populated in order to send to Azure. @@ -281,12 +501,10 @@ class ContactDetails(Model): :type phone_extension: str :param mobile: Mobile number of the contact person. :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job - progress. + :param email_list: Required. List of Email-ids to be notified about job progress. :type email_list: list[str] :param notification_preference: Notification preference for a job stage. - :type notification_preference: - list[~azure.mgmt.databox.models.NotificationPreference] + :type notification_preference: list[~data_box_management_client.models.NotificationPreference] """ _validation = { @@ -304,27 +522,30 @@ class ContactDetails(Model): 'notification_preference': {'key': 'notificationPreference', 'type': '[NotificationPreference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContactDetails, self).__init__(**kwargs) - self.contact_name = kwargs.get('contact_name', None) - self.phone = kwargs.get('phone', None) + self.contact_name = kwargs['contact_name'] + self.phone = kwargs['phone'] self.phone_extension = kwargs.get('phone_extension', None) self.mobile = kwargs.get('mobile', None) - self.email_list = kwargs.get('email_list', None) + self.email_list = kwargs['email_list'] self.notification_preference = kwargs.get('notification_preference', None) -class CopyLogDetails(Model): +class CopyLogDetails(msrest.serialization.Model): """Details for log generated during copy. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, - DataBoxHeavyAccountCopyLogDetails + sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator """ _validation = { @@ -339,54 +560,64 @@ class CopyLogDetails(Model): 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = None + self.copy_log_details_type = None # type: Optional[str] -class CopyProgress(Model): +class CopyProgress(msrest.serialization.Model): """Copy progress. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar storage_account_name: Name of the storage account where the data - needs to be uploaded. + :ivar storage_account_name: Name of the storage account. This will be empty for data account + types other than storage account. :vartype storage_account_name: str - :ivar data_destination_type: Data Destination Type. Possible values - include: 'StorageAccount', 'ManagedDisk' - :vartype data_destination_type: str or - ~azure.mgmt.databox.models.DataDestinationType + :ivar transfer_type: Transfer type of data. Possible values include: "ImportToAzure", + "ExportFromAzure". + :vartype transfer_type: str or ~data_box_management_client.models.TransferType + :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", + "ManagedDisk". + :vartype data_account_type: str or ~data_box_management_client.models.DataAccountType :ivar account_id: Id of the account where the data needs to be uploaded. :vartype account_id: str - :ivar bytes_sent_to_cloud: Amount of data uploaded by the job as of now. - :vartype bytes_sent_to_cloud: long - :ivar total_bytes_to_process: Total amount of data to be processed by the - job. + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: long + :ivar total_bytes_to_process: Total amount of data to be processed by the job. :vartype total_bytes_to_process: long - :ivar files_processed: Number of files processed by the job as of now. + :ivar files_processed: Number of files processed. :vartype files_processed: long - :ivar total_files_to_process: Total number of files to be processed by the - job. + :ivar total_files_to_process: Total files to process. :vartype total_files_to_process: long - :ivar invalid_files_processed: Number of files not adhering to azure - naming conventions which were processed by automatic renaming + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. :vartype invalid_files_processed: long - :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to - azure naming conventions which were processed by automatic renaming + :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to azure naming + conventions which were processed by automatic renaming. :vartype invalid_file_bytes_uploaded: long - :ivar renamed_container_count: Number of folders not adhering to azure - naming conventions which were processed by automatic renaming + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. :vartype renamed_container_count: long - :ivar files_errored_out: Number of files which could not be copied + :ivar files_errored_out: Number of files which could not be copied. :vartype files_errored_out: long + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: long + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: long + :ivar is_enumeration_in_progress: To indicate if enumeration of data is in progress. + Until this is true, the TotalBytesToProcess may not be valid. + :vartype is_enumeration_in_progress: bool """ _validation = { 'storage_account_name': {'readonly': True}, - 'data_destination_type': {'readonly': True}, + 'transfer_type': {'readonly': True}, + 'data_account_type': {'readonly': True}, 'account_id': {'readonly': True}, - 'bytes_sent_to_cloud': {'readonly': True}, + 'bytes_processed': {'readonly': True}, 'total_bytes_to_process': {'readonly': True}, 'files_processed': {'readonly': True}, 'total_files_to_process': {'readonly': True}, @@ -394,13 +625,17 @@ class CopyProgress(Model): 'invalid_file_bytes_uploaded': {'readonly': True}, 'renamed_container_count': {'readonly': True}, 'files_errored_out': {'readonly': True}, + 'directories_errored_out': {'readonly': True}, + 'invalid_directories_processed': {'readonly': True}, + 'is_enumeration_in_progress': {'readonly': True}, } _attribute_map = { 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'DataDestinationType'}, + 'transfer_type': {'key': 'transferType', 'type': 'str'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, 'account_id': {'key': 'accountId', 'type': 'str'}, - 'bytes_sent_to_cloud': {'key': 'bytesSentToCloud', 'type': 'long'}, + 'bytes_processed': {'key': 'bytesProcessed', 'type': 'long'}, 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, @@ -408,14 +643,21 @@ class CopyProgress(Model): 'invalid_file_bytes_uploaded': {'key': 'invalidFileBytesUploaded', 'type': 'long'}, 'renamed_container_count': {'key': 'renamedContainerCount', 'type': 'long'}, 'files_errored_out': {'key': 'filesErroredOut', 'type': 'long'}, + 'directories_errored_out': {'key': 'directoriesErroredOut', 'type': 'long'}, + 'invalid_directories_processed': {'key': 'invalidDirectoriesProcessed', 'type': 'long'}, + 'is_enumeration_in_progress': {'key': 'isEnumerationInProgress', 'type': 'bool'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CopyProgress, self).__init__(**kwargs) self.storage_account_name = None - self.data_destination_type = None + self.transfer_type = None + self.data_account_type = None self.account_id = None - self.bytes_sent_to_cloud = None + self.bytes_processed = None self.total_bytes_to_process = None self.files_processed = None self.total_files_to_process = None @@ -423,42 +665,49 @@ def __init__(self, **kwargs): self.invalid_file_bytes_uploaded = None self.renamed_container_count = None self.files_errored_out = None + self.directories_errored_out = None + self.invalid_directories_processed = None + self.is_enumeration_in_progress = None -class ValidationRequest(Model): - """Input request for all pre job creation validation. +class ValidationRequest(msrest.serialization.Model): + """Minimum request requirement of any validation category. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CreateJobValidations + sub-classes are: CreateJobValidations. All required parameters must be populated in order to send to Azure. - :param individual_request_details: Required. List of request details - contain validationType and its request as key and value respectively. - :type individual_request_details: - list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Constant filled by server. + :param validation_category: Required. Identify the nature of validation.Constant filled by + server. :type validation_category: str + :param individual_request_details: Required. List of request details contain validationType and + its request as key and value respectively. + :type individual_request_details: + list[~data_box_management_client.models.ValidationInputRequest] """ _validation = { - 'individual_request_details': {'required': True}, 'validation_category': {'required': True}, + 'individual_request_details': {'required': True}, } _attribute_map = { - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, 'validation_category': {'key': 'validationCategory', 'type': 'str'}, + 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, } _subtype_map = { 'validation_category': {'JobCreationValidation': 'CreateJobValidations'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ValidationRequest, self).__init__(**kwargs) - self.individual_request_details = kwargs.get('individual_request_details', None) - self.validation_category = None + self.validation_category = None # type: Optional[str] + self.individual_request_details = kwargs['individual_request_details'] class CreateJobValidations(ValidationRequest): @@ -466,42 +715,46 @@ class CreateJobValidations(ValidationRequest): All required parameters must be populated in order to send to Azure. - :param individual_request_details: Required. List of request details - contain validationType and its request as key and value respectively. - :type individual_request_details: - list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Constant filled by server. + :param validation_category: Required. Identify the nature of validation.Constant filled by + server. :type validation_category: str + :param individual_request_details: Required. List of request details contain validationType and + its request as key and value respectively. + :type individual_request_details: + list[~data_box_management_client.models.ValidationInputRequest] """ _validation = { - 'individual_request_details': {'required': True}, 'validation_category': {'required': True}, + 'individual_request_details': {'required': True}, } _attribute_map = { - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, 'validation_category': {'key': 'validationCategory', 'type': 'str'}, + 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CreateJobValidations, self).__init__(**kwargs) - self.validation_category = 'JobCreationValidation' + self.validation_category = 'JobCreationValidation' # type: str -class ValidationInputRequest(Model): +class ValidationInputRequest(msrest.serialization.Model): """Minimum fields that must be present in any type of validation request. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CreateOrderLimitForSubscriptionValidationRequest, - DataDestinationDetailsValidationRequest, PreferencesValidationRequest, - SkuAvailabilityValidationRequest, - SubscriptionIsAllowedToCreateJobValidationRequest, ValidateAddress + sub-classes are: ValidateAddress, CreateOrderLimitForSubscriptionValidationRequest, DataTransferDetailsValidationRequest, PreferencesValidationRequest, SkuAvailabilityValidationRequest, SubscriptionIsAllowedToCreateJobValidationRequest. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator """ _validation = { @@ -513,12 +766,15 @@ class ValidationInputRequest(Model): } _subtype_map = { - 'validation_type': {'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationRequest', 'ValidateDataDestinationDetails': 'DataDestinationDetailsValidationRequest', 'ValidatePreferences': 'PreferencesValidationRequest', 'ValidateSkuAvailability': 'SkuAvailabilityValidationRequest', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationRequest', 'ValidateAddress': 'ValidateAddress'} + 'validation_type': {'ValidateAddress': 'ValidateAddress', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationRequest', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationRequest', 'ValidatePreferences': 'PreferencesValidationRequest', 'ValidateSkuAvailability': 'SkuAvailabilityValidationRequest', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationRequest'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ValidationInputRequest, self).__init__(**kwargs) - self.validation_type = None + self.validation_type = None # type: Optional[str] class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): @@ -526,11 +782,14 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName """ _validation = { @@ -540,138 +799,154 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) - self.device_type = kwargs.get('device_type', None) - self.validation_type = 'ValidateCreateOrderLimit' - + self.validation_type = 'ValidateCreateOrderLimit' # type: str + self.device_type = kwargs['device_type'] -class ValidationInputResponse(Model): - """Minimum properties that should be present in each individual validation - response. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: - CreateOrderLimitForSubscriptionValidationResponseProperties, - DataDestinationDetailsValidationResponseProperties, - PreferencesValidationResponseProperties, - SkuAvailabilityValidationResponseProperties, - SubscriptionIsAllowedToCreateJobValidationResponseProperties +class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): + """Properties of create order limit for subscription validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Create order limit validation status. Possible values include: "Valid", + "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - _subtype_map = { - 'validation_type': {'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataDestinationDetails': 'DataDestinationDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} - } - - def __init__(self, **kwargs): - super(ValidationInputResponse, self).__init__(**kwargs) - self.error = None - self.validation_type = None + def __init__( + self, + **kwargs + ): + super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateCreateOrderLimit' # type: str + self.status = None -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. +class DataAccountDetails(msrest.serialization.Model): + """Account details of the data to be transferred. - Variables are only populated by the server, and will be ignored when - sending a request. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ManagedDiskDetails, StorageAccountDetails. All required parameters must be populated in order to send to Azure. - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Create order limit validation status. Possible values - include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :param data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :type share_password: str """ _validation = { - 'error': {'readonly': True}, - 'validation_type': {'required': True}, - 'status': {'readonly': True}, + 'data_account_type': {'required': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, } - def __init__(self, **kwargs): - super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) - self.status = None - self.validation_type = 'ValidateCreateOrderLimit' + _subtype_map = { + 'data_account_type': {'ManagedDisk': 'ManagedDiskDetails', 'StorageAccount': 'StorageAccountDetails'} + } + + def __init__( + self, + **kwargs + ): + super(DataAccountDetails, self).__init__(**kwargs) + self.data_account_type = None # type: Optional[str] + self.share_password = kwargs.get('share_password', None) class DataBoxAccountCopyLogDetails(CopyLogDetails): """Copy log details for a storage account of a DataBox job. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str - :ivar account_name: Destination account name. + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. :vartype copy_log_link: str + :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when + LogCollectionLevel is set to Verbose. + :vartype copy_verbose_log_link: str """ _validation = { 'copy_log_details_type': {'required': True}, 'account_name': {'readonly': True}, 'copy_log_link': {'readonly': True}, + 'copy_verbose_log_link': {'readonly': True}, } _attribute_map = { 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, 'account_name': {'key': 'accountName', 'type': 'str'}, 'copy_log_link': {'key': 'copyLogLink', 'type': 'str'}, + 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBox' # type: str self.account_name = None self.copy_log_link = None - self.copy_log_details_type = 'DataBox' + self.copy_verbose_log_link = None class DataBoxDiskCopyLogDetails(CopyLogDetails): """Copy Log Details for a disk. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator :ivar disk_serial_number: Disk Serial Number. :vartype disk_serial_number: str :ivar error_log_link: Link for copy error logs. @@ -694,32 +969,32 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): 'verbose_log_link': {'key': 'verboseLogLink', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBoxDisk' # type: str self.disk_serial_number = None self.error_log_link = None self.verbose_log_link = None - self.copy_log_details_type = 'DataBoxDisk' -class DataBoxDiskCopyProgress(Model): +class DataBoxDiskCopyProgress(msrest.serialization.Model): """DataBox Disk Copy Progress. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar serial_number: The serial number of the disk + :ivar serial_number: The serial number of the disk. :vartype serial_number: str :ivar bytes_copied: Bytes copied during the copy of disk. :vartype bytes_copied: long - :ivar percent_complete: Indicates the percentage completed for the copy of - the disk. + :ivar percent_complete: Indicates the percentage completed for the copy of the disk. :vartype percent_complete: int - :ivar status: The Status of the copy. Possible values include: - 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', - 'NotReturned', 'HardwareError', 'DeviceFormatted', - 'DeviceMetadataModified', 'StorageAccountNotAccessible', 'UnsupportedData' - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", + "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", + "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". + :vartype status: str or ~data_box_management_client.models.CopyStatus """ _validation = { @@ -733,10 +1008,13 @@ class DataBoxDiskCopyProgress(Model): 'serial_number': {'key': 'serialNumber', 'type': 'str'}, 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'CopyStatus'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxDiskCopyProgress, self).__init__(**kwargs) self.serial_number = None self.bytes_copied = None @@ -744,153 +1022,146 @@ def __init__(self, **kwargs): self.status = None -class JobDetails(Model): +class JobDetails(msrest.serialization.Model): """Job details. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxDiskJobDetails, DataBoxHeavyJobDetails, - DataBoxJobDetails + sub-classes are: DataBoxJobDetails, DataBoxDiskJobDetails, DataBoxHeavyJobDetails. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str + :param key_encryption_key: Details about which key encryption type is being used. + :type key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int """ _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, } _subtype_map = { - 'job_details_type': {'DataBoxDisk': 'DataBoxDiskJobDetails', 'DataBoxHeavy': 'DataBoxHeavyJobDetails', 'DataBox': 'DataBoxJobDetails'} + 'job_details_type': {'DataBox': 'DataBoxJobDetails', 'DataBoxDisk': 'DataBoxDiskJobDetails', 'DataBoxHeavy': 'DataBoxHeavyJobDetails'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(JobDetails, self).__init__(**kwargs) - self.expected_data_size_in_terabytes = kwargs.get('expected_data_size_in_terabytes', None) self.job_stages = None - self.contact_details = kwargs.get('contact_details', None) + self.contact_details = kwargs['contact_details'] self.shipping_address = kwargs.get('shipping_address', None) self.delivery_package = None self.return_package = None - self.destination_account_details = kwargs.get('destination_account_details', None) - self.error_details = None + self.data_import_details = kwargs.get('data_import_details', None) + self.data_export_details = kwargs.get('data_export_details', None) + self.job_details_type = None # type: Optional[str] self.preferences = kwargs.get('preferences', None) self.copy_log_details = None self.reverse_shipment_label_sas_key = None self.chain_of_custody_sas_key = None - self.job_details_type = None + self.key_encryption_key = kwargs.get('key_encryption_key', None) + self.expected_data_size_in_terabytes = kwargs.get('expected_data_size_in_terabytes', None) class DataBoxDiskJobDetails(JobDetails): """DataBox Disk Job Details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str - :param preferred_disks: User preference on what size disks are needed for - the job. The map is from the disk size in TB to the count. Eg. {2,5} means - 5 disks of 2 TB size. Key is string but will be checked against an int. + :param key_encryption_key: Details about which key encryption type is being used. + :type key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int + :param preferred_disks: User preference on what size disks are needed for the job. The map is + from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but + will be checked against an int. :type preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: - list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to - the disk size being used for the job. Is returned only after the disks are - shipped to the customer. + :vartype copy_progress: list[~data_box_management_client.models.DataBoxDiskCopyProgress] + :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being + used for the job. Is returned only after the disks are shipped to the customer. :vartype disks_and_size_details: dict[str, int] :param passkey: User entered passkey for DataBox Disk job. :type passkey: str @@ -899,100 +1170,110 @@ class DataBoxDiskJobDetails(JobDetails): _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, 'copy_progress': {'readonly': True}, 'disks_and_size_details': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, 'passkey': {'key': 'passkey', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxDiskJobDetails, self).__init__(**kwargs) + self.job_details_type = 'DataBoxDisk' # type: str self.preferred_disks = kwargs.get('preferred_disks', None) self.copy_progress = None self.disks_and_size_details = None self.passkey = kwargs.get('passkey', None) - self.job_details_type = 'DataBoxDisk' -class JobSecrets(Model): +class JobSecrets(msrest.serialization.Model): """The base class for the secrets. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets, - DataboxJobSecrets + sub-classes are: DataboxJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError """ _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, } _subtype_map = { - 'job_secrets_type': {'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets', 'DataBox': 'DataboxJobSecrets'} + 'job_secrets_type': {'DataBox': 'DataboxJobSecrets', 'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(JobSecrets, self).__init__(**kwargs) - self.dc_access_security_code = kwargs.get('dc_access_security_code', None) - self.job_secrets_type = None + self.job_secrets_type = None # type: Optional[str] + self.dc_access_security_code = None + self.error = None class DataBoxDiskJobSecrets(JobSecrets): """The secrets related to disk job. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] + :vartype disk_secrets: list[~data_box_management_client.models.DiskSecret] :ivar pass_key: PassKey for the disk Job. :vartype pass_key: str :ivar is_passkey_user_defined: Whether passkey was provided by user. @@ -1001,190 +1282,211 @@ class DataBoxDiskJobSecrets(JobSecrets): _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, 'disk_secrets': {'readonly': True}, 'pass_key': {'readonly': True}, 'is_passkey_user_defined': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, 'disk_secrets': {'key': 'diskSecrets', 'type': '[DiskSecret]'}, 'pass_key': {'key': 'passKey', 'type': 'str'}, 'is_passkey_user_defined': {'key': 'isPasskeyUserDefined', 'type': 'bool'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxDiskJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBoxDisk' # type: str self.disk_secrets = None self.pass_key = None self.is_passkey_user_defined = None - self.job_secrets_type = 'DataBoxDisk' class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): """Copy log details for a storage account for Databox heavy. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str - :ivar account_name: Destination account name. + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. :vartype copy_log_link: list[str] + :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when the + LogCollectionLevel is set to verbose. + :vartype copy_verbose_log_link: list[str] """ _validation = { 'copy_log_details_type': {'required': True}, 'account_name': {'readonly': True}, 'copy_log_link': {'readonly': True}, + 'copy_verbose_log_link': {'readonly': True}, } _attribute_map = { 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, 'account_name': {'key': 'accountName', 'type': 'str'}, 'copy_log_link': {'key': 'copyLogLink', 'type': '[str]'}, + 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBoxHeavy' # type: str self.account_name = None self.copy_log_link = None - self.copy_log_details_type = 'DataBoxHeavy' + self.copy_verbose_log_link = None class DataBoxHeavyJobDetails(JobDetails): """Databox Heavy Device Job Details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str + :param key_encryption_key: Details about which key encryption type is being used. + :type key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy + :vartype copy_progress: list[~data_box_management_client.models.CopyProgress] + :param device_password: Set Device password for unlocking Databox Heavy. Should not be passed + for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. :type device_password: str """ _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, 'copy_progress': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxHeavyJobDetails, self).__init__(**kwargs) + self.job_details_type = 'DataBoxHeavy' # type: str self.copy_progress = None self.device_password = kwargs.get('device_password', None) - self.job_details_type = 'DataBoxHeavy' class DataBoxHeavyJobSecrets(JobSecrets): """The secrets related to a databox heavy job. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str - :ivar cabinet_pod_secrets: Contains the list of secret objects for a - databox heavy job. - :vartype cabinet_pod_secrets: - list[~azure.mgmt.databox.models.DataBoxHeavySecret] + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError + :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. + :vartype cabinet_pod_secrets: list[~data_box_management_client.models.DataBoxHeavySecret] """ _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, 'cabinet_pod_secrets': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, 'cabinet_pod_secrets': {'key': 'cabinetPodSecrets', 'type': '[DataBoxHeavySecret]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBoxHeavy' # type: str self.cabinet_pod_secrets = None - self.job_secrets_type = 'DataBoxHeavy' -class DataBoxHeavySecret(Model): +class DataBoxHeavySecret(msrest.serialization.Model): """The secrets related to a databox heavy. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar device_serial_number: Serial number of the assigned device. :vartype device_serial_number: str @@ -1192,13 +1494,13 @@ class DataBoxHeavySecret(Model): :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. :vartype network_configurations: - list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to - authenticate with the device + list[~data_box_management_client.models.ApplianceNetworkConfiguration] + :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the + device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. :vartype account_credential_details: - list[~azure.mgmt.databox.models.AccountCredentialDetails] + list[~data_box_management_client.models.AccountCredentialDetails] """ _validation = { @@ -1217,7 +1519,10 @@ class DataBoxHeavySecret(Model): 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxHeavySecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1229,135 +1534,148 @@ def __init__(self, **kwargs): class DataBoxJobDetails(JobDetails): """Databox Job Details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str + :param key_encryption_key: Details about which key encryption type is being used. + :type key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox + :vartype copy_progress: list[~data_box_management_client.models.CopyProgress] + :param device_password: Set Device password for unlocking Databox. Should not be passed for + TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password + itself. This will not be returned in Get Call. Password Requirements : Password must be + minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, + one number and one special character. Password cannot have the following characters : IilLoO0 + Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. :type device_password: str """ _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, 'copy_progress': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxJobDetails, self).__init__(**kwargs) + self.job_details_type = 'DataBox' # type: str self.copy_progress = None self.device_password = kwargs.get('device_password', None) - self.job_details_type = 'DataBox' class DataboxJobSecrets(JobSecrets): """The secrets related to a databox job. + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :type pod_secrets: list[~data_box_management_client.models.DataBoxSecret] """ _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, 'pod_secrets': {'key': 'podSecrets', 'type': '[DataBoxSecret]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataboxJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBox' # type: str self.pod_secrets = kwargs.get('pod_secrets', None) - self.job_secrets_type = 'DataBox' -class ScheduleAvailabilityRequest(Model): +class ScheduleAvailabilityRequest(msrest.serialization.Model): """Request body to get the availability for scheduling orders. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxScheduleAvailabilityRequest, - DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest + sub-classes are: DataBoxScheduleAvailabilityRequest, DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest. All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str """ _validation = { @@ -1368,16 +1686,21 @@ class ScheduleAvailabilityRequest(Model): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, } _subtype_map = { 'sku_name': {'DataBox': 'DataBoxScheduleAvailabilityRequest', 'DataBoxDisk': 'DiskScheduleAvailabilityRequest', 'DataBoxHeavy': 'HeavyScheduleAvailabilityRequest'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ScheduleAvailabilityRequest, self).__init__(**kwargs) - self.storage_location = kwargs.get('storage_location', None) - self.sku_name = None + self.storage_location = kwargs['storage_location'] + self.sku_name = None # type: Optional[str] + self.country = kwargs.get('country', None) class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -1385,12 +1708,14 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str """ _validation = { @@ -1401,18 +1726,21 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBox' + self.sku_name = 'DataBox' # type: str -class DataBoxSecret(Model): +class DataBoxSecret(msrest.serialization.Model): """The secrets related to a DataBox. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar device_serial_number: Serial number of the assigned device. :vartype device_serial_number: str @@ -1420,13 +1748,13 @@ class DataBoxSecret(Model): :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. :vartype network_configurations: - list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to - authenticate with the device + list[~data_box_management_client.models.ApplianceNetworkConfiguration] + :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the + device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. :vartype account_credential_details: - list[~azure.mgmt.databox.models.AccountCredentialDetails] + list[~data_box_management_client.models.AccountCredentialDetails] """ _validation = { @@ -1445,7 +1773,10 @@ class DataBoxSecret(Model): 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxSecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1454,235 +1785,235 @@ def __init__(self, **kwargs): self.account_credential_details = None -class DataDestinationDetailsValidationRequest(ValidationInputRequest): - """Request to validate data destination details. +class DataExportDetails(msrest.serialization.Model): + """Details of the data to be used for exporting data from azure. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param destination_account_details: Required. Destination account details - list. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :param location: Required. Location of stamp or geo. - :type location: str + :param transfer_configuration: Required. Configuration for the data transfer. + :type transfer_configuration: ~data_box_management_client.models.TransferConfiguration + :param log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". + :type log_collection_level: str or ~data_box_management_client.models.LogCollectionLevel + :param account_details: Required. Account details of the data to be transferred. + :type account_details: ~data_box_management_client.models.DataAccountDetails """ _validation = { - 'validation_type': {'required': True}, - 'destination_account_details': {'required': True}, - 'location': {'required': True}, + 'transfer_configuration': {'required': True}, + 'account_details': {'required': True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, + 'transfer_configuration': {'key': 'transferConfiguration', 'type': 'TransferConfiguration'}, + 'log_collection_level': {'key': 'logCollectionLevel', 'type': 'str'}, + 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, } - def __init__(self, **kwargs): - super(DataDestinationDetailsValidationRequest, self).__init__(**kwargs) - self.destination_account_details = kwargs.get('destination_account_details', None) - self.location = kwargs.get('location', None) - self.validation_type = 'ValidateDataDestinationDetails' - + def __init__( + self, + **kwargs + ): + super(DataExportDetails, self).__init__(**kwargs) + self.transfer_configuration = kwargs['transfer_configuration'] + self.log_collection_level = kwargs.get('log_collection_level', None) + self.account_details = kwargs['account_details'] -class DataDestinationDetailsValidationResponseProperties(ValidationInputResponse): - """Properties of data destination details validation response. - Variables are only populated by the server, and will be ignored when - sending a request. +class DataImportDetails(msrest.serialization.Model): + """Details of the data to be used for importing data to azure. All required parameters must be populated in order to send to Azure. - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Data destination details validation status. Possible values - include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :param account_details: Required. Account details of the data to be transferred. + :type account_details: ~data_box_management_client.models.DataAccountDetails """ _validation = { - 'error': {'readonly': True}, - 'validation_type': {'required': True}, - 'status': {'readonly': True}, + 'account_details': {'required': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, } - def __init__(self, **kwargs): - super(DataDestinationDetailsValidationResponseProperties, self).__init__(**kwargs) - self.status = None - self.validation_type = 'ValidateDataDestinationDetails' + def __init__( + self, + **kwargs + ): + super(DataImportDetails, self).__init__(**kwargs) + self.account_details = kwargs['account_details'] -class DcAccessSecurityCode(Model): - """Dc Access Security code for device. +class DataLocationToServiceLocationMap(msrest.serialization.Model): + """Map of data location to service location. - :param forward_dc_access_code: Dc Access Code for dispatching from DC. - :type forward_dc_access_code: str - :param reverse_dc_access_code: Dc Access code for dropping off at DC. - :type reverse_dc_access_code: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar data_location: Location of the data. + :vartype data_location: str + :ivar service_location: Location of the service. + :vartype service_location: str """ - _attribute_map = { - 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, - 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, + _validation = { + 'data_location': {'readonly': True}, + 'service_location': {'readonly': True}, } - def __init__(self, **kwargs): - super(DcAccessSecurityCode, self).__init__(**kwargs) - self.forward_dc_access_code = kwargs.get('forward_dc_access_code', None) - self.reverse_dc_access_code = kwargs.get('reverse_dc_access_code', None) + _attribute_map = { + 'data_location': {'key': 'dataLocation', 'type': 'str'}, + 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + } + def __init__( + self, + **kwargs + ): + super(DataLocationToServiceLocationMap, self).__init__(**kwargs) + self.data_location = None + self.service_location = None -class DestinationAccountDetails(Model): - """Details of the destination storage accounts. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DestinationManagedDiskDetails, - DestinationStorageAccountDetails +class DataTransferDetailsValidationRequest(ValidationInputRequest): + """Request to validate export and import data details. All required parameters must be populated in order to send to Azure. - :param account_id: Arm Id of the destination where the data has to be - moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param data_destination_type: Required. Constant filled by server. - :type data_destination_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param data_export_details: List of DataTransfer details to be used to export data from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param data_import_details: List of DataTransfer details to be used to import data to azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName + :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType """ _validation = { - 'data_destination_type': {'required': True}, + 'validation_type': {'required': True}, + 'device_type': {'required': True}, + 'transfer_type': {'required': True}, } _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - } - - _subtype_map = { - 'data_destination_type': {'ManagedDisk': 'DestinationManagedDiskDetails', 'StorageAccount': 'DestinationStorageAccountDetails'} + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'transfer_type': {'key': 'transferType', 'type': 'str'}, } - def __init__(self, **kwargs): - super(DestinationAccountDetails, self).__init__(**kwargs) - self.account_id = kwargs.get('account_id', None) - self.share_password = kwargs.get('share_password', None) - self.data_destination_type = None + def __init__( + self, + **kwargs + ): + super(DataTransferDetailsValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidateDataTransferDetails' # type: str + self.data_export_details = kwargs.get('data_export_details', None) + self.data_import_details = kwargs.get('data_import_details', None) + self.device_type = kwargs['device_type'] + self.transfer_type = kwargs['transfer_type'] -class DestinationManagedDiskDetails(DestinationAccountDetails): - """Details for the destination compute disks. +class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): + """Properties of data transfer details validation response. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param account_id: Arm Id of the destination where the data has to be - moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param data_destination_type: Required. Constant filled by server. - :type data_destination_type: str - :param resource_group_id: Required. Destination Resource Group Id where - the Compute disks should be created. - :type resource_group_id: str - :param staging_storage_account_id: Required. Arm Id of the storage account - that can be used to copy the vhd for staging. - :type staging_storage_account_id: str + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Data transfer details validation status. Possible values include: "Valid", + "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'data_destination_type': {'required': True}, - 'resource_group_id': {'required': True}, - 'staging_storage_account_id': {'required': True}, + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, - 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs): - super(DestinationManagedDiskDetails, self).__init__(**kwargs) - self.resource_group_id = kwargs.get('resource_group_id', None) - self.staging_storage_account_id = kwargs.get('staging_storage_account_id', None) - self.data_destination_type = 'ManagedDisk' - + def __init__( + self, + **kwargs + ): + super(DataTransferDetailsValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateDataTransferDetails' # type: str + self.status = None -class DestinationStorageAccountDetails(DestinationAccountDetails): - """Details for the destination storage account. - All required parameters must be populated in order to send to Azure. +class DcAccessSecurityCode(msrest.serialization.Model): + """Dc access security code. - :param account_id: Arm Id of the destination where the data has to be - moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param data_destination_type: Required. Constant filled by server. - :type data_destination_type: str - :param storage_account_id: Required. Destination Storage Account Arm Id. - :type storage_account_id: str + :param reverse_dc_access_code: Reverse Dc access security code. + :type reverse_dc_access_code: str + :param forward_dc_access_code: Forward Dc access security code. + :type forward_dc_access_code: str """ - _validation = { - 'data_destination_type': {'required': True}, - 'storage_account_id': {'required': True}, - } - _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, + 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, } - def __init__(self, **kwargs): - super(DestinationStorageAccountDetails, self).__init__(**kwargs) - self.storage_account_id = kwargs.get('storage_account_id', None) - self.data_destination_type = 'StorageAccount' + def __init__( + self, + **kwargs + ): + super(DcAccessSecurityCode, self).__init__(**kwargs) + self.reverse_dc_access_code = kwargs.get('reverse_dc_access_code', None) + self.forward_dc_access_code = kwargs.get('forward_dc_access_code', None) -class DestinationToServiceLocationMap(Model): - """Map of destination location to service location. +class Details(msrest.serialization.Model): + """Details. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :ivar destination_location: Location of the destination. - :vartype destination_location: str - :ivar service_location: Location of the service. - :vartype service_location: str + :param code: Required. + :type code: str + :param message: Required. + :type message: str """ _validation = { - 'destination_location': {'readonly': True}, - 'service_location': {'readonly': True}, + 'code': {'required': True}, + 'message': {'required': True}, } _attribute_map = { - 'destination_location': {'key': 'destinationLocation', 'type': 'str'}, - 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, **kwargs): - super(DestinationToServiceLocationMap, self).__init__(**kwargs) - self.destination_location = None - self.service_location = None + def __init__( + self, + **kwargs + ): + super(Details, self).__init__(**kwargs) + self.code = kwargs['code'] + self.message = kwargs['message'] class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -1690,14 +2021,16 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str - :param expected_data_size_in_terabytes: Required. The expected size of the - data, which needs to be transferred in this job, in terabytes. + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str + :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to + be transferred in this job, in terabytes. :type expected_data_size_in_terabytes: int """ @@ -1710,25 +2043,28 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DiskScheduleAvailabilityRequest, self).__init__(**kwargs) - self.expected_data_size_in_terabytes = kwargs.get('expected_data_size_in_terabytes', None) - self.sku_name = 'DataBoxDisk' + self.sku_name = 'DataBoxDisk' # type: str + self.expected_data_size_in_terabytes = kwargs['expected_data_size_in_terabytes'] -class DiskSecret(Model): +class DiskSecret(msrest.serialization.Model): """Contains all the secrets of a Disk. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar disk_serial_number: Serial number of the assigned disk. :vartype disk_serial_number: str - :ivar bit_locker_key: Bit Locker key of the disk which can be used to - unlock the disk to copy data. + :ivar bit_locker_key: Bit Locker key of the disk which can be used to unlock the disk to copy + data. :vartype bit_locker_key: str """ @@ -1742,40 +2078,103 @@ class DiskSecret(Model): 'bit_locker_key': {'key': 'bitLockerKey', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DiskSecret, self).__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None -class Error(Model): - """Top level error for the job. +class EncryptionPreferences(msrest.serialization.Model): + """Preferences related to the Encryption. + + :param double_encryption: Defines secondary layer of software-based encryption enablement. + Possible values include: "Enabled", "Disabled". + :type double_encryption: str or ~data_box_management_client.models.DoubleEncryption + """ + + _attribute_map = { + 'double_encryption': {'key': 'doubleEncryption', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionPreferences, self).__init__(**kwargs) + self.double_encryption = kwargs.get('double_encryption', None) + - Variables are only populated by the server, and will be ignored when - sending a request. +class ErrorDetail(msrest.serialization.Model): + """ErrorDetail. + + All required parameters must be populated in order to send to Azure. - :ivar code: Error code that can be used to programmatically identify the - error. - :vartype code: str - :ivar message: Describes the error in detail and provides debugging - information. - :vartype message: str + :param code: Required. + :type code: str + :param message: Required. + :type message: str + :param details: + :type details: list[~data_box_management_client.models.Details] + :param target: + :type target: str """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, + 'code': {'required': True}, + 'message': {'required': True}, } _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[Details]'}, + 'target': {'key': 'target', 'type': 'str'}, } - def __init__(self, **kwargs): - super(Error, self).__init__(**kwargs) - self.code = None - self.message = None + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = kwargs['code'] + self.message = kwargs['message'] + self.details = kwargs.get('details', None) + self.target = kwargs.get('target', None) + + +class FilterFileDetails(msrest.serialization.Model): + """Details of the filter files to be used for data transfer. + + All required parameters must be populated in order to send to Azure. + + :param filter_file_type: Required. Type of the filter file. Possible values include: + "AzureBlob", "AzureFile". + :type filter_file_type: str or ~data_box_management_client.models.FilterFileType + :param filter_file_path: Required. Path of the file that contains the details of all items to + transfer. + :type filter_file_path: str + """ + + _validation = { + 'filter_file_type': {'required': True}, + 'filter_file_path': {'required': True}, + } + + _attribute_map = { + 'filter_file_type': {'key': 'filterFileType', 'type': 'str'}, + 'filter_file_path': {'key': 'filterFilePath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FilterFileDetails, self).__init__(**kwargs) + self.filter_file_type = kwargs['filter_file_type'] + self.filter_file_path = kwargs['filter_file_path'] class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -1783,12 +2182,14 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str """ _validation = { @@ -1799,84 +2200,76 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(HeavyScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBoxHeavy' + self.sku_name = 'DataBoxHeavy' # type: str -class JobDeliveryInfo(Model): - """Additional delivery info. +class IdentityProperties(msrest.serialization.Model): + """Managed identity properties. - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: datetime + :param type: Managed service identity type. + :type type: str + :param user_assigned: User assigned identity properties. + :type user_assigned: ~data_box_management_client.models.UserAssignedProperties """ _attribute_map = { - 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned': {'key': 'userAssigned', 'type': 'UserAssignedProperties'}, } - def __init__(self, **kwargs): - super(JobDeliveryInfo, self).__init__(**kwargs) - self.scheduled_date_time = kwargs.get('scheduled_date_time', None) - + def __init__( + self, + **kwargs + ): + super(IdentityProperties, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.user_assigned = kwargs.get('user_assigned', None) -class JobErrorDetails(Model): - """Job Error Details for providing the information and recommended action. - Variables are only populated by the server, and will be ignored when - sending a request. +class JobDeliveryInfo(msrest.serialization.Model): + """Additional delivery info. - :ivar error_message: Message for the error. - :vartype error_message: str - :ivar error_code: Code for the error. - :vartype error_code: int - :ivar recommended_action: Recommended action for the error. - :vartype recommended_action: str - :ivar exception_message: Contains the non localized exception message - :vartype exception_message: str + :param scheduled_date_time: Scheduled date time. + :type scheduled_date_time: ~datetime.datetime """ - _validation = { - 'error_message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'recommended_action': {'readonly': True}, - 'exception_message': {'readonly': True}, - } - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'int'}, - 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, - 'exception_message': {'key': 'exceptionMessage', 'type': 'str'}, + 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, } - def __init__(self, **kwargs): - super(JobErrorDetails, self).__init__(**kwargs) - self.error_message = None - self.error_code = None - self.recommended_action = None - self.exception_message = None + def __init__( + self, + **kwargs + ): + super(JobDeliveryInfo, self).__init__(**kwargs) + self.scheduled_date_time = kwargs.get('scheduled_date_time', None) -class Resource(Model): +class Resource(msrest.serialization.Model): """Model of the Resource. All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one - of the supported and registered Azure Regions (e.g. West US, East US, - Southeast Asia, etc.). The region of a resource cannot be changed once it - is created, but if an identical region is specified on update the request - will succeed. + :param location: Required. The location of the resource. This will be one of the supported and + registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. :type location: str - :param tags: The list of key value pairs that describe the resource. These - tags can be used in viewing and grouping this resource (across resource - groups). + :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). :type tags: dict[str, str] :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :type sku: ~data_box_management_client.models.Sku + :param identity: Msi identity of the resource. + :type identity: ~data_box_management_client.models.ResourceIdentity """ _validation = { @@ -1888,116 +2281,133 @@ class Resource(Model): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) - self.location = kwargs.get('location', None) + self.location = kwargs['location'] self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.sku = kwargs['sku'] + self.identity = kwargs.get('identity', None) class JobResource(Resource): """Job Resource. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one - of the supported and registered Azure Regions (e.g. West US, East US, - Southeast Asia, etc.). The region of a resource cannot be changed once it - is created, but if an identical region is specified on update the request - will succeed. + :param location: Required. The location of the resource. This will be one of the supported and + registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. :type location: str - :param tags: The list of key value pairs that describe the resource. These - tags can be used in viewing and grouping this resource (across resource - groups). + :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). :type tags: dict[str, str] :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :type sku: ~data_box_management_client.models.Sku + :param identity: Msi identity of the resource. + :type identity: ~data_box_management_client.models.ResourceIdentity + :ivar name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param transfer_type: Required. Type of the data transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType :ivar is_cancellable: Describes whether the job is cancellable or not. :vartype is_cancellable: bool :ivar is_deletable: Describes whether the job is deletable or not. :vartype is_deletable: bool - :ivar is_shipping_address_editable: Describes whether the shipping address - is editable or not. + :ivar is_shipping_address_editable: Describes whether the shipping address is editable or not. :vartype is_shipping_address_editable: bool - :ivar status: Name of the stage which is in progress. Possible values - include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', - 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', - 'Cancelled', 'Failed_IssueReportedAtCustomer', - 'Failed_IssueDetectedAtAzureDC', 'Aborted', 'CompletedWithWarnings', - 'ReadyToDispatchFromAzureDC', 'ReadyToReceiveAtAzureDC' - :vartype status: str or ~azure.mgmt.databox.models.StageName - :ivar start_time: Time at which the job was started in UTC ISO 8601 - format. - :vartype start_time: datetime + :ivar is_prepare_to_ship_enabled: Is Prepare To Ship Enabled on this job. + :vartype is_prepare_to_ship_enabled: bool + :ivar status: Name of the stage which is in progress. Possible values include: "DeviceOrdered", + "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". + :vartype status: str or ~data_box_management_client.models.StageName + :ivar start_time: Time at which the job was started in UTC ISO 8601 format. + :vartype start_time: ~datetime.datetime :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.Error - :param details: Details of a job run. This field will only be sent for - expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~data_box_management_client.models.CloudError + :param details: Details of a job run. This field will only be sent for expand details filter. + :type details: ~data_box_management_client.models.JobDetails :ivar cancellation_reason: Reason for cancellation. :vartype cancellation_reason: str - :param delivery_type: Delivery type of Job. Possible values include: - 'NonScheduled', 'Scheduled' - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType + :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". + :type delivery_type: str or ~data_box_management_client.models.JobDeliveryType :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of - scheduled job. + :type delivery_info: ~data_box_management_client.models.JobDeliveryInfo + :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. :vartype is_cancellable_without_fee: bool - :ivar name: Name of the object. - :vartype name: str - :ivar id: Id of the object. - :vartype id: str - :ivar type: Type of the object. - :vartype type: str """ _validation = { 'location': {'required': True}, 'sku': {'required': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'transfer_type': {'required': True}, 'is_cancellable': {'readonly': True}, 'is_deletable': {'readonly': True}, 'is_shipping_address_editable': {'readonly': True}, + 'is_prepare_to_ship_enabled': {'readonly': True}, 'status': {'readonly': True}, 'start_time': {'readonly': True}, 'error': {'readonly': True}, 'cancellation_reason': {'readonly': True}, 'is_cancellable_without_fee': {'readonly': True}, - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, } _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'transfer_type': {'key': 'properties.transferType', 'type': 'str'}, 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'bool'}, 'is_deletable': {'key': 'properties.isDeletable', 'type': 'bool'}, 'is_shipping_address_editable': {'key': 'properties.isShippingAddressEditable', 'type': 'bool'}, - 'status': {'key': 'properties.status', 'type': 'StageName'}, + 'is_prepare_to_ship_enabled': {'key': 'properties.isPrepareToShipEnabled', 'type': 'bool'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'error': {'key': 'properties.error', 'type': 'Error'}, + 'error': {'key': 'properties.error', 'type': 'CloudError'}, 'details': {'key': 'properties.details', 'type': 'JobDetails'}, 'cancellation_reason': {'key': 'properties.cancellationReason', 'type': 'str'}, - 'delivery_type': {'key': 'properties.deliveryType', 'type': 'JobDeliveryType'}, + 'delivery_type': {'key': 'properties.deliveryType', 'type': 'str'}, 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'JobDeliveryInfo'}, 'is_cancellable_without_fee': {'key': 'properties.isCancellableWithoutFee', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(JobResource, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.transfer_type = kwargs['transfer_type'] self.is_cancellable = None self.is_deletable = None self.is_shipping_address_editable = None + self.is_prepare_to_ship_enabled = None self.status = None self.start_time = None self.error = None @@ -2006,63 +2416,80 @@ def __init__(self, **kwargs): self.delivery_type = kwargs.get('delivery_type', None) self.delivery_info = kwargs.get('delivery_info', None) self.is_cancellable_without_fee = None - self.name = None - self.id = None - self.type = None -class JobResourceUpdateParameter(Model): +class JobResourceList(msrest.serialization.Model): + """Job Resource Collection. + + :param value: List of job resources. + :type value: list[~data_box_management_client.models.JobResource] + :param next_link: Link for the next set of job resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobResourceList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class JobResourceUpdateParameter(msrest.serialization.Model): """The JobResourceUpdateParameter. - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - :param destination_account_details: Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :param tags: The list of key value pairs that describe the resource. These - tags can be used in viewing and grouping this resource (across resource - groups). + :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). :type tags: dict[str, str] + :param identity: Msi identity of the resource. + :type identity: ~data_box_management_client.models.ResourceIdentity + :param details: Details of a job to be updated. + :type details: ~data_box_management_client.models.UpdateJobDetails """ _attribute_map = { - 'details': {'key': 'properties.details', 'type': 'UpdateJobDetails'}, - 'destination_account_details': {'key': 'properties.destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'details': {'key': 'properties.details', 'type': 'UpdateJobDetails'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(JobResourceUpdateParameter, self).__init__(**kwargs) - self.details = kwargs.get('details', None) - self.destination_account_details = kwargs.get('destination_account_details', None) self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.details = kwargs.get('details', None) -class JobStages(Model): +class JobStages(msrest.serialization.Model): """Job stages. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar stage_name: Name of the job stage. Possible values include: - 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', - 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', - 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', - 'Aborted', 'CompletedWithWarnings', 'ReadyToDispatchFromAzureDC', - 'ReadyToReceiveAtAzureDC' - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + :ivar stage_name: Name of the job stage. Possible values include: "DeviceOrdered", + "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". + :vartype stage_name: str or ~data_box_management_client.models.StageName :ivar display_name: Display name of the job stage. :vartype display_name: str - :ivar stage_status: Status of the job stage. Possible values include: - 'None', 'InProgress', 'Succeeded', 'Failed', 'Cancelled', 'Cancelling', - 'SucceededWithErrors' - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", + "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", + "WaitingForCustomerAction", "SucceededWithWarnings". + :vartype stage_status: str or ~data_box_management_client.models.StageStatus :ivar stage_time: Time for the job stage in UTC ISO 8601 format. - :vartype stage_time: datetime - :ivar job_stage_details: Job Stage Details + :vartype stage_time: ~datetime.datetime + :ivar job_stage_details: Job Stage Details. :vartype job_stage_details: object - :ivar error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] """ _validation = { @@ -2071,37 +2498,120 @@ class JobStages(Model): 'stage_status': {'readonly': True}, 'stage_time': {'readonly': True}, 'job_stage_details': {'readonly': True}, - 'error_details': {'readonly': True}, } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'StageName'}, + 'stage_name': {'key': 'stageName', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, - 'stage_status': {'key': 'stageStatus', 'type': 'StageStatus'}, + 'stage_status': {'key': 'stageStatus', 'type': 'str'}, 'stage_time': {'key': 'stageTime', 'type': 'iso-8601'}, 'job_stage_details': {'key': 'jobStageDetails', 'type': 'object'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(JobStages, self).__init__(**kwargs) self.stage_name = None self.display_name = None self.stage_status = None self.stage_time = None self.job_stage_details = None - self.error_details = None -class NotificationPreference(Model): +class KeyEncryptionKey(msrest.serialization.Model): + """Encryption key containing details about key to encrypt different keys. + + All required parameters must be populated in order to send to Azure. + + :param kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". + :type kek_type: str or ~data_box_management_client.models.KekType + :param identity_properties: Managed identity properties used for key encryption. + :type identity_properties: ~data_box_management_client.models.IdentityProperties + :param kek_url: Key encryption key. It is required in case of Customer managed KekType. + :type kek_url: str + :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + KekType. + :type kek_vault_resource_id: str + """ + + _validation = { + 'kek_type': {'required': True}, + } + + _attribute_map = { + 'kek_type': {'key': 'kekType', 'type': 'str'}, + 'identity_properties': {'key': 'identityProperties', 'type': 'IdentityProperties'}, + 'kek_url': {'key': 'kekUrl', 'type': 'str'}, + 'kek_vault_resource_id': {'key': 'kekVaultResourceID', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyEncryptionKey, self).__init__(**kwargs) + self.kek_type = kwargs['kek_type'] + self.identity_properties = kwargs.get('identity_properties', None) + self.kek_url = kwargs.get('kek_url', None) + self.kek_vault_resource_id = kwargs.get('kek_vault_resource_id', None) + + +class ManagedDiskDetails(DataAccountDetails): + """Details of the managed disks. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :type share_password: str + :param resource_group_id: Required. Resource Group Id of the compute disks. + :type resource_group_id: str + :param staging_storage_account_id: Required. Resource Id of the storage account that can be + used to copy the vhd for staging. + :type staging_storage_account_id: str + """ + + _validation = { + 'data_account_type': {'required': True}, + 'resource_group_id': {'required': True}, + 'staging_storage_account_id': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, + 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, + 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedDiskDetails, self).__init__(**kwargs) + self.data_account_type = 'ManagedDisk' # type: str + self.resource_group_id = kwargs['resource_group_id'] + self.staging_storage_account_id = kwargs['staging_storage_account_id'] + + +class NotificationPreference(msrest.serialization.Model): """Notification preference for a job stage. All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: - 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', - 'DataCopy' - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName + :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". + :type stage_name: str or ~data_box_management_client.models.NotificationStageName :param send_notification: Required. Notification is required or not. :type send_notification: bool """ @@ -2112,31 +2622,35 @@ class NotificationPreference(Model): } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'NotificationStageName'}, + 'stage_name': {'key': 'stageName', 'type': 'str'}, 'send_notification': {'key': 'sendNotification', 'type': 'bool'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(NotificationPreference, self).__init__(**kwargs) - self.stage_name = kwargs.get('stage_name', None) - self.send_notification = kwargs.get('send_notification', None) + self.stage_name = kwargs['stage_name'] + self.send_notification = kwargs['send_notification'] -class Operation(Model): +class Operation(msrest.serialization.Model): """Operation entity. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the operation. Format: - {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} + {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~data_box_management_client.models.OperationDisplay :ivar properties: Operation properties. :vartype properties: object - :ivar origin: Origin of the operation. Can be : user|system|user,system + :ivar origin: Origin of the operation. Can be : user|system|user,system. :vartype origin: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool """ _validation = { @@ -2151,17 +2665,22 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'properties': {'key': 'properties', 'type': 'object'}, 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Operation, self).__init__(**kwargs) self.name = None self.display = None self.properties = None self.origin = None + self.is_data_action = kwargs.get('is_data_action', None) -class OperationDisplay(Model): +class OperationDisplay(msrest.serialization.Model): """Operation display. :param provider: Provider name. @@ -2170,8 +2689,7 @@ class OperationDisplay(Model): :type resource: str :param operation: Localized name of the operation for display purpose. :type operation: str - :param description: Localized description of the operation for display - purpose. + :param description: Localized description of the operation for display purpose. :type description: str """ @@ -2182,7 +2700,10 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OperationDisplay, self).__init__(**kwargs) self.provider = kwargs.get('provider', None) self.resource = kwargs.get('resource', None) @@ -2190,11 +2711,39 @@ def __init__(self, **kwargs): self.description = kwargs.get('description', None) -class PackageShippingDetails(Model): +class OperationList(msrest.serialization.Model): + """Operation Collection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations. + :vartype value: list[~data_box_management_client.models.Operation] + :param next_link: Link for the next set of operations. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class PackageShippingDetails(msrest.serialization.Model): """Shipping details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar carrier_name: Name of the carrier. :vartype carrier_name: str @@ -2216,33 +2765,41 @@ class PackageShippingDetails(Model): 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(PackageShippingDetails, self).__init__(**kwargs) self.carrier_name = None self.tracking_id = None self.tracking_url = None -class Preferences(Model): +class Preferences(msrest.serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: Preferred Data Center Region. + :param preferred_data_center_region: Preferred data center region. :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment - logistics of the sku. - :type transport_preferences: - ~azure.mgmt.databox.models.TransportPreferences + :param transport_preferences: Preferences related to the shipment logistics of the sku. + :type transport_preferences: ~data_box_management_client.models.TransportPreferences + :param encryption_preferences: Preferences related to the Encryption. + :type encryption_preferences: ~data_box_management_client.models.EncryptionPreferences """ _attribute_map = { 'preferred_data_center_region': {'key': 'preferredDataCenterRegion', 'type': '[str]'}, 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, + 'encryption_preferences': {'key': 'encryptionPreferences', 'type': 'EncryptionPreferences'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Preferences, self).__init__(**kwargs) self.preferred_data_center_region = kwargs.get('preferred_data_center_region', None) self.transport_preferences = kwargs.get('transport_preferences', None) + self.encryption_preferences = kwargs.get('encryption_preferences', None) class PreferencesValidationRequest(ValidationInputRequest): @@ -2250,14 +2807,16 @@ class PreferencesValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param preference: Preference requested with respect to transport type and - data center - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param preference: Preference of transport and data center. + :type preference: ~data_box_management_client.models.Preferences + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName """ _validation = { @@ -2268,62 +2827,70 @@ class PreferencesValidationRequest(ValidationInputRequest): _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, 'preference': {'key': 'preference', 'type': 'Preferences'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(PreferencesValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidatePreferences' # type: str self.preference = kwargs.get('preference', None) - self.device_type = kwargs.get('device_type', None) - self.validation_type = 'ValidatePreferences' + self.device_type = kwargs['device_type'] class PreferencesValidationResponseProperties(ValidationInputResponse): """Properties of data center and transport preference validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Validation status of requested data center and transport. - Possible values include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Validation status of requested data center and transport. Possible values + include: "Valid", "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(PreferencesValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidatePreferences' # type: str self.status = None - self.validation_type = 'ValidatePreferences' -class RegionConfigurationRequest(Model): +class RegionConfigurationRequest(msrest.serialization.Model): """Request body to get the configuration for the region. - :param schedule_availability_request: Request body to get the availability - for scheduling orders. + :param schedule_availability_request: Request body to get the availability for scheduling + orders. :type schedule_availability_request: - ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport - availability for given sku. + ~data_box_management_client.models.ScheduleAvailabilityRequest + :param transport_availability_request: Request body to get the transport availability for given + sku. :type transport_availability_request: - ~azure.mgmt.databox.models.TransportAvailabilityRequest + ~data_box_management_client.models.TransportAvailabilityRequest """ _attribute_map = { @@ -2331,26 +2898,26 @@ class RegionConfigurationRequest(Model): 'transport_availability_request': {'key': 'transportAvailabilityRequest', 'type': 'TransportAvailabilityRequest'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(RegionConfigurationRequest, self).__init__(**kwargs) self.schedule_availability_request = kwargs.get('schedule_availability_request', None) self.transport_availability_request = kwargs.get('transport_availability_request', None) -class RegionConfigurationResponse(Model): +class RegionConfigurationResponse(msrest.serialization.Model): """Configuration response specific to a region. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar schedule_availability_response: Schedule availability for given sku - in a region. + :ivar schedule_availability_response: Schedule availability for given sku in a region. :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for - given sku in a region. + ~data_box_management_client.models.ScheduleAvailabilityResponse + :ivar transport_availability_response: Transport options available for given sku in a region. :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse + ~data_box_management_client.models.TransportAvailabilityResponse """ _validation = { @@ -2363,20 +2930,61 @@ class RegionConfigurationResponse(Model): 'transport_availability_response': {'key': 'transportAvailabilityResponse', 'type': 'TransportAvailabilityResponse'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(RegionConfigurationResponse, self).__init__(**kwargs) self.schedule_availability_response = None self.transport_availability_response = None -class ScheduleAvailabilityResponse(Model): - """Schedule availability response for given sku in a region. +class ResourceIdentity(msrest.serialization.Model): + """Msi identity details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Identity type. + :type type: str + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + :param user_assigned_identities: User Assigned Identities. + :type user_assigned_identities: dict[str, + ~data_box_management_client.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.principal_id = None + self.tenant_id = None + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class ScheduleAvailabilityResponse(msrest.serialization.Model): + """Schedule availability for given sku in a region. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar available_dates: List of dates available to schedule - :vartype available_dates: list[datetime] + :ivar available_dates: List of dates available to schedule. + :vartype available_dates: list[~datetime.datetime] """ _validation = { @@ -2387,31 +2995,31 @@ class ScheduleAvailabilityResponse(Model): 'available_dates': {'key': 'availableDates', 'type': '[iso-8601]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ScheduleAvailabilityResponse, self).__init__(**kwargs) self.available_dates = None -class ShareCredentialDetails(Model): +class ShareCredentialDetails(msrest.serialization.Model): """Credential details of the shares in account. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar share_name: Name of the share. :vartype share_name: str - :ivar share_type: Type of the share. Possible values include: - 'UnknownType', 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile', 'ManagedDisk' - :vartype share_type: str or - ~azure.mgmt.databox.models.ShareDestinationFormatType + :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", + "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk", "AzurePremiumFiles". + :vartype share_type: str or ~data_box_management_client.models.ShareDestinationFormatType :ivar user_name: User name for the share. :vartype user_name: str :ivar password: Password for the share. :vartype password: str - :ivar supported_access_protocols: Access protocols supported on the - device. + :ivar supported_access_protocols: Access protocols supported on the device. :vartype supported_access_protocols: list[str or - ~azure.mgmt.databox.models.AccessProtocol] + ~data_box_management_client.models.AccessProtocol] """ _validation = { @@ -2424,13 +3032,16 @@ class ShareCredentialDetails(Model): _attribute_map = { 'share_name': {'key': 'shareName', 'type': 'str'}, - 'share_type': {'key': 'shareType', 'type': 'ShareDestinationFormatType'}, + 'share_type': {'key': 'shareType', 'type': 'str'}, 'user_name': {'key': 'userName', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, - 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[AccessProtocol]'}, + 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ShareCredentialDetails, self).__init__(**kwargs) self.share_name = None self.share_type = None @@ -2439,19 +3050,18 @@ def __init__(self, **kwargs): self.supported_access_protocols = None -class ShipmentPickUpRequest(Model): +class ShipmentPickUpRequest(msrest.serialization.Model): """Shipment pick up request details. All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should - commence, this must be in local time of pick up area. - :type start_time: datetime - :param end_time: Required. Maximum date before which the pick up should - commence, this must be in local time of pick up area. - :type end_time: datetime - :param shipment_location: Required. Shipment Location in the pickup place. - Eg.front desk + :param start_time: Required. Minimum date after which the pick up should commence, this must be + in local time of pick up area. + :type start_time: ~datetime.datetime + :param end_time: Required. Maximum date before which the pick up should commence, this must be + in local time of pick up area. + :type end_time: ~datetime.datetime + :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. :type shipment_location: str """ @@ -2467,24 +3077,26 @@ class ShipmentPickUpRequest(Model): 'shipment_location': {'key': 'shipmentLocation', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ShipmentPickUpRequest, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.end_time = kwargs.get('end_time', None) - self.shipment_location = kwargs.get('shipment_location', None) + self.start_time = kwargs['start_time'] + self.end_time = kwargs['end_time'] + self.shipment_location = kwargs['shipment_location'] -class ShipmentPickUpResponse(Model): +class ShipmentPickUpResponse(msrest.serialization.Model): """Shipment pick up response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar confirmation_number: Confirmation number for the pick up request. :vartype confirmation_number: str - :ivar ready_by_time: Time by which shipment should be ready for pick up, - this is in local time of pick up area. - :vartype ready_by_time: datetime + :ivar ready_by_time: Time by which shipment should be ready for pick up, this is in local time + of pick up area. + :vartype ready_by_time: ~datetime.datetime """ _validation = { @@ -2497,13 +3109,16 @@ class ShipmentPickUpResponse(Model): 'ready_by_time': {'key': 'readyByTime', 'type': 'iso-8601'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ShipmentPickUpResponse, self).__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None -class ShippingAddress(Model): +class ShippingAddress(msrest.serialization.Model): """Shipping address where customer wishes to receive the device. All required parameters must be populated in order to send to Azure. @@ -2520,21 +3135,20 @@ class ShippingAddress(Model): :type state_or_province: str :param country: Required. Name of the Country. :type country: str - :param postal_code: Required. Postal code. + :param postal_code: Postal code. :type postal_code: str :param zip_extended_code: Extended Zip Code. :type zip_extended_code: str :param company_name: Name of the company. :type company_name: str - :param address_type: Type of address. Possible values include: 'None', - 'Residential', 'Commercial' - :type address_type: str or ~azure.mgmt.databox.models.AddressType + :param address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". + :type address_type: str or ~data_box_management_client.models.AddressType """ _validation = { 'street_address1': {'required': True}, 'country': {'required': True}, - 'postal_code': {'required': True}, } _attribute_map = { @@ -2547,31 +3161,34 @@ class ShippingAddress(Model): 'postal_code': {'key': 'postalCode', 'type': 'str'}, 'zip_extended_code': {'key': 'zipExtendedCode', 'type': 'str'}, 'company_name': {'key': 'companyName', 'type': 'str'}, - 'address_type': {'key': 'addressType', 'type': 'AddressType'}, + 'address_type': {'key': 'addressType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ShippingAddress, self).__init__(**kwargs) - self.street_address1 = kwargs.get('street_address1', None) + self.street_address1 = kwargs['street_address1'] self.street_address2 = kwargs.get('street_address2', None) self.street_address3 = kwargs.get('street_address3', None) self.city = kwargs.get('city', None) self.state_or_province = kwargs.get('state_or_province', None) - self.country = kwargs.get('country', None) + self.country = kwargs['country'] self.postal_code = kwargs.get('postal_code', None) self.zip_extended_code = kwargs.get('zip_extended_code', None) self.company_name = kwargs.get('company_name', None) self.address_type = kwargs.get('address_type', None) -class Sku(Model): +class Sku(msrest.serialization.Model): """The Sku. All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: 'DataBox', - 'DataBoxDisk', 'DataBoxHeavy' - :type name: str or ~azure.mgmt.databox.models.SkuName + :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :type name: str or ~data_box_management_client.models.SkuName :param display_name: The display name of the sku. :type display_name: str :param family: The sku family. @@ -2583,14 +3200,17 @@ class Sku(Model): } _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, + 'name': {'key': 'name', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'family': {'key': 'family', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] self.display_name = kwargs.get('display_name', None) self.family = kwargs.get('family', None) @@ -2598,95 +3218,99 @@ def __init__(self, **kwargs): class SkuAvailabilityValidationRequest(ValidationInputRequest): """Request to validate sku availability. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :ivar transfer_type: Required. Type of the transfer. Default value: - "ImportToAzure" . - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. - For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName + :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType + :param country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. :type country: str - :param location: Required. Location for data transfer. For locations - check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type location: str """ _validation = { 'validation_type': {'required': True}, 'device_type': {'required': True}, - 'transfer_type': {'required': True, 'constant': True}, + 'transfer_type': {'required': True}, 'country': {'required': True}, 'location': {'required': True}, } _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, 'transfer_type': {'key': 'transferType', 'type': 'str'}, 'country': {'key': 'country', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, } - transfer_type = "ImportToAzure" - - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) - self.device_type = kwargs.get('device_type', None) - self.country = kwargs.get('country', None) - self.location = kwargs.get('location', None) - self.validation_type = 'ValidateSkuAvailability' + self.validation_type = 'ValidateSkuAvailability' # type: str + self.device_type = kwargs['device_type'] + self.transfer_type = kwargs['transfer_type'] + self.country = kwargs['country'] + self.location = kwargs['location'] class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): """Properties of sku availability validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Sku availability validation status. Possible values include: - 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", + "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateSkuAvailability' # type: str self.status = None - self.validation_type = 'ValidateSkuAvailability' -class SkuCapacity(Model): +class SkuCapacity(msrest.serialization.Model): """Capacity of the sku. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar usable: Usable capacity in TB. :vartype usable: str @@ -2704,65 +3328,73 @@ class SkuCapacity(Model): 'maximum': {'key': 'maximum', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SkuCapacity, self).__init__(**kwargs) self.usable = None self.maximum = None -class SkuCost(Model): +class SkuCost(msrest.serialization.Model): """Describes metadata for retrieving price info. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar meter_id: Meter id of the Sku. :vartype meter_id: str :ivar meter_type: The type of the meter. :vartype meter_type: str + :ivar multiplier: Multiplier specifies the region specific value to be multiplied with 1$ guid. + Eg: Our new regions will be using 1$ shipping guid with appropriate multiplier specific to + region. + :vartype multiplier: float """ _validation = { 'meter_id': {'readonly': True}, 'meter_type': {'readonly': True}, + 'multiplier': {'readonly': True}, } _attribute_map = { 'meter_id': {'key': 'meterId', 'type': 'str'}, 'meter_type': {'key': 'meterType', 'type': 'str'}, + 'multiplier': {'key': 'multiplier', 'type': 'float'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SkuCost, self).__init__(**kwargs) self.meter_id = None self.meter_type = None + self.multiplier = None -class SkuInformation(Model): +class SkuInformation(msrest.serialization.Model): """Information of the sku. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :vartype sku: ~data_box_management_client.models.Sku :ivar enabled: The sku is enabled or not. :vartype enabled: bool - :ivar destination_to_service_location_map: The map of destination location - to service location. - :vartype destination_to_service_location_map: - list[~azure.mgmt.databox.models.DestinationToServiceLocationMap] + :ivar data_location_to_service_location_map: The map of data location to service location. + :vartype data_location_to_service_location_map: + list[~data_box_management_client.models.DataLocationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~data_box_management_client.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :vartype costs: list[~data_box_management_client.models.SkuCost] :ivar api_versions: Api versions that support this Sku. :vartype api_versions: list[str] - :ivar disabled_reason: Reason why the Sku is disabled. Possible values - include: 'None', 'Country', 'Region', 'Feature', 'OfferType', - 'NoSubscriptionInfo' - :vartype disabled_reason: str or - ~azure.mgmt.databox.models.SkuDisabledReason + :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", + "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". + :vartype disabled_reason: str or ~data_box_management_client.models.SkuDisabledReason :ivar disabled_reason_message: Message for why the Sku is disabled. :vartype disabled_reason_message: str :ivar required_feature: Required feature to access the sku. @@ -2772,7 +3404,7 @@ class SkuInformation(Model): _validation = { 'sku': {'readonly': True}, 'enabled': {'readonly': True}, - 'destination_to_service_location_map': {'readonly': True}, + 'data_location_to_service_location_map': {'readonly': True}, 'capacity': {'readonly': True}, 'costs': {'readonly': True}, 'api_versions': {'readonly': True}, @@ -2784,20 +3416,23 @@ class SkuInformation(Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'destination_to_service_location_map': {'key': 'properties.destinationToServiceLocationMap', 'type': '[DestinationToServiceLocationMap]'}, + 'data_location_to_service_location_map': {'key': 'properties.dataLocationToServiceLocationMap', 'type': '[DataLocationToServiceLocationMap]'}, 'capacity': {'key': 'properties.capacity', 'type': 'SkuCapacity'}, 'costs': {'key': 'properties.costs', 'type': '[SkuCost]'}, 'api_versions': {'key': 'properties.apiVersions', 'type': '[str]'}, - 'disabled_reason': {'key': 'properties.disabledReason', 'type': 'SkuDisabledReason'}, + 'disabled_reason': {'key': 'properties.disabledReason', 'type': 'str'}, 'disabled_reason_message': {'key': 'properties.disabledReasonMessage', 'type': 'str'}, 'required_feature': {'key': 'properties.requiredFeature', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SkuInformation, self).__init__(**kwargs) self.sku = None self.enabled = None - self.destination_to_service_location_map = None + self.data_location_to_service_location_map = None self.capacity = None self.costs = None self.api_versions = None @@ -2806,13 +3441,55 @@ def __init__(self, **kwargs): self.required_feature = None +class StorageAccountDetails(DataAccountDetails): + """Details for the storage account. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :type share_password: str + :param storage_account_id: Required. Storage Account Resource Id. + :type storage_account_id: str + """ + + _validation = { + 'data_account_type': {'required': True}, + 'storage_account_id': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountDetails, self).__init__(**kwargs) + self.data_account_type = 'StorageAccount' # type: str + self.storage_account_id = kwargs['storage_account_id'] + + class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): """Request to validate subscription permission to create jobs. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator """ _validation = { @@ -2823,56 +3500,211 @@ class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): 'validation_type': {'key': 'validationType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' + self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): """Properties of subscription permission to create job validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Validation status of subscription permission to create job. - Possible values include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Validation status of subscription permission to create job. Possible values + include: "Valid", "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str self.status = None - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' -class TransportAvailabilityDetails(Model): +class TransferAllDetails(msrest.serialization.Model): + """Details to transfer all data. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :type transfer_all_blobs: bool + :param transfer_all_files: To indicate if all Azure Files have to be transferred. + :type transfer_all_files: bool + """ + + _validation = { + 'data_account_type': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'transfer_all_blobs': {'key': 'transferAllBlobs', 'type': 'bool'}, + 'transfer_all_files': {'key': 'transferAllFiles', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(TransferAllDetails, self).__init__(**kwargs) + self.data_account_type = kwargs['data_account_type'] + self.transfer_all_blobs = kwargs.get('transfer_all_blobs', None) + self.transfer_all_files = kwargs.get('transfer_all_files', None) + + +class TransferConfiguration(msrest.serialization.Model): + """Configuration for defining the transfer of data. + + All required parameters must be populated in order to send to Azure. + + :param transfer_configuration_type: Required. Type of the configuration for transfer. Possible + values include: "TransferAll", "TransferUsingFilter". + :type transfer_configuration_type: str or + ~data_box_management_client.models.TransferConfigurationType + :param transfer_filter_details: Map of filter type and the details to filter. This field is + required only if the TransferConfigurationType is given as TransferUsingFilter. + :type transfer_filter_details: + ~data_box_management_client.models.TransferConfigurationTransferFilterDetails + :param transfer_all_details: Map of filter type and the details to transfer all data. This + field is required only if the TransferConfigurationType is given as TransferAll. + :type transfer_all_details: + ~data_box_management_client.models.TransferConfigurationTransferAllDetails + """ + + _validation = { + 'transfer_configuration_type': {'required': True}, + } + + _attribute_map = { + 'transfer_configuration_type': {'key': 'transferConfigurationType', 'type': 'str'}, + 'transfer_filter_details': {'key': 'transferFilterDetails', 'type': 'TransferConfigurationTransferFilterDetails'}, + 'transfer_all_details': {'key': 'transferAllDetails', 'type': 'TransferConfigurationTransferAllDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(TransferConfiguration, self).__init__(**kwargs) + self.transfer_configuration_type = kwargs['transfer_configuration_type'] + self.transfer_filter_details = kwargs.get('transfer_filter_details', None) + self.transfer_all_details = kwargs.get('transfer_all_details', None) + + +class TransferConfigurationTransferAllDetails(msrest.serialization.Model): + """Map of filter type and the details to transfer all data. This field is required only if the TransferConfigurationType is given as TransferAll. + + :param include: Details to transfer all data. + :type include: ~data_box_management_client.models.TransferAllDetails + """ + + _attribute_map = { + 'include': {'key': 'include', 'type': 'TransferAllDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(TransferConfigurationTransferAllDetails, self).__init__(**kwargs) + self.include = kwargs.get('include', None) + + +class TransferConfigurationTransferFilterDetails(msrest.serialization.Model): + """Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. + + :param include: Details of the filtering the transfer of data. + :type include: ~data_box_management_client.models.TransferFilterDetails + """ + + _attribute_map = { + 'include': {'key': 'include', 'type': 'TransferFilterDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(TransferConfigurationTransferFilterDetails, self).__init__(**kwargs) + self.include = kwargs.get('include', None) + + +class TransferFilterDetails(msrest.serialization.Model): + """Details of the filtering the transfer of data. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param blob_filter_details: Filter details to transfer blobs. + :type blob_filter_details: ~data_box_management_client.models.BlobFilterDetails + :param azure_file_filter_details: Filter details to transfer Azure files. + :type azure_file_filter_details: ~data_box_management_client.models.AzureFileFilterDetails + :param filter_file_details: Details of the filter files to be used for data transfer. + :type filter_file_details: list[~data_box_management_client.models.FilterFileDetails] + """ + + _validation = { + 'data_account_type': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'blob_filter_details': {'key': 'blobFilterDetails', 'type': 'BlobFilterDetails'}, + 'azure_file_filter_details': {'key': 'azureFileFilterDetails', 'type': 'AzureFileFilterDetails'}, + 'filter_file_details': {'key': 'filterFileDetails', 'type': '[FilterFileDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(TransferFilterDetails, self).__init__(**kwargs) + self.data_account_type = kwargs['data_account_type'] + self.blob_filter_details = kwargs.get('blob_filter_details', None) + self.azure_file_filter_details = kwargs.get('azure_file_filter_details', None) + self.filter_file_details = kwargs.get('filter_file_details', None) + + +class TransportAvailabilityDetails(msrest.serialization.Model): """Transport options availability details for given region. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar shipment_type: Transport Shipment Type supported for given region. - Possible values include: 'CustomerManaged', 'MicrosoftManaged' - :vartype shipment_type: str or - ~azure.mgmt.databox.models.TransportShipmentTypes + :ivar shipment_type: Transport Shipment Type supported for given region. Possible values + include: "CustomerManaged", "MicrosoftManaged". + :vartype shipment_type: str or ~data_box_management_client.models.TransportShipmentTypes """ _validation = { @@ -2880,41 +3712,45 @@ class TransportAvailabilityDetails(Model): } _attribute_map = { - 'shipment_type': {'key': 'shipmentType', 'type': 'TransportShipmentTypes'}, + 'shipment_type': {'key': 'shipmentType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(TransportAvailabilityDetails, self).__init__(**kwargs) self.shipment_type = None -class TransportAvailabilityRequest(Model): +class TransportAvailabilityRequest(msrest.serialization.Model): """Request body to get the transport availability for given sku. - :param sku_name: Type of the device. Possible values include: 'DataBox', - 'DataBoxDisk', 'DataBoxHeavy' - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName """ _attribute_map = { - 'sku_name': {'key': 'skuName', 'type': 'SkuName'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(TransportAvailabilityRequest, self).__init__(**kwargs) self.sku_name = kwargs.get('sku_name', None) -class TransportAvailabilityResponse(Model): +class TransportAvailabilityResponse(msrest.serialization.Model): """Transport options available for given sku in a region. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar transport_availability_details: List of transport availability - details for given region + :ivar transport_availability_details: List of transport availability details for given region. :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] + list[~data_box_management_client.models.TransportAvailabilityDetails] """ _validation = { @@ -2925,21 +3761,22 @@ class TransportAvailabilityResponse(Model): 'transport_availability_details': {'key': 'transportAvailabilityDetails', 'type': '[TransportAvailabilityDetails]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(TransportAvailabilityResponse, self).__init__(**kwargs) self.transport_availability_details = None -class TransportPreferences(Model): +class TransportPreferences(msrest.serialization.Model): """Preferences related to the shipment logistics of the sku. All required parameters must be populated in order to send to Azure. - :param preferred_shipment_type: Required. Indicates Shipment Logistics - type that the customer preferred. Possible values include: - 'CustomerManaged', 'MicrosoftManaged' - :type preferred_shipment_type: str or - ~azure.mgmt.databox.models.TransportShipmentTypes + :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". + :type preferred_shipment_type: str or ~data_box_management_client.models.TransportShipmentTypes """ _validation = { @@ -2947,24 +3784,26 @@ class TransportPreferences(Model): } _attribute_map = { - 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'TransportShipmentTypes'}, + 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(TransportPreferences, self).__init__(**kwargs) - self.preferred_shipment_type = kwargs.get('preferred_shipment_type', None) + self.preferred_shipment_type = kwargs['preferred_shipment_type'] -class UnencryptedCredentials(Model): +class UnencryptedCredentials(msrest.serialization.Model): """Unencrypted credentials for accessing device. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar job_name: Name of the job. :vartype job_name: str :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets + :vartype job_secrets: ~data_box_management_client.models.JobSecrets """ _validation = { @@ -2977,49 +3816,131 @@ class UnencryptedCredentials(Model): 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(UnencryptedCredentials, self).__init__(**kwargs) self.job_name = None self.job_secrets = None -class UpdateJobDetails(Model): +class UnencryptedCredentialsList(msrest.serialization.Model): + """List of unencrypted credentials for accessing device. + + :param value: List of unencrypted credentials. + :type value: list[~data_box_management_client.models.UnencryptedCredentials] + :param next_link: Link for the next set of unencrypted credentials. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UnencryptedCredentials]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UnencryptedCredentialsList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class UpdateJobDetails(msrest.serialization.Model): """Job details for update. :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails + :type contact_details: ~data_box_management_client.models.ContactDetails :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :type shipping_address: ~data_box_management_client.models.ShippingAddress + :param key_encryption_key: Key encryption key for the job. + :type key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey """ _attribute_map = { 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(UpdateJobDetails, self).__init__(**kwargs) self.contact_details = kwargs.get('contact_details', None) self.shipping_address = kwargs.get('shipping_address', None) + self.key_encryption_key = kwargs.get('key_encryption_key', None) + + +class UserAssignedIdentity(msrest.serialization.Model): + """Class defining User assigned identity details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class UserAssignedProperties(msrest.serialization.Model): + """User assigned identity properties. + + :param resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :type resource_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedProperties, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) class ValidateAddress(ValidationInputRequest): - """The requirements to validate customer address where the device needs to be - shipped. + """The requirements to validate customer address where the device needs to be shipped. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment - logistics of the sku. - :type transport_preferences: - ~azure.mgmt.databox.models.TransportPreferences + :type shipping_address: ~data_box_management_client.models.ShippingAddress + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName + :param transport_preferences: Preferences related to the shipment logistics of the sku. + :type transport_preferences: ~data_box_management_client.models.TransportPreferences """ _validation = { @@ -3031,32 +3952,33 @@ class ValidateAddress(ValidationInputRequest): _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ValidateAddress, self).__init__(**kwargs) - self.shipping_address = kwargs.get('shipping_address', None) - self.device_type = kwargs.get('device_type', None) + self.validation_type = 'ValidateAddress' # type: str + self.shipping_address = kwargs['shipping_address'] + self.device_type = kwargs['device_type'] self.transport_preferences = kwargs.get('transport_preferences', None) - self.validation_type = 'ValidateAddress' -class ValidationResponse(Model): +class ValidationResponse(msrest.serialization.Model): """Response of pre job creation validations. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar status: Overall validation status. Possible values include: - 'AllValidToProceed', 'InputsRevisitRequired', - 'CertainInputValidationsSkipped' - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus - :ivar individual_response_details: List of response details contain - validationType and its response as key and value respectively. + :ivar status: Overall validation status. Possible values include: "AllValidToProceed", + "InputsRevisitRequired", "CertainInputValidationsSkipped". + :vartype status: str or ~data_box_management_client.models.OverallValidationStatus + :ivar individual_response_details: List of response details contain validationType and its + response as key and value respectively. :vartype individual_response_details: - list[~azure.mgmt.databox.models.ValidationInputResponse] + list[~data_box_management_client.models.ValidationInputResponse] """ _validation = { @@ -3065,11 +3987,14 @@ class ValidationResponse(Model): } _attribute_map = { - 'status': {'key': 'properties.status', 'type': 'OverallValidationStatus'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'individual_response_details': {'key': 'properties.individualResponseDetails', 'type': '[ValidationInputResponse]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ValidationResponse, self).__init__(**kwargs) self.status = None self.individual_response_details = None diff --git a/src/databox/azext_databox/vendored_sdks/databox/models/_models_py3.py b/src/databox/azext_databox/vendored_sdks/databox/models/_models_py3.py index a96c0dc5c49..fafd11e20e2 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/models/_models_py3.py +++ b/src/databox/azext_databox/vendored_sdks/databox/models/_models_py3.py @@ -1,76 +1,106 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import datetime +from typing import Dict, List, Optional, Union +from azure.core.exceptions import HttpResponseError +import msrest.serialization -class AccountCredentialDetails(Model): +from ._data_box_management_client_enums import * + + +class AccountCredentialDetails(msrest.serialization.Model): """Credential details of the account. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar account_name: Name of the account. :vartype account_name: str - :ivar data_destination_type: Data Destination Type. Possible values - include: 'StorageAccount', 'ManagedDisk' - :vartype data_destination_type: str or - ~azure.mgmt.databox.models.DataDestinationType - :ivar account_connection_string: Connection string of the account endpoint - to use the account as a storage endpoint on the device. + :ivar data_account_type: Type of the account. Possible values include: "StorageAccount", + "ManagedDisk". + :vartype data_account_type: str or ~data_box_management_client.models.DataAccountType + :ivar account_connection_string: Connection string of the account endpoint to use the account + as a storage endpoint on the device. :vartype account_connection_string: str - :ivar share_credential_details: Per share level unencrypted access - credentials. + :ivar share_credential_details: Per share level unencrypted access credentials. :vartype share_credential_details: - list[~azure.mgmt.databox.models.ShareCredentialDetails] + list[~data_box_management_client.models.ShareCredentialDetails] """ _validation = { 'account_name': {'readonly': True}, - 'data_destination_type': {'readonly': True}, + 'data_account_type': {'readonly': True}, 'account_connection_string': {'readonly': True}, 'share_credential_details': {'readonly': True}, } _attribute_map = { 'account_name': {'key': 'accountName', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'DataDestinationType'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, 'account_connection_string': {'key': 'accountConnectionString', 'type': 'str'}, 'share_credential_details': {'key': 'shareCredentialDetails', 'type': '[ShareCredentialDetails]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(AccountCredentialDetails, self).__init__(**kwargs) self.account_name = None - self.data_destination_type = None + self.data_account_type = None self.account_connection_string = None self.share_credential_details = None -class AddressValidationOutput(Model): +class AdditionalErrorInfo(msrest.serialization.Model): + """Additional error info. + + :param type: Additional error type. + :type type: str + :param info: Additional error info. + :type info: object + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + info: Optional[object] = None, + **kwargs + ): + super(AdditionalErrorInfo, self).__init__(**kwargs) + self.type = type + self.info = info + + +class AddressValidationOutput(msrest.serialization.Model): """Output of the address validation api. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. + :param validation_type: Identifies the type of validation response.Constant filled by server. + Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar validation_status: The address validation status. Possible values - include: 'Valid', 'Invalid', 'Ambiguous' - :vartype validation_status: str or - ~azure.mgmt.databox.models.AddressValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar validation_status: The address validation status. Possible values include: "Valid", + "Invalid", "Ambiguous". + :vartype validation_status: str or ~data_box_management_client.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: - list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~data_box_management_client.models.ShippingAddress] """ _validation = { @@ -80,23 +110,141 @@ class AddressValidationOutput(Model): } _attribute_map = { - 'error': {'key': 'properties.error', 'type': 'Error'}, - 'validation_status': {'key': 'properties.validationStatus', 'type': 'AddressValidationStatus'}, + 'validation_type': {'key': 'properties.validationType', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'CloudError'}, + 'validation_status': {'key': 'properties.validationStatus', 'type': 'str'}, 'alternate_addresses': {'key': 'properties.alternateAddresses', 'type': '[ShippingAddress]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(AddressValidationOutput, self).__init__(**kwargs) + self.validation_type = None # type: Optional[str] + self.error = None + self.validation_status = None + self.alternate_addresses = None + + +class ValidationInputResponse(msrest.serialization.Model): + """Minimum properties that should be present in each individual validation response. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AddressValidationProperties, CreateOrderLimitForSubscriptionValidationResponseProperties, DataTransferDetailsValidationResponseProperties, PreferencesValidationResponseProperties, SkuAvailabilityValidationResponseProperties, SubscriptionIsAllowedToCreateJobValidationResponseProperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~data_box_management_client.models.CloudError + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + } + + _subtype_map = { + 'validation_type': {'ValidateAddress': 'AddressValidationProperties', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} + } + + def __init__( + self, + **kwargs + ): + super(ValidationInputResponse, self).__init__(**kwargs) + self.validation_type = None # type: Optional[str] self.error = None + + +class AddressValidationProperties(ValidationInputResponse): + """The address validation output. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~data_box_management_client.models.CloudError + :ivar validation_status: The address validation status. Possible values include: "Valid", + "Invalid", "Ambiguous". + :vartype validation_status: str or ~data_box_management_client.models.AddressValidationStatus + :ivar alternate_addresses: List of alternate addresses. + :vartype alternate_addresses: list[~data_box_management_client.models.ShippingAddress] + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'validation_status': {'readonly': True}, + 'alternate_addresses': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'validation_status': {'key': 'validationStatus', 'type': 'str'}, + 'alternate_addresses': {'key': 'alternateAddresses', 'type': '[ShippingAddress]'}, + } + + def __init__( + self, + **kwargs + ): + super(AddressValidationProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateAddress' # type: str self.validation_status = None self.alternate_addresses = None -class ApplianceNetworkConfiguration(Model): +class ApiError(msrest.serialization.Model): + """ApiError. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. + :type error: ~data_box_management_client.models.ErrorDetail + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: "ErrorDetail", + **kwargs + ): + super(ApiError, self).__init__(**kwargs) + self.error = error + + +class ApplianceNetworkConfiguration(msrest.serialization.Model): """The Network Adapter configuration of a DataBox. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the network. :vartype name: str @@ -114,17 +262,19 @@ class ApplianceNetworkConfiguration(Model): 'mac_address': {'key': 'macAddress', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ApplianceNetworkConfiguration, self).__init__(**kwargs) self.name = None self.mac_address = None -class ArmBaseObject(Model): +class ArmBaseObject(msrest.serialization.Model): """Base class for all objects under resource. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the object. :vartype name: str @@ -146,38 +296,36 @@ class ArmBaseObject(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ArmBaseObject, self).__init__(**kwargs) self.name = None self.id = None self.type = None -class AvailableSkuRequest(Model): +class AvailableSkuRequest(msrest.serialization.Model): """The filters for showing the available skus. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. - :ivar transfer_type: Required. Type of the transfer. Default value: - "ImportToAzure" . - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. - For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType + :param country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. :type country: str - :param location: Required. Location for data transfer. For locations - check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type location: str - :param sku_names: Sku Names to filter for available skus - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + :param sku_names: Sku Names to filter for available skus. + :type sku_names: list[str or ~data_box_management_client.models.SkuName] """ _validation = { - 'transfer_type': {'required': True, 'constant': True}, + 'transfer_type': {'required': True}, 'country': {'required': True}, 'location': {'required': True}, } @@ -186,19 +334,119 @@ class AvailableSkuRequest(Model): 'transfer_type': {'key': 'transferType', 'type': 'str'}, 'country': {'key': 'country', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, - 'sku_names': {'key': 'skuNames', 'type': '[SkuName]'}, - } - - transfer_type = "ImportToAzure" - - def __init__(self, *, country: str, location: str, sku_names=None, **kwargs) -> None: + 'sku_names': {'key': 'skuNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + transfer_type: Union[str, "TransferType"], + country: str, + location: str, + sku_names: Optional[List[Union[str, "SkuName"]]] = None, + **kwargs + ): super(AvailableSkuRequest, self).__init__(**kwargs) + self.transfer_type = transfer_type self.country = country self.location = location self.sku_names = sku_names -class CancellationReason(Model): +class AvailableSkusResult(msrest.serialization.Model): + """The available skus operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of available skus. + :vartype value: list[~data_box_management_client.models.SkuInformation] + :param next_link: Link for the next set of skus. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInformation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(AvailableSkusResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class AzureFileFilterDetails(msrest.serialization.Model): + """Filter details to transfer Azure files. + + :param file_prefix_list: Prefix list of the Azure files to be transferred. + :type file_prefix_list: list[str] + :param file_path_list: List of full path of the files to be transferred. + :type file_path_list: list[str] + :param file_share_list: List of file shares to be transferred. + :type file_share_list: list[str] + """ + + _attribute_map = { + 'file_prefix_list': {'key': 'filePrefixList', 'type': '[str]'}, + 'file_path_list': {'key': 'filePathList', 'type': '[str]'}, + 'file_share_list': {'key': 'fileShareList', 'type': '[str]'}, + } + + def __init__( + self, + *, + file_prefix_list: Optional[List[str]] = None, + file_path_list: Optional[List[str]] = None, + file_share_list: Optional[List[str]] = None, + **kwargs + ): + super(AzureFileFilterDetails, self).__init__(**kwargs) + self.file_prefix_list = file_prefix_list + self.file_path_list = file_path_list + self.file_share_list = file_share_list + + +class BlobFilterDetails(msrest.serialization.Model): + """Filter details to transfer Azure Blobs. + + :param blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :type blob_prefix_list: list[str] + :param blob_path_list: List of full path of the blobs to be transferred. + :type blob_path_list: list[str] + :param container_list: List of blob containers to be transferred. + :type container_list: list[str] + """ + + _attribute_map = { + 'blob_prefix_list': {'key': 'blobPrefixList', 'type': '[str]'}, + 'blob_path_list': {'key': 'blobPathList', 'type': '[str]'}, + 'container_list': {'key': 'containerList', 'type': '[str]'}, + } + + def __init__( + self, + *, + blob_prefix_list: Optional[List[str]] = None, + blob_path_list: Optional[List[str]] = None, + container_list: Optional[List[str]] = None, + **kwargs + ): + super(BlobFilterDetails, self).__init__(**kwargs) + self.blob_prefix_list = blob_prefix_list + self.blob_path_list = blob_path_list + self.container_list = container_list + + +class CancellationReason(msrest.serialization.Model): """Reason for cancellation. All required parameters must be populated in order to send to Azure. @@ -215,30 +463,36 @@ class CancellationReason(Model): 'reason': {'key': 'reason', 'type': 'str'}, } - def __init__(self, *, reason: str, **kwargs) -> None: + def __init__( + self, + *, + reason: str, + **kwargs + ): super(CancellationReason, self).__init__(**kwargs) self.reason = reason -class CloudError(Model): - """The error information object. +class CloudError(msrest.serialization.Model): + """Cloud error. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: Error code string. - :vartype code: str - :ivar message: Descriptive error information. - :vartype message: str - :param target: Error target + :param code: Cloud error code. + :type code: str + :param message: Cloud error message. + :type message: str + :param target: Cloud error target. :type target: str - :param details: More detailed error information. - :type details: list[~azure.mgmt.databox.models.CloudError] + :ivar details: Cloud error details. + :vartype details: list[~data_box_management_client.models.CloudError] + :ivar additional_info: Cloud error additional info. + :vartype additional_info: list[~data_box_management_client.models.AdditionalErrorInfo] """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { @@ -246,29 +500,26 @@ class CloudError(Model): 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, 'details': {'key': 'details', 'type': '[CloudError]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[AdditionalErrorInfo]'}, } - def __init__(self, *, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + **kwargs + ): super(CloudError, self).__init__(**kwargs) - self.code = None - self.message = None + self.code = code + self.message = message self.target = target - self.details = details - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): + self.details = None + self.additional_info = None - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - -class ContactDetails(Model): +class ContactDetails(msrest.serialization.Model): """Contact Details. All required parameters must be populated in order to send to Azure. @@ -281,12 +532,10 @@ class ContactDetails(Model): :type phone_extension: str :param mobile: Mobile number of the contact person. :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job - progress. + :param email_list: Required. List of Email-ids to be notified about job progress. :type email_list: list[str] :param notification_preference: Notification preference for a job stage. - :type notification_preference: - list[~azure.mgmt.databox.models.NotificationPreference] + :type notification_preference: list[~data_box_management_client.models.NotificationPreference] """ _validation = { @@ -304,7 +553,17 @@ class ContactDetails(Model): 'notification_preference': {'key': 'notificationPreference', 'type': '[NotificationPreference]'}, } - def __init__(self, *, contact_name: str, phone: str, email_list, phone_extension: str=None, mobile: str=None, notification_preference=None, **kwargs) -> None: + def __init__( + self, + *, + contact_name: str, + phone: str, + email_list: List[str], + phone_extension: Optional[str] = None, + mobile: Optional[str] = None, + notification_preference: Optional[List["NotificationPreference"]] = None, + **kwargs + ): super(ContactDetails, self).__init__(**kwargs) self.contact_name = contact_name self.phone = phone @@ -314,17 +573,17 @@ def __init__(self, *, contact_name: str, phone: str, email_list, phone_extension self.notification_preference = notification_preference -class CopyLogDetails(Model): +class CopyLogDetails(msrest.serialization.Model): """Details for log generated during copy. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, - DataBoxHeavyAccountCopyLogDetails + sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator """ _validation = { @@ -339,54 +598,64 @@ class CopyLogDetails(Model): 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = None + self.copy_log_details_type = None # type: Optional[str] -class CopyProgress(Model): +class CopyProgress(msrest.serialization.Model): """Copy progress. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar storage_account_name: Name of the storage account where the data - needs to be uploaded. + :ivar storage_account_name: Name of the storage account. This will be empty for data account + types other than storage account. :vartype storage_account_name: str - :ivar data_destination_type: Data Destination Type. Possible values - include: 'StorageAccount', 'ManagedDisk' - :vartype data_destination_type: str or - ~azure.mgmt.databox.models.DataDestinationType + :ivar transfer_type: Transfer type of data. Possible values include: "ImportToAzure", + "ExportFromAzure". + :vartype transfer_type: str or ~data_box_management_client.models.TransferType + :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", + "ManagedDisk". + :vartype data_account_type: str or ~data_box_management_client.models.DataAccountType :ivar account_id: Id of the account where the data needs to be uploaded. :vartype account_id: str - :ivar bytes_sent_to_cloud: Amount of data uploaded by the job as of now. - :vartype bytes_sent_to_cloud: long - :ivar total_bytes_to_process: Total amount of data to be processed by the - job. + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: long + :ivar total_bytes_to_process: Total amount of data to be processed by the job. :vartype total_bytes_to_process: long - :ivar files_processed: Number of files processed by the job as of now. + :ivar files_processed: Number of files processed. :vartype files_processed: long - :ivar total_files_to_process: Total number of files to be processed by the - job. + :ivar total_files_to_process: Total files to process. :vartype total_files_to_process: long - :ivar invalid_files_processed: Number of files not adhering to azure - naming conventions which were processed by automatic renaming + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. :vartype invalid_files_processed: long - :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to - azure naming conventions which were processed by automatic renaming + :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to azure naming + conventions which were processed by automatic renaming. :vartype invalid_file_bytes_uploaded: long - :ivar renamed_container_count: Number of folders not adhering to azure - naming conventions which were processed by automatic renaming + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. :vartype renamed_container_count: long - :ivar files_errored_out: Number of files which could not be copied + :ivar files_errored_out: Number of files which could not be copied. :vartype files_errored_out: long + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: long + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: long + :ivar is_enumeration_in_progress: To indicate if enumeration of data is in progress. + Until this is true, the TotalBytesToProcess may not be valid. + :vartype is_enumeration_in_progress: bool """ _validation = { 'storage_account_name': {'readonly': True}, - 'data_destination_type': {'readonly': True}, + 'transfer_type': {'readonly': True}, + 'data_account_type': {'readonly': True}, 'account_id': {'readonly': True}, - 'bytes_sent_to_cloud': {'readonly': True}, + 'bytes_processed': {'readonly': True}, 'total_bytes_to_process': {'readonly': True}, 'files_processed': {'readonly': True}, 'total_files_to_process': {'readonly': True}, @@ -394,13 +663,17 @@ class CopyProgress(Model): 'invalid_file_bytes_uploaded': {'readonly': True}, 'renamed_container_count': {'readonly': True}, 'files_errored_out': {'readonly': True}, + 'directories_errored_out': {'readonly': True}, + 'invalid_directories_processed': {'readonly': True}, + 'is_enumeration_in_progress': {'readonly': True}, } _attribute_map = { 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'DataDestinationType'}, + 'transfer_type': {'key': 'transferType', 'type': 'str'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, 'account_id': {'key': 'accountId', 'type': 'str'}, - 'bytes_sent_to_cloud': {'key': 'bytesSentToCloud', 'type': 'long'}, + 'bytes_processed': {'key': 'bytesProcessed', 'type': 'long'}, 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, @@ -408,14 +681,21 @@ class CopyProgress(Model): 'invalid_file_bytes_uploaded': {'key': 'invalidFileBytesUploaded', 'type': 'long'}, 'renamed_container_count': {'key': 'renamedContainerCount', 'type': 'long'}, 'files_errored_out': {'key': 'filesErroredOut', 'type': 'long'}, + 'directories_errored_out': {'key': 'directoriesErroredOut', 'type': 'long'}, + 'invalid_directories_processed': {'key': 'invalidDirectoriesProcessed', 'type': 'long'}, + 'is_enumeration_in_progress': {'key': 'isEnumerationInProgress', 'type': 'bool'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CopyProgress, self).__init__(**kwargs) self.storage_account_name = None - self.data_destination_type = None + self.transfer_type = None + self.data_account_type = None self.account_id = None - self.bytes_sent_to_cloud = None + self.bytes_processed = None self.total_bytes_to_process = None self.files_processed = None self.total_files_to_process = None @@ -423,42 +703,51 @@ def __init__(self, **kwargs) -> None: self.invalid_file_bytes_uploaded = None self.renamed_container_count = None self.files_errored_out = None + self.directories_errored_out = None + self.invalid_directories_processed = None + self.is_enumeration_in_progress = None -class ValidationRequest(Model): - """Input request for all pre job creation validation. +class ValidationRequest(msrest.serialization.Model): + """Minimum request requirement of any validation category. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CreateJobValidations + sub-classes are: CreateJobValidations. All required parameters must be populated in order to send to Azure. - :param individual_request_details: Required. List of request details - contain validationType and its request as key and value respectively. - :type individual_request_details: - list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Constant filled by server. + :param validation_category: Required. Identify the nature of validation.Constant filled by + server. :type validation_category: str + :param individual_request_details: Required. List of request details contain validationType and + its request as key and value respectively. + :type individual_request_details: + list[~data_box_management_client.models.ValidationInputRequest] """ _validation = { - 'individual_request_details': {'required': True}, 'validation_category': {'required': True}, + 'individual_request_details': {'required': True}, } _attribute_map = { - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, 'validation_category': {'key': 'validationCategory', 'type': 'str'}, + 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, } _subtype_map = { 'validation_category': {'JobCreationValidation': 'CreateJobValidations'} } - def __init__(self, *, individual_request_details, **kwargs) -> None: + def __init__( + self, + *, + individual_request_details: List["ValidationInputRequest"], + **kwargs + ): super(ValidationRequest, self).__init__(**kwargs) + self.validation_category = None # type: Optional[str] self.individual_request_details = individual_request_details - self.validation_category = None class CreateJobValidations(ValidationRequest): @@ -466,42 +755,48 @@ class CreateJobValidations(ValidationRequest): All required parameters must be populated in order to send to Azure. - :param individual_request_details: Required. List of request details - contain validationType and its request as key and value respectively. - :type individual_request_details: - list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Constant filled by server. + :param validation_category: Required. Identify the nature of validation.Constant filled by + server. :type validation_category: str + :param individual_request_details: Required. List of request details contain validationType and + its request as key and value respectively. + :type individual_request_details: + list[~data_box_management_client.models.ValidationInputRequest] """ _validation = { - 'individual_request_details': {'required': True}, 'validation_category': {'required': True}, + 'individual_request_details': {'required': True}, } _attribute_map = { - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, 'validation_category': {'key': 'validationCategory', 'type': 'str'}, + 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, } - def __init__(self, *, individual_request_details, **kwargs) -> None: + def __init__( + self, + *, + individual_request_details: List["ValidationInputRequest"], + **kwargs + ): super(CreateJobValidations, self).__init__(individual_request_details=individual_request_details, **kwargs) - self.validation_category = 'JobCreationValidation' + self.validation_category = 'JobCreationValidation' # type: str -class ValidationInputRequest(Model): +class ValidationInputRequest(msrest.serialization.Model): """Minimum fields that must be present in any type of validation request. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CreateOrderLimitForSubscriptionValidationRequest, - DataDestinationDetailsValidationRequest, PreferencesValidationRequest, - SkuAvailabilityValidationRequest, - SubscriptionIsAllowedToCreateJobValidationRequest, ValidateAddress + sub-classes are: ValidateAddress, CreateOrderLimitForSubscriptionValidationRequest, DataTransferDetailsValidationRequest, PreferencesValidationRequest, SkuAvailabilityValidationRequest, SubscriptionIsAllowedToCreateJobValidationRequest. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator """ _validation = { @@ -513,12 +808,15 @@ class ValidationInputRequest(Model): } _subtype_map = { - 'validation_type': {'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationRequest', 'ValidateDataDestinationDetails': 'DataDestinationDetailsValidationRequest', 'ValidatePreferences': 'PreferencesValidationRequest', 'ValidateSkuAvailability': 'SkuAvailabilityValidationRequest', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationRequest', 'ValidateAddress': 'ValidateAddress'} + 'validation_type': {'ValidateAddress': 'ValidateAddress', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationRequest', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationRequest', 'ValidatePreferences': 'PreferencesValidationRequest', 'ValidateSkuAvailability': 'SkuAvailabilityValidationRequest', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationRequest'} } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ValidationInputRequest, self).__init__(**kwargs) - self.validation_type = None + self.validation_type = None # type: Optional[str] class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): @@ -526,11 +824,14 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName """ _validation = { @@ -540,138 +841,158 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, } - def __init__(self, *, device_type, **kwargs) -> None: + def __init__( + self, + *, + device_type: Union[str, "SkuName"], + **kwargs + ): super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidateCreateOrderLimit' # type: str self.device_type = device_type - self.validation_type = 'ValidateCreateOrderLimit' -class ValidationInputResponse(Model): - """Minimum properties that should be present in each individual validation - response. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: - CreateOrderLimitForSubscriptionValidationResponseProperties, - DataDestinationDetailsValidationResponseProperties, - PreferencesValidationResponseProperties, - SkuAvailabilityValidationResponseProperties, - SubscriptionIsAllowedToCreateJobValidationResponseProperties +class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): + """Properties of create order limit for subscription validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Create order limit validation status. Possible values include: "Valid", + "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - _subtype_map = { - 'validation_type': {'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataDestinationDetails': 'DataDestinationDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} - } - - def __init__(self, **kwargs) -> None: - super(ValidationInputResponse, self).__init__(**kwargs) - self.error = None - self.validation_type = None + def __init__( + self, + **kwargs + ): + super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateCreateOrderLimit' # type: str + self.status = None -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. +class DataAccountDetails(msrest.serialization.Model): + """Account details of the data to be transferred. - Variables are only populated by the server, and will be ignored when - sending a request. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ManagedDiskDetails, StorageAccountDetails. All required parameters must be populated in order to send to Azure. - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Create order limit validation status. Possible values - include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :param data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :type share_password: str """ _validation = { - 'error': {'readonly': True}, - 'validation_type': {'required': True}, - 'status': {'readonly': True}, + 'data_account_type': {'required': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: - super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) - self.status = None - self.validation_type = 'ValidateCreateOrderLimit' + _subtype_map = { + 'data_account_type': {'ManagedDisk': 'ManagedDiskDetails', 'StorageAccount': 'StorageAccountDetails'} + } + + def __init__( + self, + *, + share_password: Optional[str] = None, + **kwargs + ): + super(DataAccountDetails, self).__init__(**kwargs) + self.data_account_type = None # type: Optional[str] + self.share_password = share_password class DataBoxAccountCopyLogDetails(CopyLogDetails): """Copy log details for a storage account of a DataBox job. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str - :ivar account_name: Destination account name. + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. :vartype copy_log_link: str + :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when + LogCollectionLevel is set to Verbose. + :vartype copy_verbose_log_link: str """ _validation = { 'copy_log_details_type': {'required': True}, 'account_name': {'readonly': True}, 'copy_log_link': {'readonly': True}, + 'copy_verbose_log_link': {'readonly': True}, } _attribute_map = { 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, 'account_name': {'key': 'accountName', 'type': 'str'}, 'copy_log_link': {'key': 'copyLogLink', 'type': 'str'}, + 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBox' # type: str self.account_name = None self.copy_log_link = None - self.copy_log_details_type = 'DataBox' + self.copy_verbose_log_link = None class DataBoxDiskCopyLogDetails(CopyLogDetails): """Copy Log Details for a disk. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator :ivar disk_serial_number: Disk Serial Number. :vartype disk_serial_number: str :ivar error_log_link: Link for copy error logs. @@ -694,32 +1015,32 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): 'verbose_log_link': {'key': 'verboseLogLink', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBoxDisk' # type: str self.disk_serial_number = None self.error_log_link = None self.verbose_log_link = None - self.copy_log_details_type = 'DataBoxDisk' -class DataBoxDiskCopyProgress(Model): +class DataBoxDiskCopyProgress(msrest.serialization.Model): """DataBox Disk Copy Progress. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar serial_number: The serial number of the disk + :ivar serial_number: The serial number of the disk. :vartype serial_number: str :ivar bytes_copied: Bytes copied during the copy of disk. :vartype bytes_copied: long - :ivar percent_complete: Indicates the percentage completed for the copy of - the disk. + :ivar percent_complete: Indicates the percentage completed for the copy of the disk. :vartype percent_complete: int - :ivar status: The Status of the copy. Possible values include: - 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', - 'NotReturned', 'HardwareError', 'DeviceFormatted', - 'DeviceMetadataModified', 'StorageAccountNotAccessible', 'UnsupportedData' - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", + "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", + "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". + :vartype status: str or ~data_box_management_client.models.CopyStatus """ _validation = { @@ -733,10 +1054,13 @@ class DataBoxDiskCopyProgress(Model): 'serial_number': {'key': 'serialNumber', 'type': 'str'}, 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'CopyStatus'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DataBoxDiskCopyProgress, self).__init__(**kwargs) self.serial_number = None self.bytes_copied = None @@ -744,153 +1068,154 @@ def __init__(self, **kwargs) -> None: self.status = None -class JobDetails(Model): +class JobDetails(msrest.serialization.Model): """Job details. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxDiskJobDetails, DataBoxHeavyJobDetails, - DataBoxJobDetails + sub-classes are: DataBoxJobDetails, DataBoxDiskJobDetails, DataBoxHeavyJobDetails. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str + :param key_encryption_key: Details about which key encryption type is being used. + :type key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int """ _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, } _subtype_map = { - 'job_details_type': {'DataBoxDisk': 'DataBoxDiskJobDetails', 'DataBoxHeavy': 'DataBoxHeavyJobDetails', 'DataBox': 'DataBoxJobDetails'} - } - - def __init__(self, *, contact_details, shipping_address, destination_account_details, expected_data_size_in_terabytes: int=None, preferences=None, **kwargs) -> None: + 'job_details_type': {'DataBox': 'DataBoxJobDetails', 'DataBoxDisk': 'DataBoxDiskJobDetails', 'DataBoxHeavy': 'DataBoxHeavyJobDetails'} + } + + def __init__( + self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_terabytes: Optional[int] = None, + **kwargs + ): super(JobDetails, self).__init__(**kwargs) - self.expected_data_size_in_terabytes = expected_data_size_in_terabytes self.job_stages = None self.contact_details = contact_details self.shipping_address = shipping_address self.delivery_package = None self.return_package = None - self.destination_account_details = destination_account_details - self.error_details = None + self.data_import_details = data_import_details + self.data_export_details = data_export_details + self.job_details_type = None # type: Optional[str] self.preferences = preferences self.copy_log_details = None self.reverse_shipment_label_sas_key = None self.chain_of_custody_sas_key = None - self.job_details_type = None + self.key_encryption_key = key_encryption_key + self.expected_data_size_in_terabytes = expected_data_size_in_terabytes class DataBoxDiskJobDetails(JobDetails): """DataBox Disk Job Details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str - :param preferred_disks: User preference on what size disks are needed for - the job. The map is from the disk size in TB to the count. Eg. {2,5} means - 5 disks of 2 TB size. Key is string but will be checked against an int. + :param key_encryption_key: Details about which key encryption type is being used. + :type key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int + :param preferred_disks: User preference on what size disks are needed for the job. The map is + from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but + will be checked against an int. :type preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: - list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to - the disk size being used for the job. Is returned only after the disks are - shipped to the customer. + :vartype copy_progress: list[~data_box_management_client.models.DataBoxDiskCopyProgress] + :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being + used for the job. Is returned only after the disks are shipped to the customer. :vartype disks_and_size_details: dict[str, int] :param passkey: User entered passkey for DataBox Disk job. :type passkey: str @@ -899,100 +1224,120 @@ class DataBoxDiskJobDetails(JobDetails): _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, 'copy_progress': {'readonly': True}, 'disks_and_size_details': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, 'passkey': {'key': 'passkey', 'type': 'str'}, } - def __init__(self, *, contact_details, shipping_address, destination_account_details, expected_data_size_in_terabytes: int=None, preferences=None, preferred_disks=None, passkey: str=None, **kwargs) -> None: - super(DataBoxDiskJobDetails, self).__init__(expected_data_size_in_terabytes=expected_data_size_in_terabytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) + def __init__( + self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_terabytes: Optional[int] = None, + preferred_disks: Optional[Dict[str, int]] = None, + passkey: Optional[str] = None, + **kwargs + ): + super(DataBoxDiskJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) + self.job_details_type = 'DataBoxDisk' # type: str self.preferred_disks = preferred_disks self.copy_progress = None self.disks_and_size_details = None self.passkey = passkey - self.job_details_type = 'DataBoxDisk' -class JobSecrets(Model): +class JobSecrets(msrest.serialization.Model): """The base class for the secrets. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets, - DataboxJobSecrets + sub-classes are: DataboxJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError """ _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, } _subtype_map = { - 'job_secrets_type': {'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets', 'DataBox': 'DataboxJobSecrets'} + 'job_secrets_type': {'DataBox': 'DataboxJobSecrets', 'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets'} } - def __init__(self, *, dc_access_security_code=None, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(JobSecrets, self).__init__(**kwargs) - self.dc_access_security_code = dc_access_security_code - self.job_secrets_type = None + self.job_secrets_type = None # type: Optional[str] + self.dc_access_security_code = None + self.error = None class DataBoxDiskJobSecrets(JobSecrets): """The secrets related to disk job. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] + :vartype disk_secrets: list[~data_box_management_client.models.DiskSecret] :ivar pass_key: PassKey for the disk Job. :vartype pass_key: str :ivar is_passkey_user_defined: Whether passkey was provided by user. @@ -1001,190 +1346,220 @@ class DataBoxDiskJobSecrets(JobSecrets): _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, 'disk_secrets': {'readonly': True}, 'pass_key': {'readonly': True}, 'is_passkey_user_defined': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, 'disk_secrets': {'key': 'diskSecrets', 'type': '[DiskSecret]'}, 'pass_key': {'key': 'passKey', 'type': 'str'}, 'is_passkey_user_defined': {'key': 'isPasskeyUserDefined', 'type': 'bool'}, } - def __init__(self, *, dc_access_security_code=None, **kwargs) -> None: - super(DataBoxDiskJobSecrets, self).__init__(dc_access_security_code=dc_access_security_code, **kwargs) + def __init__( + self, + **kwargs + ): + super(DataBoxDiskJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBoxDisk' # type: str self.disk_secrets = None self.pass_key = None self.is_passkey_user_defined = None - self.job_secrets_type = 'DataBoxDisk' class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): """Copy log details for a storage account for Databox heavy. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str - :ivar account_name: Destination account name. + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. :vartype copy_log_link: list[str] + :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when the + LogCollectionLevel is set to verbose. + :vartype copy_verbose_log_link: list[str] """ _validation = { 'copy_log_details_type': {'required': True}, 'account_name': {'readonly': True}, 'copy_log_link': {'readonly': True}, + 'copy_verbose_log_link': {'readonly': True}, } _attribute_map = { 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, 'account_name': {'key': 'accountName', 'type': 'str'}, 'copy_log_link': {'key': 'copyLogLink', 'type': '[str]'}, + 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': '[str]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBoxHeavy' # type: str self.account_name = None self.copy_log_link = None - self.copy_log_details_type = 'DataBoxHeavy' + self.copy_verbose_log_link = None class DataBoxHeavyJobDetails(JobDetails): """Databox Heavy Device Job Details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str + :param key_encryption_key: Details about which key encryption type is being used. + :type key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy + :vartype copy_progress: list[~data_box_management_client.models.CopyProgress] + :param device_password: Set Device password for unlocking Databox Heavy. Should not be passed + for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. :type device_password: str """ _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, 'copy_progress': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } - def __init__(self, *, contact_details, shipping_address, destination_account_details, expected_data_size_in_terabytes: int=None, preferences=None, device_password: str=None, **kwargs) -> None: - super(DataBoxHeavyJobDetails, self).__init__(expected_data_size_in_terabytes=expected_data_size_in_terabytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) + def __init__( + self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_terabytes: Optional[int] = None, + device_password: Optional[str] = None, + **kwargs + ): + super(DataBoxHeavyJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) + self.job_details_type = 'DataBoxHeavy' # type: str self.copy_progress = None self.device_password = device_password - self.job_details_type = 'DataBoxHeavy' class DataBoxHeavyJobSecrets(JobSecrets): """The secrets related to a databox heavy job. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str - :ivar cabinet_pod_secrets: Contains the list of secret objects for a - databox heavy job. - :vartype cabinet_pod_secrets: - list[~azure.mgmt.databox.models.DataBoxHeavySecret] + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError + :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. + :vartype cabinet_pod_secrets: list[~data_box_management_client.models.DataBoxHeavySecret] """ _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, 'cabinet_pod_secrets': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, 'cabinet_pod_secrets': {'key': 'cabinetPodSecrets', 'type': '[DataBoxHeavySecret]'}, } - def __init__(self, *, dc_access_security_code=None, **kwargs) -> None: - super(DataBoxHeavyJobSecrets, self).__init__(dc_access_security_code=dc_access_security_code, **kwargs) + def __init__( + self, + **kwargs + ): + super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBoxHeavy' # type: str self.cabinet_pod_secrets = None - self.job_secrets_type = 'DataBoxHeavy' -class DataBoxHeavySecret(Model): +class DataBoxHeavySecret(msrest.serialization.Model): """The secrets related to a databox heavy. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar device_serial_number: Serial number of the assigned device. :vartype device_serial_number: str @@ -1192,13 +1567,13 @@ class DataBoxHeavySecret(Model): :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. :vartype network_configurations: - list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to - authenticate with the device + list[~data_box_management_client.models.ApplianceNetworkConfiguration] + :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the + device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. :vartype account_credential_details: - list[~azure.mgmt.databox.models.AccountCredentialDetails] + list[~data_box_management_client.models.AccountCredentialDetails] """ _validation = { @@ -1217,7 +1592,10 @@ class DataBoxHeavySecret(Model): 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DataBoxHeavySecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1229,135 +1607,159 @@ def __init__(self, **kwargs) -> None: class DataBoxJobDetails(JobDetails): """Databox Job Details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str + :param key_encryption_key: Details about which key encryption type is being used. + :type key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox + :vartype copy_progress: list[~data_box_management_client.models.CopyProgress] + :param device_password: Set Device password for unlocking Databox. Should not be passed for + TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password + itself. This will not be returned in Get Call. Password Requirements : Password must be + minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, + one number and one special character. Password cannot have the following characters : IilLoO0 + Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. :type device_password: str """ _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, 'copy_progress': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } - def __init__(self, *, contact_details, shipping_address, destination_account_details, expected_data_size_in_terabytes: int=None, preferences=None, device_password: str=None, **kwargs) -> None: - super(DataBoxJobDetails, self).__init__(expected_data_size_in_terabytes=expected_data_size_in_terabytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) + def __init__( + self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_terabytes: Optional[int] = None, + device_password: Optional[str] = None, + **kwargs + ): + super(DataBoxJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) + self.job_details_type = 'DataBox' # type: str self.copy_progress = None self.device_password = device_password - self.job_details_type = 'DataBox' class DataboxJobSecrets(JobSecrets): """The secrets related to a databox job. + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :type pod_secrets: list[~data_box_management_client.models.DataBoxSecret] """ _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, 'pod_secrets': {'key': 'podSecrets', 'type': '[DataBoxSecret]'}, } - def __init__(self, *, dc_access_security_code=None, pod_secrets=None, **kwargs) -> None: - super(DataboxJobSecrets, self).__init__(dc_access_security_code=dc_access_security_code, **kwargs) + def __init__( + self, + *, + pod_secrets: Optional[List["DataBoxSecret"]] = None, + **kwargs + ): + super(DataboxJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBox' # type: str self.pod_secrets = pod_secrets - self.job_secrets_type = 'DataBox' -class ScheduleAvailabilityRequest(Model): +class ScheduleAvailabilityRequest(msrest.serialization.Model): """Request body to get the availability for scheduling orders. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxScheduleAvailabilityRequest, - DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest + sub-classes are: DataBoxScheduleAvailabilityRequest, DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest. All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str """ _validation = { @@ -1368,16 +1770,24 @@ class ScheduleAvailabilityRequest(Model): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, } _subtype_map = { 'sku_name': {'DataBox': 'DataBoxScheduleAvailabilityRequest', 'DataBoxDisk': 'DiskScheduleAvailabilityRequest', 'DataBoxHeavy': 'HeavyScheduleAvailabilityRequest'} } - def __init__(self, *, storage_location: str, **kwargs) -> None: + def __init__( + self, + *, + storage_location: str, + country: Optional[str] = None, + **kwargs + ): super(ScheduleAvailabilityRequest, self).__init__(**kwargs) self.storage_location = storage_location - self.sku_name = None + self.sku_name = None # type: Optional[str] + self.country = country class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -1385,12 +1795,14 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str """ _validation = { @@ -1401,18 +1813,24 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, } - def __init__(self, *, storage_location: str, **kwargs) -> None: - super(DataBoxScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, **kwargs) - self.sku_name = 'DataBox' + def __init__( + self, + *, + storage_location: str, + country: Optional[str] = None, + **kwargs + ): + super(DataBoxScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) + self.sku_name = 'DataBox' # type: str -class DataBoxSecret(Model): +class DataBoxSecret(msrest.serialization.Model): """The secrets related to a DataBox. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar device_serial_number: Serial number of the assigned device. :vartype device_serial_number: str @@ -1420,13 +1838,13 @@ class DataBoxSecret(Model): :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. :vartype network_configurations: - list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to - authenticate with the device + list[~data_box_management_client.models.ApplianceNetworkConfiguration] + :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the + device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. :vartype account_credential_details: - list[~azure.mgmt.databox.models.AccountCredentialDetails] + list[~data_box_management_client.models.AccountCredentialDetails] """ _validation = { @@ -1445,7 +1863,10 @@ class DataBoxSecret(Model): 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DataBoxSecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1454,235 +1875,252 @@ def __init__(self, **kwargs) -> None: self.account_credential_details = None -class DataDestinationDetailsValidationRequest(ValidationInputRequest): - """Request to validate data destination details. +class DataExportDetails(msrest.serialization.Model): + """Details of the data to be used for exporting data from azure. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param destination_account_details: Required. Destination account details - list. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :param location: Required. Location of stamp or geo. - :type location: str + :param transfer_configuration: Required. Configuration for the data transfer. + :type transfer_configuration: ~data_box_management_client.models.TransferConfiguration + :param log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". + :type log_collection_level: str or ~data_box_management_client.models.LogCollectionLevel + :param account_details: Required. Account details of the data to be transferred. + :type account_details: ~data_box_management_client.models.DataAccountDetails """ _validation = { - 'validation_type': {'required': True}, - 'destination_account_details': {'required': True}, - 'location': {'required': True}, + 'transfer_configuration': {'required': True}, + 'account_details': {'required': True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, + 'transfer_configuration': {'key': 'transferConfiguration', 'type': 'TransferConfiguration'}, + 'log_collection_level': {'key': 'logCollectionLevel', 'type': 'str'}, + 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, } - def __init__(self, *, destination_account_details, location: str, **kwargs) -> None: - super(DataDestinationDetailsValidationRequest, self).__init__(**kwargs) - self.destination_account_details = destination_account_details - self.location = location - self.validation_type = 'ValidateDataDestinationDetails' - + def __init__( + self, + *, + transfer_configuration: "TransferConfiguration", + account_details: "DataAccountDetails", + log_collection_level: Optional[Union[str, "LogCollectionLevel"]] = None, + **kwargs + ): + super(DataExportDetails, self).__init__(**kwargs) + self.transfer_configuration = transfer_configuration + self.log_collection_level = log_collection_level + self.account_details = account_details -class DataDestinationDetailsValidationResponseProperties(ValidationInputResponse): - """Properties of data destination details validation response. - Variables are only populated by the server, and will be ignored when - sending a request. +class DataImportDetails(msrest.serialization.Model): + """Details of the data to be used for importing data to azure. All required parameters must be populated in order to send to Azure. - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Data destination details validation status. Possible values - include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :param account_details: Required. Account details of the data to be transferred. + :type account_details: ~data_box_management_client.models.DataAccountDetails """ _validation = { - 'error': {'readonly': True}, - 'validation_type': {'required': True}, - 'status': {'readonly': True}, + 'account_details': {'required': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, } - def __init__(self, **kwargs) -> None: - super(DataDestinationDetailsValidationResponseProperties, self).__init__(**kwargs) - self.status = None - self.validation_type = 'ValidateDataDestinationDetails' + def __init__( + self, + *, + account_details: "DataAccountDetails", + **kwargs + ): + super(DataImportDetails, self).__init__(**kwargs) + self.account_details = account_details -class DcAccessSecurityCode(Model): - """Dc Access Security code for device. +class DataLocationToServiceLocationMap(msrest.serialization.Model): + """Map of data location to service location. - :param forward_dc_access_code: Dc Access Code for dispatching from DC. - :type forward_dc_access_code: str - :param reverse_dc_access_code: Dc Access code for dropping off at DC. - :type reverse_dc_access_code: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar data_location: Location of the data. + :vartype data_location: str + :ivar service_location: Location of the service. + :vartype service_location: str """ - _attribute_map = { - 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, - 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, + _validation = { + 'data_location': {'readonly': True}, + 'service_location': {'readonly': True}, } - def __init__(self, *, forward_dc_access_code: str=None, reverse_dc_access_code: str=None, **kwargs) -> None: - super(DcAccessSecurityCode, self).__init__(**kwargs) - self.forward_dc_access_code = forward_dc_access_code - self.reverse_dc_access_code = reverse_dc_access_code + _attribute_map = { + 'data_location': {'key': 'dataLocation', 'type': 'str'}, + 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + } + def __init__( + self, + **kwargs + ): + super(DataLocationToServiceLocationMap, self).__init__(**kwargs) + self.data_location = None + self.service_location = None -class DestinationAccountDetails(Model): - """Details of the destination storage accounts. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DestinationManagedDiskDetails, - DestinationStorageAccountDetails +class DataTransferDetailsValidationRequest(ValidationInputRequest): + """Request to validate export and import data details. All required parameters must be populated in order to send to Azure. - :param account_id: Arm Id of the destination where the data has to be - moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param data_destination_type: Required. Constant filled by server. - :type data_destination_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param data_export_details: List of DataTransfer details to be used to export data from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param data_import_details: List of DataTransfer details to be used to import data to azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName + :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType """ _validation = { - 'data_destination_type': {'required': True}, + 'validation_type': {'required': True}, + 'device_type': {'required': True}, + 'transfer_type': {'required': True}, } _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'transfer_type': {'key': 'transferType', 'type': 'str'}, } - _subtype_map = { - 'data_destination_type': {'ManagedDisk': 'DestinationManagedDiskDetails', 'StorageAccount': 'DestinationStorageAccountDetails'} - } + def __init__( + self, + *, + device_type: Union[str, "SkuName"], + transfer_type: Union[str, "TransferType"], + data_export_details: Optional[List["DataExportDetails"]] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + **kwargs + ): + super(DataTransferDetailsValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidateDataTransferDetails' # type: str + self.data_export_details = data_export_details + self.data_import_details = data_import_details + self.device_type = device_type + self.transfer_type = transfer_type - def __init__(self, *, account_id: str=None, share_password: str=None, **kwargs) -> None: - super(DestinationAccountDetails, self).__init__(**kwargs) - self.account_id = account_id - self.share_password = share_password - self.data_destination_type = None +class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): + """Properties of data transfer details validation response. -class DestinationManagedDiskDetails(DestinationAccountDetails): - """Details for the destination compute disks. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param account_id: Arm Id of the destination where the data has to be - moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param data_destination_type: Required. Constant filled by server. - :type data_destination_type: str - :param resource_group_id: Required. Destination Resource Group Id where - the Compute disks should be created. - :type resource_group_id: str - :param staging_storage_account_id: Required. Arm Id of the storage account - that can be used to copy the vhd for staging. - :type staging_storage_account_id: str + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Data transfer details validation status. Possible values include: "Valid", + "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'data_destination_type': {'required': True}, - 'resource_group_id': {'required': True}, - 'staging_storage_account_id': {'required': True}, + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, - 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, *, resource_group_id: str, staging_storage_account_id: str, account_id: str=None, share_password: str=None, **kwargs) -> None: - super(DestinationManagedDiskDetails, self).__init__(account_id=account_id, share_password=share_password, **kwargs) - self.resource_group_id = resource_group_id - self.staging_storage_account_id = staging_storage_account_id - self.data_destination_type = 'ManagedDisk' - + def __init__( + self, + **kwargs + ): + super(DataTransferDetailsValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateDataTransferDetails' # type: str + self.status = None -class DestinationStorageAccountDetails(DestinationAccountDetails): - """Details for the destination storage account. - All required parameters must be populated in order to send to Azure. +class DcAccessSecurityCode(msrest.serialization.Model): + """Dc access security code. - :param account_id: Arm Id of the destination where the data has to be - moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param data_destination_type: Required. Constant filled by server. - :type data_destination_type: str - :param storage_account_id: Required. Destination Storage Account Arm Id. - :type storage_account_id: str + :param reverse_dc_access_code: Reverse Dc access security code. + :type reverse_dc_access_code: str + :param forward_dc_access_code: Forward Dc access security code. + :type forward_dc_access_code: str """ - _validation = { - 'data_destination_type': {'required': True}, - 'storage_account_id': {'required': True}, - } - _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, + 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, } - def __init__(self, *, storage_account_id: str, account_id: str=None, share_password: str=None, **kwargs) -> None: - super(DestinationStorageAccountDetails, self).__init__(account_id=account_id, share_password=share_password, **kwargs) - self.storage_account_id = storage_account_id - self.data_destination_type = 'StorageAccount' + def __init__( + self, + *, + reverse_dc_access_code: Optional[str] = None, + forward_dc_access_code: Optional[str] = None, + **kwargs + ): + super(DcAccessSecurityCode, self).__init__(**kwargs) + self.reverse_dc_access_code = reverse_dc_access_code + self.forward_dc_access_code = forward_dc_access_code -class DestinationToServiceLocationMap(Model): - """Map of destination location to service location. +class Details(msrest.serialization.Model): + """Details. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :ivar destination_location: Location of the destination. - :vartype destination_location: str - :ivar service_location: Location of the service. - :vartype service_location: str + :param code: Required. + :type code: str + :param message: Required. + :type message: str """ _validation = { - 'destination_location': {'readonly': True}, - 'service_location': {'readonly': True}, + 'code': {'required': True}, + 'message': {'required': True}, } _attribute_map = { - 'destination_location': {'key': 'destinationLocation', 'type': 'str'}, - 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: - super(DestinationToServiceLocationMap, self).__init__(**kwargs) - self.destination_location = None - self.service_location = None + def __init__( + self, + *, + code: str, + message: str, + **kwargs + ): + super(Details, self).__init__(**kwargs) + self.code = code + self.message = message class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -1690,14 +2128,16 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str - :param expected_data_size_in_terabytes: Required. The expected size of the - data, which needs to be transferred in this job, in terabytes. + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str + :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to + be transferred in this job, in terabytes. :type expected_data_size_in_terabytes: int """ @@ -1710,25 +2150,32 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, } - def __init__(self, *, storage_location: str, expected_data_size_in_terabytes: int, **kwargs) -> None: - super(DiskScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, **kwargs) + def __init__( + self, + *, + storage_location: str, + expected_data_size_in_terabytes: int, + country: Optional[str] = None, + **kwargs + ): + super(DiskScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) + self.sku_name = 'DataBoxDisk' # type: str self.expected_data_size_in_terabytes = expected_data_size_in_terabytes - self.sku_name = 'DataBoxDisk' -class DiskSecret(Model): +class DiskSecret(msrest.serialization.Model): """Contains all the secrets of a Disk. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar disk_serial_number: Serial number of the assigned disk. :vartype disk_serial_number: str - :ivar bit_locker_key: Bit Locker key of the disk which can be used to - unlock the disk to copy data. + :ivar bit_locker_key: Bit Locker key of the disk which can be used to unlock the disk to copy + data. :vartype bit_locker_key: str """ @@ -1742,40 +2189,113 @@ class DiskSecret(Model): 'bit_locker_key': {'key': 'bitLockerKey', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DiskSecret, self).__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None -class Error(Model): - """Top level error for the job. +class EncryptionPreferences(msrest.serialization.Model): + """Preferences related to the Encryption. + + :param double_encryption: Defines secondary layer of software-based encryption enablement. + Possible values include: "Enabled", "Disabled". + :type double_encryption: str or ~data_box_management_client.models.DoubleEncryption + """ + + _attribute_map = { + 'double_encryption': {'key': 'doubleEncryption', 'type': 'str'}, + } - Variables are only populated by the server, and will be ignored when - sending a request. + def __init__( + self, + *, + double_encryption: Optional[Union[str, "DoubleEncryption"]] = None, + **kwargs + ): + super(EncryptionPreferences, self).__init__(**kwargs) + self.double_encryption = double_encryption - :ivar code: Error code that can be used to programmatically identify the - error. - :vartype code: str - :ivar message: Describes the error in detail and provides debugging - information. - :vartype message: str + +class ErrorDetail(msrest.serialization.Model): + """ErrorDetail. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. + :type code: str + :param message: Required. + :type message: str + :param details: + :type details: list[~data_box_management_client.models.Details] + :param target: + :type target: str """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, + 'code': {'required': True}, + 'message': {'required': True}, } _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[Details]'}, + 'target': {'key': 'target', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: - super(Error, self).__init__(**kwargs) - self.code = None - self.message = None + def __init__( + self, + *, + code: str, + message: str, + details: Optional[List["Details"]] = None, + target: Optional[str] = None, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + self.target = target + + +class FilterFileDetails(msrest.serialization.Model): + """Details of the filter files to be used for data transfer. + + All required parameters must be populated in order to send to Azure. + + :param filter_file_type: Required. Type of the filter file. Possible values include: + "AzureBlob", "AzureFile". + :type filter_file_type: str or ~data_box_management_client.models.FilterFileType + :param filter_file_path: Required. Path of the file that contains the details of all items to + transfer. + :type filter_file_path: str + """ + + _validation = { + 'filter_file_type': {'required': True}, + 'filter_file_path': {'required': True}, + } + + _attribute_map = { + 'filter_file_type': {'key': 'filterFileType', 'type': 'str'}, + 'filter_file_path': {'key': 'filterFilePath', 'type': 'str'}, + } + + def __init__( + self, + *, + filter_file_type: Union[str, "FilterFileType"], + filter_file_path: str, + **kwargs + ): + super(FilterFileDetails, self).__init__(**kwargs) + self.filter_file_type = filter_file_type + self.filter_file_path = filter_file_path class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -1783,12 +2303,14 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str """ _validation = { @@ -1799,84 +2321,84 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, } - def __init__(self, *, storage_location: str, **kwargs) -> None: - super(HeavyScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, **kwargs) - self.sku_name = 'DataBoxHeavy' + def __init__( + self, + *, + storage_location: str, + country: Optional[str] = None, + **kwargs + ): + super(HeavyScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) + self.sku_name = 'DataBoxHeavy' # type: str -class JobDeliveryInfo(Model): - """Additional delivery info. +class IdentityProperties(msrest.serialization.Model): + """Managed identity properties. - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: datetime + :param type: Managed service identity type. + :type type: str + :param user_assigned: User assigned identity properties. + :type user_assigned: ~data_box_management_client.models.UserAssignedProperties """ _attribute_map = { - 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned': {'key': 'userAssigned', 'type': 'UserAssignedProperties'}, } - def __init__(self, *, scheduled_date_time=None, **kwargs) -> None: - super(JobDeliveryInfo, self).__init__(**kwargs) - self.scheduled_date_time = scheduled_date_time - + def __init__( + self, + *, + type: Optional[str] = None, + user_assigned: Optional["UserAssignedProperties"] = None, + **kwargs + ): + super(IdentityProperties, self).__init__(**kwargs) + self.type = type + self.user_assigned = user_assigned -class JobErrorDetails(Model): - """Job Error Details for providing the information and recommended action. - Variables are only populated by the server, and will be ignored when - sending a request. +class JobDeliveryInfo(msrest.serialization.Model): + """Additional delivery info. - :ivar error_message: Message for the error. - :vartype error_message: str - :ivar error_code: Code for the error. - :vartype error_code: int - :ivar recommended_action: Recommended action for the error. - :vartype recommended_action: str - :ivar exception_message: Contains the non localized exception message - :vartype exception_message: str + :param scheduled_date_time: Scheduled date time. + :type scheduled_date_time: ~datetime.datetime """ - _validation = { - 'error_message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'recommended_action': {'readonly': True}, - 'exception_message': {'readonly': True}, - } - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'int'}, - 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, - 'exception_message': {'key': 'exceptionMessage', 'type': 'str'}, + 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, } - def __init__(self, **kwargs) -> None: - super(JobErrorDetails, self).__init__(**kwargs) - self.error_message = None - self.error_code = None - self.recommended_action = None - self.exception_message = None + def __init__( + self, + *, + scheduled_date_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(JobDeliveryInfo, self).__init__(**kwargs) + self.scheduled_date_time = scheduled_date_time -class Resource(Model): +class Resource(msrest.serialization.Model): """Model of the Resource. All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one - of the supported and registered Azure Regions (e.g. West US, East US, - Southeast Asia, etc.). The region of a resource cannot be changed once it - is created, but if an identical region is specified on update the request - will succeed. + :param location: Required. The location of the resource. This will be one of the supported and + registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. :type location: str - :param tags: The list of key value pairs that describe the resource. These - tags can be used in viewing and grouping this resource (across resource - groups). + :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). :type tags: dict[str, str] :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :type sku: ~data_box_management_client.models.Sku + :param identity: Msi identity of the resource. + :type identity: ~data_box_management_client.models.ResourceIdentity """ _validation = { @@ -1888,116 +2410,147 @@ class Resource(Model): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__(self, *, location: str, sku, tags=None, **kwargs) -> None: + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + } + + def __init__( + self, + *, + location: str, + sku: "Sku", + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.location = location self.tags = tags self.sku = sku + self.identity = identity class JobResource(Resource): """Job Resource. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one - of the supported and registered Azure Regions (e.g. West US, East US, - Southeast Asia, etc.). The region of a resource cannot be changed once it - is created, but if an identical region is specified on update the request - will succeed. + :param location: Required. The location of the resource. This will be one of the supported and + registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. :type location: str - :param tags: The list of key value pairs that describe the resource. These - tags can be used in viewing and grouping this resource (across resource - groups). + :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). :type tags: dict[str, str] :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :type sku: ~data_box_management_client.models.Sku + :param identity: Msi identity of the resource. + :type identity: ~data_box_management_client.models.ResourceIdentity + :ivar name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param transfer_type: Required. Type of the data transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType :ivar is_cancellable: Describes whether the job is cancellable or not. :vartype is_cancellable: bool :ivar is_deletable: Describes whether the job is deletable or not. :vartype is_deletable: bool - :ivar is_shipping_address_editable: Describes whether the shipping address - is editable or not. + :ivar is_shipping_address_editable: Describes whether the shipping address is editable or not. :vartype is_shipping_address_editable: bool - :ivar status: Name of the stage which is in progress. Possible values - include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', - 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', - 'Cancelled', 'Failed_IssueReportedAtCustomer', - 'Failed_IssueDetectedAtAzureDC', 'Aborted', 'CompletedWithWarnings', - 'ReadyToDispatchFromAzureDC', 'ReadyToReceiveAtAzureDC' - :vartype status: str or ~azure.mgmt.databox.models.StageName - :ivar start_time: Time at which the job was started in UTC ISO 8601 - format. - :vartype start_time: datetime + :ivar is_prepare_to_ship_enabled: Is Prepare To Ship Enabled on this job. + :vartype is_prepare_to_ship_enabled: bool + :ivar status: Name of the stage which is in progress. Possible values include: "DeviceOrdered", + "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". + :vartype status: str or ~data_box_management_client.models.StageName + :ivar start_time: Time at which the job was started in UTC ISO 8601 format. + :vartype start_time: ~datetime.datetime :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.Error - :param details: Details of a job run. This field will only be sent for - expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~data_box_management_client.models.CloudError + :param details: Details of a job run. This field will only be sent for expand details filter. + :type details: ~data_box_management_client.models.JobDetails :ivar cancellation_reason: Reason for cancellation. :vartype cancellation_reason: str - :param delivery_type: Delivery type of Job. Possible values include: - 'NonScheduled', 'Scheduled' - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType + :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". + :type delivery_type: str or ~data_box_management_client.models.JobDeliveryType :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of - scheduled job. + :type delivery_info: ~data_box_management_client.models.JobDeliveryInfo + :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. :vartype is_cancellable_without_fee: bool - :ivar name: Name of the object. - :vartype name: str - :ivar id: Id of the object. - :vartype id: str - :ivar type: Type of the object. - :vartype type: str """ _validation = { 'location': {'required': True}, 'sku': {'required': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'transfer_type': {'required': True}, 'is_cancellable': {'readonly': True}, 'is_deletable': {'readonly': True}, 'is_shipping_address_editable': {'readonly': True}, + 'is_prepare_to_ship_enabled': {'readonly': True}, 'status': {'readonly': True}, 'start_time': {'readonly': True}, 'error': {'readonly': True}, 'cancellation_reason': {'readonly': True}, 'is_cancellable_without_fee': {'readonly': True}, - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, } _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'transfer_type': {'key': 'properties.transferType', 'type': 'str'}, 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'bool'}, 'is_deletable': {'key': 'properties.isDeletable', 'type': 'bool'}, 'is_shipping_address_editable': {'key': 'properties.isShippingAddressEditable', 'type': 'bool'}, - 'status': {'key': 'properties.status', 'type': 'StageName'}, + 'is_prepare_to_ship_enabled': {'key': 'properties.isPrepareToShipEnabled', 'type': 'bool'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'error': {'key': 'properties.error', 'type': 'Error'}, + 'error': {'key': 'properties.error', 'type': 'CloudError'}, 'details': {'key': 'properties.details', 'type': 'JobDetails'}, 'cancellation_reason': {'key': 'properties.cancellationReason', 'type': 'str'}, - 'delivery_type': {'key': 'properties.deliveryType', 'type': 'JobDeliveryType'}, + 'delivery_type': {'key': 'properties.deliveryType', 'type': 'str'}, 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'JobDeliveryInfo'}, 'is_cancellable_without_fee': {'key': 'properties.isCancellableWithoutFee', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, location: str, sku, tags=None, details=None, delivery_type=None, delivery_info=None, **kwargs) -> None: - super(JobResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + def __init__( + self, + *, + location: str, + sku: "Sku", + transfer_type: Union[str, "TransferType"], + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + details: Optional["JobDetails"] = None, + delivery_type: Optional[Union[str, "JobDeliveryType"]] = None, + delivery_info: Optional["JobDeliveryInfo"] = None, + **kwargs + ): + super(JobResource, self).__init__(location=location, tags=tags, sku=sku, identity=identity, **kwargs) + self.name = None + self.id = None + self.type = None + self.transfer_type = transfer_type self.is_cancellable = None self.is_deletable = None self.is_shipping_address_editable = None + self.is_prepare_to_ship_enabled = None self.status = None self.start_time = None self.error = None @@ -2006,63 +2559,87 @@ def __init__(self, *, location: str, sku, tags=None, details=None, delivery_type self.delivery_type = delivery_type self.delivery_info = delivery_info self.is_cancellable_without_fee = None - self.name = None - self.id = None - self.type = None -class JobResourceUpdateParameter(Model): +class JobResourceList(msrest.serialization.Model): + """Job Resource Collection. + + :param value: List of job resources. + :type value: list[~data_box_management_client.models.JobResource] + :param next_link: Link for the next set of job resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["JobResource"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(JobResourceList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class JobResourceUpdateParameter(msrest.serialization.Model): """The JobResourceUpdateParameter. - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - :param destination_account_details: Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :param tags: The list of key value pairs that describe the resource. These - tags can be used in viewing and grouping this resource (across resource - groups). + :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). :type tags: dict[str, str] + :param identity: Msi identity of the resource. + :type identity: ~data_box_management_client.models.ResourceIdentity + :param details: Details of a job to be updated. + :type details: ~data_box_management_client.models.UpdateJobDetails """ _attribute_map = { - 'details': {'key': 'properties.details', 'type': 'UpdateJobDetails'}, - 'destination_account_details': {'key': 'properties.destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'details': {'key': 'properties.details', 'type': 'UpdateJobDetails'}, } - def __init__(self, *, details=None, destination_account_details=None, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + details: Optional["UpdateJobDetails"] = None, + **kwargs + ): super(JobResourceUpdateParameter, self).__init__(**kwargs) - self.details = details - self.destination_account_details = destination_account_details self.tags = tags + self.identity = identity + self.details = details -class JobStages(Model): +class JobStages(msrest.serialization.Model): """Job stages. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar stage_name: Name of the job stage. Possible values include: - 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', - 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', - 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', - 'Aborted', 'CompletedWithWarnings', 'ReadyToDispatchFromAzureDC', - 'ReadyToReceiveAtAzureDC' - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + :ivar stage_name: Name of the job stage. Possible values include: "DeviceOrdered", + "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". + :vartype stage_name: str or ~data_box_management_client.models.StageName :ivar display_name: Display name of the job stage. :vartype display_name: str - :ivar stage_status: Status of the job stage. Possible values include: - 'None', 'InProgress', 'Succeeded', 'Failed', 'Cancelled', 'Cancelling', - 'SucceededWithErrors' - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", + "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", + "WaitingForCustomerAction", "SucceededWithWarnings". + :vartype stage_status: str or ~data_box_management_client.models.StageStatus :ivar stage_time: Time for the job stage in UTC ISO 8601 format. - :vartype stage_time: datetime - :ivar job_stage_details: Job Stage Details + :vartype stage_time: ~datetime.datetime + :ivar job_stage_details: Job Stage Details. :vartype job_stage_details: object - :ivar error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] """ _validation = { @@ -2071,37 +2648,129 @@ class JobStages(Model): 'stage_status': {'readonly': True}, 'stage_time': {'readonly': True}, 'job_stage_details': {'readonly': True}, - 'error_details': {'readonly': True}, } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'StageName'}, + 'stage_name': {'key': 'stageName', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, - 'stage_status': {'key': 'stageStatus', 'type': 'StageStatus'}, + 'stage_status': {'key': 'stageStatus', 'type': 'str'}, 'stage_time': {'key': 'stageTime', 'type': 'iso-8601'}, 'job_stage_details': {'key': 'jobStageDetails', 'type': 'object'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(JobStages, self).__init__(**kwargs) self.stage_name = None self.display_name = None self.stage_status = None self.stage_time = None self.job_stage_details = None - self.error_details = None -class NotificationPreference(Model): +class KeyEncryptionKey(msrest.serialization.Model): + """Encryption key containing details about key to encrypt different keys. + + All required parameters must be populated in order to send to Azure. + + :param kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". + :type kek_type: str or ~data_box_management_client.models.KekType + :param identity_properties: Managed identity properties used for key encryption. + :type identity_properties: ~data_box_management_client.models.IdentityProperties + :param kek_url: Key encryption key. It is required in case of Customer managed KekType. + :type kek_url: str + :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + KekType. + :type kek_vault_resource_id: str + """ + + _validation = { + 'kek_type': {'required': True}, + } + + _attribute_map = { + 'kek_type': {'key': 'kekType', 'type': 'str'}, + 'identity_properties': {'key': 'identityProperties', 'type': 'IdentityProperties'}, + 'kek_url': {'key': 'kekUrl', 'type': 'str'}, + 'kek_vault_resource_id': {'key': 'kekVaultResourceID', 'type': 'str'}, + } + + def __init__( + self, + *, + kek_type: Union[str, "KekType"], + identity_properties: Optional["IdentityProperties"] = None, + kek_url: Optional[str] = None, + kek_vault_resource_id: Optional[str] = None, + **kwargs + ): + super(KeyEncryptionKey, self).__init__(**kwargs) + self.kek_type = kek_type + self.identity_properties = identity_properties + self.kek_url = kek_url + self.kek_vault_resource_id = kek_vault_resource_id + + +class ManagedDiskDetails(DataAccountDetails): + """Details of the managed disks. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :type share_password: str + :param resource_group_id: Required. Resource Group Id of the compute disks. + :type resource_group_id: str + :param staging_storage_account_id: Required. Resource Id of the storage account that can be + used to copy the vhd for staging. + :type staging_storage_account_id: str + """ + + _validation = { + 'data_account_type': {'required': True}, + 'resource_group_id': {'required': True}, + 'staging_storage_account_id': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, + 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, + 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_group_id: str, + staging_storage_account_id: str, + share_password: Optional[str] = None, + **kwargs + ): + super(ManagedDiskDetails, self).__init__(share_password=share_password, **kwargs) + self.data_account_type = 'ManagedDisk' # type: str + self.resource_group_id = resource_group_id + self.staging_storage_account_id = staging_storage_account_id + + +class NotificationPreference(msrest.serialization.Model): """Notification preference for a job stage. All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: - 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', - 'DataCopy' - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName + :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". + :type stage_name: str or ~data_box_management_client.models.NotificationStageName :param send_notification: Required. Notification is required or not. :type send_notification: bool """ @@ -2112,31 +2781,38 @@ class NotificationPreference(Model): } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'NotificationStageName'}, + 'stage_name': {'key': 'stageName', 'type': 'str'}, 'send_notification': {'key': 'sendNotification', 'type': 'bool'}, } - def __init__(self, *, stage_name, send_notification: bool, **kwargs) -> None: + def __init__( + self, + *, + stage_name: Union[str, "NotificationStageName"], + send_notification: bool, + **kwargs + ): super(NotificationPreference, self).__init__(**kwargs) self.stage_name = stage_name self.send_notification = send_notification -class Operation(Model): +class Operation(msrest.serialization.Model): """Operation entity. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the operation. Format: - {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} + {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~data_box_management_client.models.OperationDisplay :ivar properties: Operation properties. :vartype properties: object - :ivar origin: Origin of the operation. Can be : user|system|user,system + :ivar origin: Origin of the operation. Can be : user|system|user,system. :vartype origin: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool """ _validation = { @@ -2151,17 +2827,24 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'properties': {'key': 'properties', 'type': 'object'}, 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + *, + is_data_action: Optional[bool] = None, + **kwargs + ): super(Operation, self).__init__(**kwargs) self.name = None self.display = None self.properties = None self.origin = None + self.is_data_action = is_data_action -class OperationDisplay(Model): +class OperationDisplay(msrest.serialization.Model): """Operation display. :param provider: Provider name. @@ -2170,8 +2853,7 @@ class OperationDisplay(Model): :type resource: str :param operation: Localized name of the operation for display purpose. :type operation: str - :param description: Localized description of the operation for display - purpose. + :param description: Localized description of the operation for display purpose. :type description: str """ @@ -2182,7 +2864,15 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): super(OperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -2190,11 +2880,41 @@ def __init__(self, *, provider: str=None, resource: str=None, operation: str=Non self.description = description -class PackageShippingDetails(Model): +class OperationList(msrest.serialization.Model): + """Operation Collection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations. + :vartype value: list[~data_box_management_client.models.Operation] + :param next_link: Link for the next set of operations. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class PackageShippingDetails(msrest.serialization.Model): """Shipping details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar carrier_name: Name of the carrier. :vartype carrier_name: str @@ -2216,33 +2936,45 @@ class PackageShippingDetails(Model): 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(PackageShippingDetails, self).__init__(**kwargs) self.carrier_name = None self.tracking_id = None self.tracking_url = None -class Preferences(Model): +class Preferences(msrest.serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: Preferred Data Center Region. + :param preferred_data_center_region: Preferred data center region. :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment - logistics of the sku. - :type transport_preferences: - ~azure.mgmt.databox.models.TransportPreferences + :param transport_preferences: Preferences related to the shipment logistics of the sku. + :type transport_preferences: ~data_box_management_client.models.TransportPreferences + :param encryption_preferences: Preferences related to the Encryption. + :type encryption_preferences: ~data_box_management_client.models.EncryptionPreferences """ _attribute_map = { 'preferred_data_center_region': {'key': 'preferredDataCenterRegion', 'type': '[str]'}, 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, + 'encryption_preferences': {'key': 'encryptionPreferences', 'type': 'EncryptionPreferences'}, } - def __init__(self, *, preferred_data_center_region=None, transport_preferences=None, **kwargs) -> None: + def __init__( + self, + *, + preferred_data_center_region: Optional[List[str]] = None, + transport_preferences: Optional["TransportPreferences"] = None, + encryption_preferences: Optional["EncryptionPreferences"] = None, + **kwargs + ): super(Preferences, self).__init__(**kwargs) self.preferred_data_center_region = preferred_data_center_region self.transport_preferences = transport_preferences + self.encryption_preferences = encryption_preferences class PreferencesValidationRequest(ValidationInputRequest): @@ -2250,14 +2982,16 @@ class PreferencesValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param preference: Preference requested with respect to transport type and - data center - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param preference: Preference of transport and data center. + :type preference: ~data_box_management_client.models.Preferences + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName """ _validation = { @@ -2268,62 +3002,73 @@ class PreferencesValidationRequest(ValidationInputRequest): _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, 'preference': {'key': 'preference', 'type': 'Preferences'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, } - def __init__(self, *, device_type, preference=None, **kwargs) -> None: + def __init__( + self, + *, + device_type: Union[str, "SkuName"], + preference: Optional["Preferences"] = None, + **kwargs + ): super(PreferencesValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidatePreferences' # type: str self.preference = preference self.device_type = device_type - self.validation_type = 'ValidatePreferences' class PreferencesValidationResponseProperties(ValidationInputResponse): """Properties of data center and transport preference validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Validation status of requested data center and transport. - Possible values include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Validation status of requested data center and transport. Possible values + include: "Valid", "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(PreferencesValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidatePreferences' # type: str self.status = None - self.validation_type = 'ValidatePreferences' -class RegionConfigurationRequest(Model): +class RegionConfigurationRequest(msrest.serialization.Model): """Request body to get the configuration for the region. - :param schedule_availability_request: Request body to get the availability - for scheduling orders. + :param schedule_availability_request: Request body to get the availability for scheduling + orders. :type schedule_availability_request: - ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport - availability for given sku. + ~data_box_management_client.models.ScheduleAvailabilityRequest + :param transport_availability_request: Request body to get the transport availability for given + sku. :type transport_availability_request: - ~azure.mgmt.databox.models.TransportAvailabilityRequest + ~data_box_management_client.models.TransportAvailabilityRequest """ _attribute_map = { @@ -2331,26 +3076,29 @@ class RegionConfigurationRequest(Model): 'transport_availability_request': {'key': 'transportAvailabilityRequest', 'type': 'TransportAvailabilityRequest'}, } - def __init__(self, *, schedule_availability_request=None, transport_availability_request=None, **kwargs) -> None: + def __init__( + self, + *, + schedule_availability_request: Optional["ScheduleAvailabilityRequest"] = None, + transport_availability_request: Optional["TransportAvailabilityRequest"] = None, + **kwargs + ): super(RegionConfigurationRequest, self).__init__(**kwargs) self.schedule_availability_request = schedule_availability_request self.transport_availability_request = transport_availability_request -class RegionConfigurationResponse(Model): +class RegionConfigurationResponse(msrest.serialization.Model): """Configuration response specific to a region. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar schedule_availability_response: Schedule availability for given sku - in a region. + :ivar schedule_availability_response: Schedule availability for given sku in a region. :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for - given sku in a region. + ~data_box_management_client.models.ScheduleAvailabilityResponse + :ivar transport_availability_response: Transport options available for given sku in a region. :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse + ~data_box_management_client.models.TransportAvailabilityResponse """ _validation = { @@ -2363,20 +3111,64 @@ class RegionConfigurationResponse(Model): 'transport_availability_response': {'key': 'transportAvailabilityResponse', 'type': 'TransportAvailabilityResponse'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(RegionConfigurationResponse, self).__init__(**kwargs) self.schedule_availability_response = None self.transport_availability_response = None -class ScheduleAvailabilityResponse(Model): - """Schedule availability response for given sku in a region. +class ResourceIdentity(msrest.serialization.Model): + """Msi identity details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Identity type. + :type type: str + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + :param user_assigned_identities: User Assigned Identities. + :type user_assigned_identities: dict[str, + ~data_box_management_client.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.type = type + self.principal_id = None + self.tenant_id = None + self.user_assigned_identities = user_assigned_identities + - Variables are only populated by the server, and will be ignored when - sending a request. +class ScheduleAvailabilityResponse(msrest.serialization.Model): + """Schedule availability for given sku in a region. - :ivar available_dates: List of dates available to schedule - :vartype available_dates: list[datetime] + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar available_dates: List of dates available to schedule. + :vartype available_dates: list[~datetime.datetime] """ _validation = { @@ -2387,31 +3179,31 @@ class ScheduleAvailabilityResponse(Model): 'available_dates': {'key': 'availableDates', 'type': '[iso-8601]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ScheduleAvailabilityResponse, self).__init__(**kwargs) self.available_dates = None -class ShareCredentialDetails(Model): +class ShareCredentialDetails(msrest.serialization.Model): """Credential details of the shares in account. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar share_name: Name of the share. :vartype share_name: str - :ivar share_type: Type of the share. Possible values include: - 'UnknownType', 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile', 'ManagedDisk' - :vartype share_type: str or - ~azure.mgmt.databox.models.ShareDestinationFormatType + :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", + "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk", "AzurePremiumFiles". + :vartype share_type: str or ~data_box_management_client.models.ShareDestinationFormatType :ivar user_name: User name for the share. :vartype user_name: str :ivar password: Password for the share. :vartype password: str - :ivar supported_access_protocols: Access protocols supported on the - device. + :ivar supported_access_protocols: Access protocols supported on the device. :vartype supported_access_protocols: list[str or - ~azure.mgmt.databox.models.AccessProtocol] + ~data_box_management_client.models.AccessProtocol] """ _validation = { @@ -2424,13 +3216,16 @@ class ShareCredentialDetails(Model): _attribute_map = { 'share_name': {'key': 'shareName', 'type': 'str'}, - 'share_type': {'key': 'shareType', 'type': 'ShareDestinationFormatType'}, + 'share_type': {'key': 'shareType', 'type': 'str'}, 'user_name': {'key': 'userName', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, - 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[AccessProtocol]'}, + 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[str]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ShareCredentialDetails, self).__init__(**kwargs) self.share_name = None self.share_type = None @@ -2439,19 +3234,18 @@ def __init__(self, **kwargs) -> None: self.supported_access_protocols = None -class ShipmentPickUpRequest(Model): +class ShipmentPickUpRequest(msrest.serialization.Model): """Shipment pick up request details. All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should - commence, this must be in local time of pick up area. - :type start_time: datetime - :param end_time: Required. Maximum date before which the pick up should - commence, this must be in local time of pick up area. - :type end_time: datetime - :param shipment_location: Required. Shipment Location in the pickup place. - Eg.front desk + :param start_time: Required. Minimum date after which the pick up should commence, this must be + in local time of pick up area. + :type start_time: ~datetime.datetime + :param end_time: Required. Maximum date before which the pick up should commence, this must be + in local time of pick up area. + :type end_time: ~datetime.datetime + :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. :type shipment_location: str """ @@ -2467,24 +3261,30 @@ class ShipmentPickUpRequest(Model): 'shipment_location': {'key': 'shipmentLocation', 'type': 'str'}, } - def __init__(self, *, start_time, end_time, shipment_location: str, **kwargs) -> None: + def __init__( + self, + *, + start_time: datetime.datetime, + end_time: datetime.datetime, + shipment_location: str, + **kwargs + ): super(ShipmentPickUpRequest, self).__init__(**kwargs) self.start_time = start_time self.end_time = end_time self.shipment_location = shipment_location -class ShipmentPickUpResponse(Model): +class ShipmentPickUpResponse(msrest.serialization.Model): """Shipment pick up response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar confirmation_number: Confirmation number for the pick up request. :vartype confirmation_number: str - :ivar ready_by_time: Time by which shipment should be ready for pick up, - this is in local time of pick up area. - :vartype ready_by_time: datetime + :ivar ready_by_time: Time by which shipment should be ready for pick up, this is in local time + of pick up area. + :vartype ready_by_time: ~datetime.datetime """ _validation = { @@ -2497,13 +3297,16 @@ class ShipmentPickUpResponse(Model): 'ready_by_time': {'key': 'readyByTime', 'type': 'iso-8601'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ShipmentPickUpResponse, self).__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None -class ShippingAddress(Model): +class ShippingAddress(msrest.serialization.Model): """Shipping address where customer wishes to receive the device. All required parameters must be populated in order to send to Azure. @@ -2520,21 +3323,20 @@ class ShippingAddress(Model): :type state_or_province: str :param country: Required. Name of the Country. :type country: str - :param postal_code: Required. Postal code. + :param postal_code: Postal code. :type postal_code: str :param zip_extended_code: Extended Zip Code. :type zip_extended_code: str :param company_name: Name of the company. :type company_name: str - :param address_type: Type of address. Possible values include: 'None', - 'Residential', 'Commercial' - :type address_type: str or ~azure.mgmt.databox.models.AddressType + :param address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". + :type address_type: str or ~data_box_management_client.models.AddressType """ _validation = { 'street_address1': {'required': True}, 'country': {'required': True}, - 'postal_code': {'required': True}, } _attribute_map = { @@ -2547,10 +3349,24 @@ class ShippingAddress(Model): 'postal_code': {'key': 'postalCode', 'type': 'str'}, 'zip_extended_code': {'key': 'zipExtendedCode', 'type': 'str'}, 'company_name': {'key': 'companyName', 'type': 'str'}, - 'address_type': {'key': 'addressType', 'type': 'AddressType'}, - } - - def __init__(self, *, street_address1: str, country: str, postal_code: str, street_address2: str=None, street_address3: str=None, city: str=None, state_or_province: str=None, zip_extended_code: str=None, company_name: str=None, address_type=None, **kwargs) -> None: + 'address_type': {'key': 'addressType', 'type': 'str'}, + } + + def __init__( + self, + *, + street_address1: str, + country: str, + street_address2: Optional[str] = None, + street_address3: Optional[str] = None, + city: Optional[str] = None, + state_or_province: Optional[str] = None, + postal_code: Optional[str] = None, + zip_extended_code: Optional[str] = None, + company_name: Optional[str] = None, + address_type: Optional[Union[str, "AddressType"]] = None, + **kwargs + ): super(ShippingAddress, self).__init__(**kwargs) self.street_address1 = street_address1 self.street_address2 = street_address2 @@ -2564,14 +3380,14 @@ def __init__(self, *, street_address1: str, country: str, postal_code: str, stre self.address_type = address_type -class Sku(Model): +class Sku(msrest.serialization.Model): """The Sku. All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: 'DataBox', - 'DataBoxDisk', 'DataBoxHeavy' - :type name: str or ~azure.mgmt.databox.models.SkuName + :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :type name: str or ~data_box_management_client.models.SkuName :param display_name: The display name of the sku. :type display_name: str :param family: The sku family. @@ -2583,12 +3399,19 @@ class Sku(Model): } _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, + 'name': {'key': 'name', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'family': {'key': 'family', 'type': 'str'}, } - def __init__(self, *, name, display_name: str=None, family: str=None, **kwargs) -> None: + def __init__( + self, + *, + name: Union[str, "SkuName"], + display_name: Optional[str] = None, + family: Optional[str] = None, + **kwargs + ): super(Sku, self).__init__(**kwargs) self.name = name self.display_name = display_name @@ -2598,95 +3421,104 @@ def __init__(self, *, name, display_name: str=None, family: str=None, **kwargs) class SkuAvailabilityValidationRequest(ValidationInputRequest): """Request to validate sku availability. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :ivar transfer_type: Required. Type of the transfer. Default value: - "ImportToAzure" . - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. - For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName + :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType + :param country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. :type country: str - :param location: Required. Location for data transfer. For locations - check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type location: str """ _validation = { 'validation_type': {'required': True}, 'device_type': {'required': True}, - 'transfer_type': {'required': True, 'constant': True}, + 'transfer_type': {'required': True}, 'country': {'required': True}, 'location': {'required': True}, } _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, 'transfer_type': {'key': 'transferType', 'type': 'str'}, 'country': {'key': 'country', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, } - transfer_type = "ImportToAzure" - - def __init__(self, *, device_type, country: str, location: str, **kwargs) -> None: + def __init__( + self, + *, + device_type: Union[str, "SkuName"], + transfer_type: Union[str, "TransferType"], + country: str, + location: str, + **kwargs + ): super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidateSkuAvailability' # type: str self.device_type = device_type + self.transfer_type = transfer_type self.country = country self.location = location - self.validation_type = 'ValidateSkuAvailability' class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): """Properties of sku availability validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Sku availability validation status. Possible values include: - 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", + "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateSkuAvailability' # type: str self.status = None - self.validation_type = 'ValidateSkuAvailability' -class SkuCapacity(Model): +class SkuCapacity(msrest.serialization.Model): """Capacity of the sku. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar usable: Usable capacity in TB. :vartype usable: str @@ -2704,65 +3536,73 @@ class SkuCapacity(Model): 'maximum': {'key': 'maximum', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SkuCapacity, self).__init__(**kwargs) self.usable = None self.maximum = None -class SkuCost(Model): +class SkuCost(msrest.serialization.Model): """Describes metadata for retrieving price info. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar meter_id: Meter id of the Sku. :vartype meter_id: str :ivar meter_type: The type of the meter. :vartype meter_type: str + :ivar multiplier: Multiplier specifies the region specific value to be multiplied with 1$ guid. + Eg: Our new regions will be using 1$ shipping guid with appropriate multiplier specific to + region. + :vartype multiplier: float """ _validation = { 'meter_id': {'readonly': True}, 'meter_type': {'readonly': True}, + 'multiplier': {'readonly': True}, } _attribute_map = { 'meter_id': {'key': 'meterId', 'type': 'str'}, 'meter_type': {'key': 'meterType', 'type': 'str'}, + 'multiplier': {'key': 'multiplier', 'type': 'float'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SkuCost, self).__init__(**kwargs) self.meter_id = None self.meter_type = None + self.multiplier = None -class SkuInformation(Model): +class SkuInformation(msrest.serialization.Model): """Information of the sku. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :vartype sku: ~data_box_management_client.models.Sku :ivar enabled: The sku is enabled or not. :vartype enabled: bool - :ivar destination_to_service_location_map: The map of destination location - to service location. - :vartype destination_to_service_location_map: - list[~azure.mgmt.databox.models.DestinationToServiceLocationMap] + :ivar data_location_to_service_location_map: The map of data location to service location. + :vartype data_location_to_service_location_map: + list[~data_box_management_client.models.DataLocationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~data_box_management_client.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :vartype costs: list[~data_box_management_client.models.SkuCost] :ivar api_versions: Api versions that support this Sku. :vartype api_versions: list[str] - :ivar disabled_reason: Reason why the Sku is disabled. Possible values - include: 'None', 'Country', 'Region', 'Feature', 'OfferType', - 'NoSubscriptionInfo' - :vartype disabled_reason: str or - ~azure.mgmt.databox.models.SkuDisabledReason + :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", + "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". + :vartype disabled_reason: str or ~data_box_management_client.models.SkuDisabledReason :ivar disabled_reason_message: Message for why the Sku is disabled. :vartype disabled_reason_message: str :ivar required_feature: Required feature to access the sku. @@ -2772,7 +3612,7 @@ class SkuInformation(Model): _validation = { 'sku': {'readonly': True}, 'enabled': {'readonly': True}, - 'destination_to_service_location_map': {'readonly': True}, + 'data_location_to_service_location_map': {'readonly': True}, 'capacity': {'readonly': True}, 'costs': {'readonly': True}, 'api_versions': {'readonly': True}, @@ -2784,20 +3624,23 @@ class SkuInformation(Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'destination_to_service_location_map': {'key': 'properties.destinationToServiceLocationMap', 'type': '[DestinationToServiceLocationMap]'}, + 'data_location_to_service_location_map': {'key': 'properties.dataLocationToServiceLocationMap', 'type': '[DataLocationToServiceLocationMap]'}, 'capacity': {'key': 'properties.capacity', 'type': 'SkuCapacity'}, 'costs': {'key': 'properties.costs', 'type': '[SkuCost]'}, 'api_versions': {'key': 'properties.apiVersions', 'type': '[str]'}, - 'disabled_reason': {'key': 'properties.disabledReason', 'type': 'SkuDisabledReason'}, + 'disabled_reason': {'key': 'properties.disabledReason', 'type': 'str'}, 'disabled_reason_message': {'key': 'properties.disabledReasonMessage', 'type': 'str'}, 'required_feature': {'key': 'properties.requiredFeature', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SkuInformation, self).__init__(**kwargs) self.sku = None self.enabled = None - self.destination_to_service_location_map = None + self.data_location_to_service_location_map = None self.capacity = None self.costs = None self.api_versions = None @@ -2806,13 +3649,58 @@ def __init__(self, **kwargs) -> None: self.required_feature = None +class StorageAccountDetails(DataAccountDetails): + """Details for the storage account. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :type share_password: str + :param storage_account_id: Required. Storage Account Resource Id. + :type storage_account_id: str + """ + + _validation = { + 'data_account_type': {'required': True}, + 'storage_account_id': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_id: str, + share_password: Optional[str] = None, + **kwargs + ): + super(StorageAccountDetails, self).__init__(share_password=share_password, **kwargs) + self.data_account_type = 'StorageAccount' # type: str + self.storage_account_id = storage_account_id + + class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): """Request to validate subscription permission to create jobs. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator """ _validation = { @@ -2823,56 +3711,228 @@ class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): 'validation_type': {'key': 'validationType', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' + self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): """Properties of subscription permission to create job validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Validation status of subscription permission to create job. - Possible values include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Validation status of subscription permission to create job. Possible values + include: "Valid", "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str self.status = None - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' -class TransportAvailabilityDetails(Model): +class TransferAllDetails(msrest.serialization.Model): + """Details to transfer all data. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :type transfer_all_blobs: bool + :param transfer_all_files: To indicate if all Azure Files have to be transferred. + :type transfer_all_files: bool + """ + + _validation = { + 'data_account_type': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'transfer_all_blobs': {'key': 'transferAllBlobs', 'type': 'bool'}, + 'transfer_all_files': {'key': 'transferAllFiles', 'type': 'bool'}, + } + + def __init__( + self, + *, + data_account_type: Union[str, "DataAccountType"], + transfer_all_blobs: Optional[bool] = None, + transfer_all_files: Optional[bool] = None, + **kwargs + ): + super(TransferAllDetails, self).__init__(**kwargs) + self.data_account_type = data_account_type + self.transfer_all_blobs = transfer_all_blobs + self.transfer_all_files = transfer_all_files + + +class TransferConfiguration(msrest.serialization.Model): + """Configuration for defining the transfer of data. + + All required parameters must be populated in order to send to Azure. + + :param transfer_configuration_type: Required. Type of the configuration for transfer. Possible + values include: "TransferAll", "TransferUsingFilter". + :type transfer_configuration_type: str or + ~data_box_management_client.models.TransferConfigurationType + :param transfer_filter_details: Map of filter type and the details to filter. This field is + required only if the TransferConfigurationType is given as TransferUsingFilter. + :type transfer_filter_details: + ~data_box_management_client.models.TransferConfigurationTransferFilterDetails + :param transfer_all_details: Map of filter type and the details to transfer all data. This + field is required only if the TransferConfigurationType is given as TransferAll. + :type transfer_all_details: + ~data_box_management_client.models.TransferConfigurationTransferAllDetails + """ + + _validation = { + 'transfer_configuration_type': {'required': True}, + } + + _attribute_map = { + 'transfer_configuration_type': {'key': 'transferConfigurationType', 'type': 'str'}, + 'transfer_filter_details': {'key': 'transferFilterDetails', 'type': 'TransferConfigurationTransferFilterDetails'}, + 'transfer_all_details': {'key': 'transferAllDetails', 'type': 'TransferConfigurationTransferAllDetails'}, + } + + def __init__( + self, + *, + transfer_configuration_type: Union[str, "TransferConfigurationType"], + transfer_filter_details: Optional["TransferConfigurationTransferFilterDetails"] = None, + transfer_all_details: Optional["TransferConfigurationTransferAllDetails"] = None, + **kwargs + ): + super(TransferConfiguration, self).__init__(**kwargs) + self.transfer_configuration_type = transfer_configuration_type + self.transfer_filter_details = transfer_filter_details + self.transfer_all_details = transfer_all_details + + +class TransferConfigurationTransferAllDetails(msrest.serialization.Model): + """Map of filter type and the details to transfer all data. This field is required only if the TransferConfigurationType is given as TransferAll. + + :param include: Details to transfer all data. + :type include: ~data_box_management_client.models.TransferAllDetails + """ + + _attribute_map = { + 'include': {'key': 'include', 'type': 'TransferAllDetails'}, + } + + def __init__( + self, + *, + include: Optional["TransferAllDetails"] = None, + **kwargs + ): + super(TransferConfigurationTransferAllDetails, self).__init__(**kwargs) + self.include = include + + +class TransferConfigurationTransferFilterDetails(msrest.serialization.Model): + """Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. + + :param include: Details of the filtering the transfer of data. + :type include: ~data_box_management_client.models.TransferFilterDetails + """ + + _attribute_map = { + 'include': {'key': 'include', 'type': 'TransferFilterDetails'}, + } + + def __init__( + self, + *, + include: Optional["TransferFilterDetails"] = None, + **kwargs + ): + super(TransferConfigurationTransferFilterDetails, self).__init__(**kwargs) + self.include = include + + +class TransferFilterDetails(msrest.serialization.Model): + """Details of the filtering the transfer of data. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param blob_filter_details: Filter details to transfer blobs. + :type blob_filter_details: ~data_box_management_client.models.BlobFilterDetails + :param azure_file_filter_details: Filter details to transfer Azure files. + :type azure_file_filter_details: ~data_box_management_client.models.AzureFileFilterDetails + :param filter_file_details: Details of the filter files to be used for data transfer. + :type filter_file_details: list[~data_box_management_client.models.FilterFileDetails] + """ + + _validation = { + 'data_account_type': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'blob_filter_details': {'key': 'blobFilterDetails', 'type': 'BlobFilterDetails'}, + 'azure_file_filter_details': {'key': 'azureFileFilterDetails', 'type': 'AzureFileFilterDetails'}, + 'filter_file_details': {'key': 'filterFileDetails', 'type': '[FilterFileDetails]'}, + } + + def __init__( + self, + *, + data_account_type: Union[str, "DataAccountType"], + blob_filter_details: Optional["BlobFilterDetails"] = None, + azure_file_filter_details: Optional["AzureFileFilterDetails"] = None, + filter_file_details: Optional[List["FilterFileDetails"]] = None, + **kwargs + ): + super(TransferFilterDetails, self).__init__(**kwargs) + self.data_account_type = data_account_type + self.blob_filter_details = blob_filter_details + self.azure_file_filter_details = azure_file_filter_details + self.filter_file_details = filter_file_details + + +class TransportAvailabilityDetails(msrest.serialization.Model): """Transport options availability details for given region. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar shipment_type: Transport Shipment Type supported for given region. - Possible values include: 'CustomerManaged', 'MicrosoftManaged' - :vartype shipment_type: str or - ~azure.mgmt.databox.models.TransportShipmentTypes + :ivar shipment_type: Transport Shipment Type supported for given region. Possible values + include: "CustomerManaged", "MicrosoftManaged". + :vartype shipment_type: str or ~data_box_management_client.models.TransportShipmentTypes """ _validation = { @@ -2880,41 +3940,47 @@ class TransportAvailabilityDetails(Model): } _attribute_map = { - 'shipment_type': {'key': 'shipmentType', 'type': 'TransportShipmentTypes'}, + 'shipment_type': {'key': 'shipmentType', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(TransportAvailabilityDetails, self).__init__(**kwargs) self.shipment_type = None -class TransportAvailabilityRequest(Model): +class TransportAvailabilityRequest(msrest.serialization.Model): """Request body to get the transport availability for given sku. - :param sku_name: Type of the device. Possible values include: 'DataBox', - 'DataBoxDisk', 'DataBoxHeavy' - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName """ _attribute_map = { - 'sku_name': {'key': 'skuName', 'type': 'SkuName'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, } - def __init__(self, *, sku_name=None, **kwargs) -> None: + def __init__( + self, + *, + sku_name: Optional[Union[str, "SkuName"]] = None, + **kwargs + ): super(TransportAvailabilityRequest, self).__init__(**kwargs) self.sku_name = sku_name -class TransportAvailabilityResponse(Model): +class TransportAvailabilityResponse(msrest.serialization.Model): """Transport options available for given sku in a region. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar transport_availability_details: List of transport availability - details for given region + :ivar transport_availability_details: List of transport availability details for given region. :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] + list[~data_box_management_client.models.TransportAvailabilityDetails] """ _validation = { @@ -2925,21 +3991,22 @@ class TransportAvailabilityResponse(Model): 'transport_availability_details': {'key': 'transportAvailabilityDetails', 'type': '[TransportAvailabilityDetails]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(TransportAvailabilityResponse, self).__init__(**kwargs) self.transport_availability_details = None -class TransportPreferences(Model): +class TransportPreferences(msrest.serialization.Model): """Preferences related to the shipment logistics of the sku. All required parameters must be populated in order to send to Azure. - :param preferred_shipment_type: Required. Indicates Shipment Logistics - type that the customer preferred. Possible values include: - 'CustomerManaged', 'MicrosoftManaged' - :type preferred_shipment_type: str or - ~azure.mgmt.databox.models.TransportShipmentTypes + :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". + :type preferred_shipment_type: str or ~data_box_management_client.models.TransportShipmentTypes """ _validation = { @@ -2947,24 +4014,28 @@ class TransportPreferences(Model): } _attribute_map = { - 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'TransportShipmentTypes'}, + 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, } - def __init__(self, *, preferred_shipment_type, **kwargs) -> None: + def __init__( + self, + *, + preferred_shipment_type: Union[str, "TransportShipmentTypes"], + **kwargs + ): super(TransportPreferences, self).__init__(**kwargs) self.preferred_shipment_type = preferred_shipment_type -class UnencryptedCredentials(Model): +class UnencryptedCredentials(msrest.serialization.Model): """Unencrypted credentials for accessing device. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar job_name: Name of the job. :vartype job_name: str :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets + :vartype job_secrets: ~data_box_management_client.models.JobSecrets """ _validation = { @@ -2977,49 +4048,140 @@ class UnencryptedCredentials(Model): 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(UnencryptedCredentials, self).__init__(**kwargs) self.job_name = None self.job_secrets = None -class UpdateJobDetails(Model): +class UnencryptedCredentialsList(msrest.serialization.Model): + """List of unencrypted credentials for accessing device. + + :param value: List of unencrypted credentials. + :type value: list[~data_box_management_client.models.UnencryptedCredentials] + :param next_link: Link for the next set of unencrypted credentials. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UnencryptedCredentials]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["UnencryptedCredentials"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(UnencryptedCredentialsList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class UpdateJobDetails(msrest.serialization.Model): """Job details for update. :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails + :type contact_details: ~data_box_management_client.models.ContactDetails :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :type shipping_address: ~data_box_management_client.models.ShippingAddress + :param key_encryption_key: Key encryption key for the job. + :type key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey """ _attribute_map = { 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, } - def __init__(self, *, contact_details=None, shipping_address=None, **kwargs) -> None: + def __init__( + self, + *, + contact_details: Optional["ContactDetails"] = None, + shipping_address: Optional["ShippingAddress"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + **kwargs + ): super(UpdateJobDetails, self).__init__(**kwargs) self.contact_details = contact_details self.shipping_address = shipping_address + self.key_encryption_key = key_encryption_key + + +class UserAssignedIdentity(msrest.serialization.Model): + """Class defining User assigned identity details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class UserAssignedProperties(msrest.serialization.Model): + """User assigned identity properties. + + :param resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :type resource_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + **kwargs + ): + super(UserAssignedProperties, self).__init__(**kwargs) + self.resource_id = resource_id class ValidateAddress(ValidationInputRequest): - """The requirements to validate customer address where the device needs to be - shipped. + """The requirements to validate customer address where the device needs to be shipped. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment - logistics of the sku. - :type transport_preferences: - ~azure.mgmt.databox.models.TransportPreferences + :type shipping_address: ~data_box_management_client.models.ShippingAddress + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName + :param transport_preferences: Preferences related to the shipment logistics of the sku. + :type transport_preferences: ~data_box_management_client.models.TransportPreferences """ _validation = { @@ -3031,32 +4193,37 @@ class ValidateAddress(ValidationInputRequest): _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, } - def __init__(self, *, shipping_address, device_type, transport_preferences=None, **kwargs) -> None: + def __init__( + self, + *, + shipping_address: "ShippingAddress", + device_type: Union[str, "SkuName"], + transport_preferences: Optional["TransportPreferences"] = None, + **kwargs + ): super(ValidateAddress, self).__init__(**kwargs) + self.validation_type = 'ValidateAddress' # type: str self.shipping_address = shipping_address self.device_type = device_type self.transport_preferences = transport_preferences - self.validation_type = 'ValidateAddress' -class ValidationResponse(Model): +class ValidationResponse(msrest.serialization.Model): """Response of pre job creation validations. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar status: Overall validation status. Possible values include: - 'AllValidToProceed', 'InputsRevisitRequired', - 'CertainInputValidationsSkipped' - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus - :ivar individual_response_details: List of response details contain - validationType and its response as key and value respectively. + :ivar status: Overall validation status. Possible values include: "AllValidToProceed", + "InputsRevisitRequired", "CertainInputValidationsSkipped". + :vartype status: str or ~data_box_management_client.models.OverallValidationStatus + :ivar individual_response_details: List of response details contain validationType and its + response as key and value respectively. :vartype individual_response_details: - list[~azure.mgmt.databox.models.ValidationInputResponse] + list[~data_box_management_client.models.ValidationInputResponse] """ _validation = { @@ -3065,11 +4232,14 @@ class ValidationResponse(Model): } _attribute_map = { - 'status': {'key': 'properties.status', 'type': 'OverallValidationStatus'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'individual_response_details': {'key': 'properties.individualResponseDetails', 'type': '[ValidationInputResponse]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ValidationResponse, self).__init__(**kwargs) self.status = None self.individual_response_details = None diff --git a/src/databox/azext_databox/vendored_sdks/databox/models/_paged_models.py b/src/databox/azext_databox/vendored_sdks/databox/models/_paged_models.py deleted file mode 100644 index 0396852889e..00000000000 --- a/src/databox/azext_databox/vendored_sdks/databox/models/_paged_models.py +++ /dev/null @@ -1,66 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) -class JobResourcePaged(Paged): - """ - A paging container for iterating over a list of :class:`JobResource ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[JobResource]'} - } - - def __init__(self, *args, **kwargs): - - super(JobResourcePaged, self).__init__(*args, **kwargs) -class UnencryptedCredentialsPaged(Paged): - """ - A paging container for iterating over a list of :class:`UnencryptedCredentials ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[UnencryptedCredentials]'} - } - - def __init__(self, *args, **kwargs): - - super(UnencryptedCredentialsPaged, self).__init__(*args, **kwargs) -class SkuInformationPaged(Paged): - """ - A paging container for iterating over a list of :class:`SkuInformation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SkuInformation]'} - } - - def __init__(self, *args, **kwargs): - - super(SkuInformationPaged, self).__init__(*args, **kwargs) diff --git a/src/databox/azext_databox/vendored_sdks/databox/operations/__init__.py b/src/databox/azext_databox/vendored_sdks/databox/operations/__init__.py index 034974abbcc..9c8fa7a8253 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/operations/__init__.py +++ b/src/databox/azext_databox/vendored_sdks/databox/operations/__init__.py @@ -1,12 +1,9 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations diff --git a/src/databox/azext_databox/vendored_sdks/databox/operations/_jobs_operations.py b/src/databox/azext_databox/vendored_sdks/databox/operations/_jobs_operations.py index a923de9b251..82fbcf4eccd 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/operations/_jobs_operations.py +++ b/src/databox/azext_databox/vendored_sdks/databox/operations/_jobs_operations.py @@ -1,758 +1,860 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + 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]] class JobsOperations(object): """JobsOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API Version. Constant value: "2019-09-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-01" - - self.config = config + self._config = config def list( - self, skip_token=None, custom_headers=None, raw=False, **operation_config): + self, + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.JobResourceList"] """Lists all the jobs available under the subscription. - :param skip_token: $skipToken is supported on Get list of jobs, which - provides the next page in the list of jobs. + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. :type skip_token: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of JobResource - :rtype: - ~azure.mgmt.databox.models.JobResourcePaged[~azure.mgmt.databox.models.JobResource] - :raises: :class:`CloudError` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_management_client.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') if skip_token is not None: query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('JobResourceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): request = prepare_request(next_link) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.JobResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore def list_by_resource_group( - self, resource_group_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.JobResourceList"] """Lists all the jobs available under the given resource group. - :param resource_group_name: The Resource Group Name + :param resource_group_name: The Resource Group Name. :type resource_group_name: str - :param skip_token: $skipToken is supported on Get list of jobs, which - provides the next page in the list of jobs. + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. :type skip_token: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of JobResource - :rtype: - ~azure.mgmt.databox.models.JobResourcePaged[~azure.mgmt.databox.models.JobResource] - :raises: :class:`CloudError` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_management_client.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') if skip_token is not None: query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('JobResourceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): request = prepare_request(next_link) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.JobResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore def get( - self, resource_group_name, job_name, expand=None, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + job_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.JobResource" """Gets information about the specified job. - :param resource_group_name: The Resource Group Name + :param resource_group_name: The Resource Group Name. :type resource_group_name: str - :param job_name: The name of the job Resource within the specified - resource group. job names must be between 3 and 24 characters in - length and use any alphanumeric and underscore only + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str - :param expand: $expand is supported on details parameter for job, - which provides details on the job stages. + :param expand: $expand is supported on details parameter for job, which provides details on the + job stages. :type expand: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: JobResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.databox.models.JobResource or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~data_box_management_client.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + # 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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('JobResource', response) + deserialized = self._deserialize('JobResource', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore def _create_initial( - self, resource_group_name, job_name, job_resource, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + job_name, # type: str + job_resource, # type: "models.JobResource" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.JobResource"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.create.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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(job_resource, 'JobResource') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(job_resource, 'JobResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('JobResource', response) + deserialized = self._deserialize('JobResource', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create( - self, resource_group_name, job_name, job_resource, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates a new job with the specified parameters. Existing job cannot be - updated with this API and should instead be updated with the Update job - API. - - :param resource_group_name: The Resource Group Name + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + job_name, # type: str + job_resource, # type: "models.JobResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.JobResource"] + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. :type resource_group_name: str - :param job_name: The name of the job Resource within the specified - resource group. job names must be between 3 and 24 characters in - length and use any alphanumeric and underscore only + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource: Job details from request body. - :type job_resource: ~azure.mgmt.databox.models.JobResource - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :type job_resource: ~data_box_management_client.models.JobResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns JobResource or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.databox.models.JobResource] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.databox.models.JobResource]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :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 JobResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_management_client.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - job_name=job_name, - job_resource=job_resource, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('JobResource', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource=job_resource, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} - + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore def _delete_initial( - self, resource_group_name, job_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + # Construct URL - url = self.delete.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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, job_name, custom_headers=None, raw=False, polling=True, **operation_config): + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes a job. - :param resource_group_name: The Resource Group Name + :param resource_group_name: The Resource Group Name. :type resource_group_name: str - :param job_name: The name of the job Resource within the specified - resource group. job names must be between 3 and 24 characters in - length and use any alphanumeric and underscore only + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :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: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - job_name=job_name, - custom_headers=custom_headers, - raw=True, - **operation_config + 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 ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + job_name=job_name, + cls=lambda x,y,z: x, + **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, {}) - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} - + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore def _update_initial( - self, resource_group_name, job_name, job_resource_update_parameter, if_match=None, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + job_name, # type: str + job_resource_update_parameter, # type: "models.JobResourceUpdateParameter" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.JobResource"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.update.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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) + header_parameters = {} # type: Dict[str, Any] if if_match is not None: header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct body + body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('JobResource', response) + deserialized = self._deserialize('JobResource', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update( - self, resource_group_name, job_name, job_resource_update_parameter, if_match=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + job_name, # type: str + job_resource_update_parameter, # type: "models.JobResourceUpdateParameter" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.JobResource"] """Updates the properties of an existing job. - :param resource_group_name: The Resource Group Name + :param resource_group_name: The Resource Group Name. :type resource_group_name: str - :param job_name: The name of the job Resource within the specified - resource group. job names must be between 3 and 24 characters in - length and use any alphanumeric and underscore only + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str - :param job_resource_update_parameter: Job update parameters from - request body. - :type job_resource_update_parameter: - ~azure.mgmt.databox.models.JobResourceUpdateParameter - :param if_match: Defines the If-Match condition. The patch will be - performed only if the ETag of the job on the server matches this - value. + :param job_resource_update_parameter: Job update parameters from request body. + :type job_resource_update_parameter: ~data_box_management_client.models.JobResourceUpdateParameter + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the job on the server matches this value. :type if_match: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns JobResource or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.databox.models.JobResource] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.databox.models.JobResource]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :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 JobResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_management_client.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - job_name=job_name, - job_resource_update_parameter=job_resource_update_parameter, - if_match=if_match, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('JobResource', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource_update_parameter=job_resource_update_parameter, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore def book_shipment_pick_up( - self, resource_group_name, job_name, shipment_pick_up_request, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + job_name, # type: str + shipment_pick_up_request, # type: "models.ShipmentPickUpRequest" + **kwargs # type: Any + ): + # type: (...) -> "models.ShipmentPickUpResponse" """Book shipment pick up. - :param resource_group_name: The Resource Group Name + :param resource_group_name: The Resource Group Name. :type resource_group_name: str - :param job_name: The name of the job Resource within the specified - resource group. job names must be between 3 and 24 characters in - length and use any alphanumeric and underscore only + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param shipment_pick_up_request: Details of shipment pick up request. - :type shipment_pick_up_request: - ~azure.mgmt.databox.models.ShipmentPickUpRequest - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ShipmentPickUpResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :type shipment_pick_up_request: ~data_box_management_client.models.ShipmentPickUpRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShipmentPickUpResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.ShipmentPickUpResponse + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShipmentPickUpResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.book_shipment_pick_up.metadata['url'] + url = self.book_shipment_pick_up.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ShipmentPickUpResponse', response) + deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore def cancel( - self, resource_group_name, job_name, reason, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + job_name, # type: str + cancellation_reason, # type: "models.CancellationReason" + **kwargs # type: Any + ): + # type: (...) -> None """CancelJob. - :param resource_group_name: The Resource Group Name + :param resource_group_name: The Resource Group Name. :type resource_group_name: str - :param job_name: The name of the job Resource within the specified - resource group. job names must be between 3 and 24 characters in - length and use any alphanumeric and underscore only + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str - :param reason: Reason for cancellation. - :type reason: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :param cancellation_reason: Reason for cancellation. + :type cancellation_reason: ~data_box_management_client.models.CancellationReason + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError """ - cancellation_reason = models.CancellationReason(reason=reason) + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.cancel.metadata['url'] + url = self.cancel.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(cancellation_reason, 'CancellationReason') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore def list_credentials( - self, resource_group_name, job_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.UnencryptedCredentialsList"] """This method gets the unencrypted secrets related to the job. - :param resource_group_name: The Resource Group Name + :param resource_group_name: The Resource Group Name. :type resource_group_name: str - :param job_name: The name of the job Resource within the specified - resource group. job names must be between 3 and 24 characters in - length and use any alphanumeric and underscore only + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of UnencryptedCredentials - :rtype: - ~azure.mgmt.databox.models.UnencryptedCredentialsPaged[~azure.mgmt.databox.models.UnencryptedCredentials] - :raises: :class:`CloudError` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UnencryptedCredentialsList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_management_client.models.UnencryptedCredentialsList] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UnencryptedCredentialsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL - url = self.list_credentials.metadata['url'] + url = self.list_credentials.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.post(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('UnencryptedCredentialsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): request = prepare_request(next_link) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.UnencryptedCredentialsPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials'} + return ItemPaged( + get_next, extract_data + ) + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials'} # type: ignore diff --git a/src/databox/azext_databox/vendored_sdks/databox/operations/_operations.py b/src/databox/azext_databox/vendored_sdks/databox/operations/_operations.py index 41166de18d1..99e6530ed82 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/operations/_operations.py +++ b/src/databox/azext_databox/vendored_sdks/databox/operations/_operations.py @@ -1,102 +1,110 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API Version. Constant value: "2019-09-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationList"] """This method gets all the operations. - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Operation - :rtype: - ~azure.mgmt.databox.models.OperationPaged[~azure.mgmt.databox.models.Operation] - :raises: :class:`CloudError` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_management_client.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL - url = self.list.metadata['url'] - + url = self.list.metadata['url'] # type: ignore # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): request = prepare_request(next_link) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore diff --git a/src/databox/azext_databox/vendored_sdks/databox/operations/_service_operations.py b/src/databox/azext_databox/vendored_sdks/databox/operations/_service_operations.py index c595d5511f4..fc01734f99c 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/operations/_service_operations.py +++ b/src/databox/azext_databox/vendored_sdks/databox/operations/_service_operations.py @@ -1,469 +1,466 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ServiceOperations(object): """ServiceOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API Version. Constant value: "2019-09-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-01" - - self.config = config - - def list_available_skus( - self, location, available_sku_request, custom_headers=None, raw=False, **operation_config): - """This method provides the list of available skus for the given - subscription and location. - - :param location: The location of the resource - :type location: str - :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: - ~azure.mgmt.databox.models.AvailableSkuRequest - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of SkuInformation - :rtype: - ~azure.mgmt.databox.models.SkuInformationPaged[~azure.mgmt.databox.models.SkuInformation] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_available_skus.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.SkuInformationPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_available_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} + self._config = config def list_available_skus_by_resource_group( - self, resource_group_name, location, available_sku_request, custom_headers=None, raw=False, **operation_config): - """This method provides the list of available skus for the given - subscription, resource group and location. - - :param resource_group_name: The Resource Group Name + self, + resource_group_name, # type: str + location, # type: str + available_sku_request, # type: "models.AvailableSkuRequest" + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.AvailableSkusResult"] + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The Resource Group Name. :type resource_group_name: str - :param location: The location of the resource + :param location: The location of the resource. :type location: str :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: - ~azure.mgmt.databox.models.AvailableSkuRequest - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of SkuInformation - :rtype: - ~azure.mgmt.databox.models.SkuInformationPaged[~azure.mgmt.databox.models.SkuInformation] - :raises: :class:`CloudError` + :type available_sku_request: ~data_box_management_client.models.AvailableSkuRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_management_client.models.AvailableSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = "application/json" + accept = "application/json" + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] + url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str') + 'location': self._serialize.url("location", location, 'str'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('AvailableSkusResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): request = prepare_request(next_link) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.SkuInformationPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_available_skus_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} - - def validate_address_method( - self, location, validate_address, custom_headers=None, raw=False, **operation_config): - """[DEPRECATED NOTICE: This operation will soon be removed] This method - validates the customer shipping address and provide alternate addresses - if any. - - :param location: The location of the resource + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_available_skus_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + + def validate_address( + self, + location, # type: str + validate_address, # type: "models.ValidateAddress" + **kwargs # type: Any + ): + # type: (...) -> "models.AddressValidationOutput" + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The location of the resource. :type location: str :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AddressValidationOutput or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.databox.models.AddressValidationOutput or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :type validate_address: ~data_box_management_client.models.ValidateAddress + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AddressValidationOutput, or the result of cls(response) + :rtype: ~data_box_management_client.models.AddressValidationOutput + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AddressValidationOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.validate_address_method.metadata['url'] + url = self.validate_address.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(validate_address, 'ValidateAddress') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validate_address, 'ValidateAddress') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AddressValidationOutput', response) + deserialized = self._deserialize('AddressValidationOutput', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - validate_address_method.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} + validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore def validate_inputs_by_resource_group( - self, resource_group_name, location, validation_request, custom_headers=None, raw=False, **operation_config): - """This method does all necessary pre-job creation validation under - resource group. - - :param resource_group_name: The Resource Group Name + self, + resource_group_name, # type: str + location, # type: str + validation_request, # type: "models.ValidationRequest" + **kwargs # type: Any + ): + # type: (...) -> "models.ValidationResponse" + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. :type resource_group_name: str - :param location: The location of the resource + :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ValidationResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.databox.models.ValidationResponse or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :type validation_request: ~data_box_management_client.models.ValidationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] + url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str') + 'location': self._serialize.url("location", location, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(validation_request, 'ValidationRequest') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validation_request, 'ValidationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ValidationResponse', response) + deserialized = self._deserialize('ValidationResponse', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - validate_inputs_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} + validate_inputs_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore def validate_inputs( - self, location, validation_request, custom_headers=None, raw=False, **operation_config): - """This method does all necessary pre-job creation validation under - subscription. - - :param location: The location of the resource + self, + location, # type: str + validation_request, # type: "models.ValidationRequest" + **kwargs # type: Any + ): + # type: (...) -> "models.ValidationResponse" + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ValidationResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.databox.models.ValidationResponse or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :type validation_request: ~data_box_management_client.models.ValidationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.validate_inputs.metadata['url'] + url = self.validate_inputs.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(validation_request, 'ValidationRequest') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validation_request, 'ValidationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ValidationResponse', response) + deserialized = self._deserialize('ValidationResponse', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} + validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore def region_configuration( - self, location, schedule_availability_request=None, transport_availability_request=None, custom_headers=None, raw=False, **operation_config): - """This API provides configuration details specific to given - region/location. - - :param location: The location of the resource + self, + location, # type: str + region_configuration_request, # type: "models.RegionConfigurationRequest" + **kwargs # type: Any + ): + # type: (...) -> "models.RegionConfigurationResponse" + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. :type location: str - :param schedule_availability_request: Request body to get the - availability for scheduling orders. - :type schedule_availability_request: - ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the - transport availability for given sku. - :type transport_availability_request: - ~azure.mgmt.databox.models.TransportAvailabilityRequest - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: RegionConfigurationResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :param region_configuration_request: Request body to get the configuration for the region. + :type region_configuration_request: ~data_box_management_client.models.RegionConfigurationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegionConfigurationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError """ - region_configuration_request = models.RegionConfigurationRequest(schedule_availability_request=schedule_availability_request, transport_availability_request=transport_availability_request) + cls = kwargs.pop('cls', None) # type: ClsType["models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.region_configuration.metadata['url'] + url = self.region_configuration.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + def region_configuration_by_resource_group( + self, + resource_group_name, # type: str + location, # type: str + region_configuration_request, # type: "models.RegionConfigurationRequest" + **kwargs # type: Any + ): + # type: (...) -> "models.RegionConfigurationResponse" + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. + :type region_configuration_request: ~data_box_management_client.models.RegionConfigurationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegionConfigurationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.region_configuration_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('RegionConfigurationResponse', response) + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore diff --git a/src/databox/azext_databox/vendored_sdks/databox/py.typed b/src/databox/azext_databox/vendored_sdks/databox/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/databox/report.md b/src/databox/report.md new file mode 100644 index 00000000000..84ac0652057 --- /dev/null +++ b/src/databox/report.md @@ -0,0 +1,379 @@ +# Azure CLI Module Creation Report + +## EXTENSION +|CLI Extension|Command Groups| +|---------|------------| +|az databox|[groups](#CommandGroups) + +## GROUPS +### Command groups in `az databox` extension +|CLI Command Group|Group Swagger name|Commands| +|---------|------------|--------| +|az databox job|Jobs|[commands](#CommandsInJobs)| +|az databox service|Service|[commands](#CommandsInService)| + +## COMMANDS +### Commands in `az databox job` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databox job list](#JobsListByResourceGroup)|ListByResourceGroup|[Parameters](#ParametersJobsListByResourceGroup)|[Example](#ExamplesJobsListByResourceGroup)| +|[az databox job list](#JobsList)|List|[Parameters](#ParametersJobsList)|[Example](#ExamplesJobsList)| +|[az databox job show](#JobsGet)|Get|[Parameters](#ParametersJobsGet)|[Example](#ExamplesJobsGet)| +|[az databox job create](#JobsCreate)|Create|[Parameters](#ParametersJobsCreate)|[Example](#ExamplesJobsCreate)| +|[az databox job update](#JobsUpdate)|Update|[Parameters](#ParametersJobsUpdate)|[Example](#ExamplesJobsUpdate)| +|[az databox job delete](#JobsDelete)|Delete|[Parameters](#ParametersJobsDelete)|[Example](#ExamplesJobsDelete)| +|[az databox job book-shipment-pick-up](#JobsBookShipmentPickUp)|BookShipmentPickUp|[Parameters](#ParametersJobsBookShipmentPickUp)|[Example](#ExamplesJobsBookShipmentPickUp)| +|[az databox job cancel](#JobsCancel)|Cancel|[Parameters](#ParametersJobsCancel)|[Example](#ExamplesJobsCancel)| +|[az databox job list-credentials](#JobsListCredentials)|ListCredentials|[Parameters](#ParametersJobsListCredentials)|[Example](#ExamplesJobsListCredentials)| + +### Commands in `az databox service` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databox service list-available-sku-by-resource-group](#ServiceListAvailableSkusByResourceGroup)|ListAvailableSkusByResourceGroup|[Parameters](#ParametersServiceListAvailableSkusByResourceGroup)|[Example](#ExamplesServiceListAvailableSkusByResourceGroup)| +|[az databox service region-configuration](#ServiceRegionConfiguration)|RegionConfiguration|[Parameters](#ParametersServiceRegionConfiguration)|[Example](#ExamplesServiceRegionConfiguration)| +|[az databox service region-configuration-by-resource-group](#ServiceRegionConfigurationByResourceGroup)|RegionConfigurationByResourceGroup|[Parameters](#ParametersServiceRegionConfigurationByResourceGroup)|[Example](#ExamplesServiceRegionConfigurationByResourceGroup)| +|[az databox service validate-address](#ServiceValidateAddress)|ValidateAddress|[Parameters](#ParametersServiceValidateAddress)|[Example](#ExamplesServiceValidateAddress)| +|[az databox service validate-input](#ServiceValidateInputs)|ValidateInputs|[Parameters](#ParametersServiceValidateInputs)|[Example](#ExamplesServiceValidateInputs)| +|[az databox service validate-input-by-resource-group](#ServiceValidateInputsByResourceGroup)|ValidateInputsByResourceGroup|[Parameters](#ParametersServiceValidateInputsByResourceGroup)|[Example](#ExamplesServiceValidateInputsByResourceGroup)| + + +## COMMAND DETAILS + +### group `az databox job` +#### Command `az databox job list` + +##### Example +``` +az databox job list --resource-group "SdkRg5154" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--skip-token**|string|$skipToken is supported on Get list of jobs, which provides the next page in the list of jobs.|skip_token|$skipToken| + +#### Command `az databox job list` + +##### Example +``` +az databox job list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +#### Command `az databox job show` + +##### Example +``` +az databox job show --expand "details" --name "SdkJob952" --resource-group "SdkRg5154" +``` +##### Example +``` +az databox job show --expand "details" --name "SdkJob1735" --resource-group "SdkRg7937" +``` +##### Example +``` +az databox job show --expand "details" --name "SdkJob6429" --resource-group "SdkRg8091" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| +|**--expand**|string|$expand is supported on details parameter for job, which provides details on the job stages.|expand|$expand| + +#### Command `az databox job create` + +##### Example +``` +az databox job create --name "SdkJob952" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/\ +databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"jobDetailsType\\":\\"DataBox\\",\ +\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\ +\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 \ +TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg5154" +``` +##### Example +``` +az databox job create --name "SdkJob9640" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"sharePassword\\":\\"\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8\ +ff7-4a25-95c7-ce9da541242f/resourceGroups/databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\ +2\\"}}],\\"devicePassword\\":\\"\\",\\"jobDetailsType\\":\\"DataBox\\",\\"shippingAddress\\":{\\"addres\ +sType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"po\ +stalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg7478" +``` +##### Example +``` +az databox job create --name "SdkJob6599" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/\ +databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"jobDetailsType\\":\\"DataBox\\",\ +\\"preferences\\":{\\"encryptionPreferences\\":{\\"doubleEncryption\\":\\"Enabled\\"}},\\"shippingAddress\\":{\\"addres\ +sType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"po\ +stalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg608" +``` +##### Example +``` +az databox job create --name "SdkJob6429" --location "westus" --transfer-type "ExportFromAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataExportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/\ +akvenkat/providers/Microsoft.Storage/storageAccounts/aaaaaa2\\"},\\"transferConfiguration\\":{\\"transferAllDetails\\":\ +{\\"include\\":{\\"dataAccountType\\":\\"StorageAccount\\",\\"transferAllBlobs\\":true,\\"transferAllFiles\\":true}},\\\ +"transferConfigurationType\\":\\"TransferAll\\"}}],\\"jobDetailsType\\":\\"DataBox\\",\\"shippingAddress\\":{\\"address\ +Type\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"pos\ +talCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg8091" +``` +##### Example +``` +az databox job create --name "SdkJob5337" --type "UserAssigned" --user-assigned-identities \ +"{\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdentity/us\ +erAssignedIdentities/sdkIdentity\\":{}}" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/\ +databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount2\\"}}],\\"jobDetailsType\\":\\"DataBox\\"\ +,\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsof\ +t\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 \ +TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg7552" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| +|**--location**|string|The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed.|location|location| +|**--sku**|object|The sku type.|sku|sku| +|**--transfer-type**|sealed-choice|Type of the data transfer.|transfer_type|transferType| +|**--tags**|dictionary|The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups).|tags|tags| +|**--type**|string|Identity type|type|type| +|**--user-assigned-identities**|dictionary|User Assigned Identities|user_assigned_identities|userAssignedIdentities| +|**--details**|object|Details of a job run. This field will only be sent for expand details filter.|details|details| +|**--delivery-type**|sealed-choice|Delivery type of Job.|delivery_type|deliveryType| +|**--scheduled-date-time**|date-time|Scheduled date time.|scheduled_date_time|scheduledDateTime| + +#### Command `az databox job update` + +##### Example +``` +az databox job update --name "SdkJob952" --contact-name "Update Job" --email-list "testing@microsoft.com" --phone \ +"1234567890" --phone-extension "1234" --shipping-address address-type="Commercial" city="San Francisco" \ +company-name="Microsoft" country="US" postal-code="94107" state-or-province="CA" street-address1="16 TOWNSEND ST" \ +street-address2="Unit 1" --resource-group "SdkRg5154" +``` +##### Example +``` +az databox job update --name "SdkJob1735" --kek-type "CustomerManaged" --kek-url "https://sdkkeyvault.vault.azure.net/k\ +eys/SSDKEY/" --kek-vault-resource-id "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/provi\ +ders/Microsoft.KeyVault/vaults/SDKKeyVault" --resource-group "SdkRg7937" +``` +##### Example +``` +az databox job update --name "SdkJob2965" --resource-identity-type "SystemAssigned,UserAssigned" \ +--user-assigned-identities "{\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/M\ +icrosoft.ManagedIdentity/userAssignedIdentities/sdkIdentity\\":{}}" --type "UserAssigned" --user-assigned \ +resource-id="/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIde\ +ntity/userAssignedIdentities/sdkIdentity" --kek-type "CustomerManaged" --kek-url "https://sdkkeyvault.vault.azure.net/k\ +eys/SSDKEY/" --kek-vault-resource-id "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/provi\ +ders/Microsoft.KeyVault/vaults/SDKKeyVault" --resource-group "SdkRg9765" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| +|**--if-match**|string|Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value.|if_match|If-Match| +|**--tags**|dictionary|The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups).|tags|tags| +|**--shipping-address**|object|Shipping address of the customer.|shipping_address|shippingAddress| +|**--kek-type**|sealed-choice|Type of encryption key used for key encryption.|kek_type|kekType| +|**--kek-url**|string|Key encryption key. It is required in case of Customer managed KekType.|kek_url|kekUrl| +|**--kek-vault-resource-id**|string|Kek vault resource id. It is required in case of Customer managed KekType.|kek_vault_resource_id|kekVaultResourceID| +|**--type**|string|Managed service identity type.|type|type| +|**--user-assigned**|object|User assigned identity properties.|user_assigned|userAssigned| +|**--contact-name**|string|Contact name of the person.|contact_name|contactName| +|**--phone**|string|Phone number of the contact person.|phone|phone| +|**--phone-extension**|string|Phone extension number of the contact person.|phone_extension|phoneExtension| +|**--mobile**|string|Mobile number of the contact person.|mobile|mobile| +|**--email-list**|array|List of Email-ids to be notified about job progress.|email_list|emailList| +|**--notification-preference**|array|Notification preference for a job stage.|notification_preference|notificationPreference| +|**--resource-identity-type**|string|Identity type|resource_identity_type|type| +|**--user-assigned-identities**|dictionary|User Assigned Identities|user_assigned_identities|userAssignedIdentities| + +#### Command `az databox job delete` + +##### Example +``` +az databox job delete --name "SdkJob952" --resource-group "SdkRg5154" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| + +#### Command `az databox job book-shipment-pick-up` + +##### Example +``` +az databox job book-shipment-pick-up --name "TJ-636646322037905056" --resource-group "bvttoolrg6" --end-time \ +"2019-09-22T18:30:00Z" --shipment-location "Front desk" --start-time "2019-09-20T18:30:00Z" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| +|**--start-time**|date-time|Minimum date after which the pick up should commence, this must be in local time of pick up area.|start_time|startTime| +|**--end-time**|date-time|Maximum date before which the pick up should commence, this must be in local time of pick up area.|end_time|endTime| +|**--shipment-location**|string|Shipment Location in the pickup place. Eg.front desk|shipment_location|shipmentLocation| + +#### Command `az databox job cancel` + +##### Example +``` +az databox job cancel --reason "CancelTest" --name "SdkJob952" --resource-group "SdkRg5154" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| +|**--reason**|string|Reason for cancellation.|reason|reason| + +#### Command `az databox job list-credentials` + +##### Example +``` +az databox job list-credentials --name "TJ-636646322037905056" --resource-group "bvttoolrg6" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| + +### group `az databox service` +#### Command `az databox service list-available-sku-by-resource-group` + +##### Example +``` +az databox service list-available-sku-by-resource-group --country "US" --available-sku-request-location "westus" \ +--transfer-type "ImportToAzure" --location "westus" --resource-group "bvttoolrg6" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--location**|string|The location of the resource|location|location| +|**--transfer-type**|sealed-choice|Type of the transfer.|transfer_type|transferType| +|**--country**|string|ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements|country|country| +|**--available-sku-request-location**|string|Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01|available_sku_request_location|location| +|**--sku-names**|array|Sku Names to filter for available skus|sku_names|skuNames| + +#### Command `az databox service region-configuration` + +##### Example +``` +az databox service region-configuration --location "westus" --schedule-availability-request \ +"{\\"skuName\\":\\"DataBox\\",\\"storageLocation\\":\\"westus\\"}" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--location**|string|The location of the resource|location|location| +|**--data-box-schedule-availability-request**|object|Request body to get the availability for scheduling data box orders orders.|data_box_schedule_availability_request|DataBoxScheduleAvailabilityRequest| +|**--disk-schedule-availability-request**|object|Request body to get the availability for scheduling disk orders.|disk_schedule_availability_request|DiskScheduleAvailabilityRequest| +|**--heavy-schedule-availability-request**|object|Request body to get the availability for scheduling heavy orders.|heavy_schedule_availability_request|HeavyScheduleAvailabilityRequest| +|**--sku-name**|sealed-choice|Type of the device.|sku_name|skuName| + +#### Command `az databox service region-configuration-by-resource-group` + +##### Example +``` +az databox service region-configuration-by-resource-group --location "westus" --schedule-availability-request \ +"{\\"skuName\\":\\"DataBox\\",\\"storageLocation\\":\\"westus\\"}" --resource-group "SdkRg4981" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--location**|string|The location of the resource|location|location| +|**--data-box-schedule-availability-request**|object|Request body to get the availability for scheduling data box orders orders.|data_box_schedule_availability_request|DataBoxScheduleAvailabilityRequest| +|**--disk-schedule-availability-request**|object|Request body to get the availability for scheduling disk orders.|disk_schedule_availability_request|DiskScheduleAvailabilityRequest| +|**--heavy-schedule-availability-request**|object|Request body to get the availability for scheduling heavy orders.|heavy_schedule_availability_request|HeavyScheduleAvailabilityRequest| +|**--sku-name**|sealed-choice|Type of the device.|sku_name|skuName| + +#### Command `az databox service validate-address` + +##### Example +``` +az databox service validate-address --location "westus" --device-type "DataBox" --shipping-address \ +address-type="Commercial" city="San Francisco" company-name="Microsoft" country="US" postal-code="94107" \ +state-or-province="CA" street-address1="16 TOWNSEND ST" street-address2="Unit 1" --validation-type "ValidateAddress" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--location**|string|The location of the resource|location|location| +|**--validation-type**|sealed-choice|Identifies the type of validation request.|validation_type|validationType| +|**--shipping-address**|object|Shipping address of the customer.|shipping_address|shippingAddress| +|**--device-type**|sealed-choice|Device type to be used for the job.|device_type|deviceType| +|**--preferred-shipment-type**|sealed-choice|Indicates Shipment Logistics type that the customer preferred.|preferred_shipment_type|preferredShipmentType| + +#### Command `az databox service validate-input` + +##### Example +``` +az databox service validate-input --location "westus" --validation-request "{\\"individualRequestDetails\\":[{\\"dataIm\ +portDetails\\":[{\\"accountDetails\\":{\\"dataAccountType\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscripti\ +ons/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxb\ +vttestaccount\\"}}],\\"deviceType\\":\\"DataBox\\",\\"transferType\\":\\"ImportToAzure\\",\\"validationType\\":\\"Valid\ +ateDataTransferDetails\\"},{\\"deviceType\\":\\"DataBox\\",\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\\ +"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"s\ +tateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit \ +1\\"},\\"transportPreferences\\":{\\"preferredShipmentType\\":\\"MicrosoftManaged\\"},\\"validationType\\":\\"ValidateA\ +ddress\\"},{\\"validationType\\":\\"ValidateSubscriptionIsAllowedToCreateJob\\"},{\\"country\\":\\"US\\",\\"deviceType\ +\\":\\"DataBox\\",\\"location\\":\\"westus\\",\\"transferType\\":\\"ImportToAzure\\",\\"validationType\\":\\"ValidateSk\ +uAvailability\\"},{\\"deviceType\\":\\"DataBox\\",\\"validationType\\":\\"ValidateCreateOrderLimit\\"},{\\"deviceType\\\ +":\\"DataBox\\",\\"preference\\":{\\"transportPreferences\\":{\\"preferredShipmentType\\":\\"MicrosoftManaged\\"}},\\"v\ +alidationType\\":\\"ValidatePreferences\\"}],\\"validationCategory\\":\\"JobCreationValidation\\"}" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--location**|string|The location of the resource|location|location| +|**--create-job-validations**|object|It does all pre-job creation validations.|create_job_validations|CreateJobValidations| + +#### Command `az databox service validate-input-by-resource-group` + +##### Example +``` +az databox service validate-input-by-resource-group --location "westus" --resource-group "SdkRg6861" \ +--validation-request "{\\"individualRequestDetails\\":[{\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountT\ +ype\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroup\ +s/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"deviceType\\":\\"DataBox\\",\\"\ +transferType\\":\\"ImportToAzure\\",\\"validationType\\":\\"ValidateDataTransferDetails\\"},{\\"deviceType\\":\\"DataBo\ +x\\",\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Micr\ +osoft\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 \ +TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit 1\\"},\\"transportPreferences\\":{\\"preferredShipmentType\\":\\"MicrosoftM\ +anaged\\"},\\"validationType\\":\\"ValidateAddress\\"},{\\"validationType\\":\\"ValidateSubscriptionIsAllowedToCreateJo\ +b\\"},{\\"country\\":\\"US\\",\\"deviceType\\":\\"DataBox\\",\\"location\\":\\"westus\\",\\"transferType\\":\\"ImportTo\ +Azure\\",\\"validationType\\":\\"ValidateSkuAvailability\\"},{\\"deviceType\\":\\"DataBox\\",\\"validationType\\":\\"Va\ +lidateCreateOrderLimit\\"},{\\"deviceType\\":\\"DataBox\\",\\"preference\\":{\\"transportPreferences\\":{\\"preferredSh\ +ipmentType\\":\\"MicrosoftManaged\\"}},\\"validationType\\":\\"ValidatePreferences\\"}],\\"validationCategory\\":\\"Job\ +CreationValidation\\"}" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--location**|string|The location of the resource|location|location| +|**--create-job-validations**|object|It does all pre-job creation validations.|create_job_validations|CreateJobValidations| diff --git a/src/databox/setup.cfg b/src/databox/setup.cfg index 3c6e79cf31d..2fdd96e5d39 100644 --- a/src/databox/setup.cfg +++ b/src/databox/setup.cfg @@ -1,2 +1 @@ -[bdist_wheel] -universal=1 +#setup.cfg \ No newline at end of file diff --git a/src/databox/setup.py b/src/databox/setup.py index b7768ea142b..ed1ec325aa7 100644 --- a/src/databox/setup.py +++ b/src/databox/setup.py @@ -8,15 +8,13 @@ from codecs import open from setuptools import setup, find_packages -try: - from azure_bdist_wheel import cmdclass -except ImportError: - from distutils import log as logger - logger.warn("Wheel is not available, disabling bdist_wheel hook") -# TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. VERSION = '0.1.0' +try: + from azext_databox.manual.version import VERSION +except ImportError: + pass # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -26,17 +24,19 @@ 'Intended Audience :: System Administrators', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ] -# TODO: Add any additional SDK dependencies here DEPENDENCIES = [] +try: + from azext_databox.manual.dependency import DEPENDENCIES +except ImportError: + pass + with open('README.md', 'r', encoding='utf-8') as f: README = f.read() with open('HISTORY.rst', 'r', encoding='utf-8') as f: @@ -45,8 +45,7 @@ setup( name='databox', version=VERSION, - description='Microsoft Azure Command-Line Tools DataBox Extension', - # TODO: Update author and email, if applicable + description='Microsoft Azure Command-Line Tools DataBoxManagementClient Extension', author='Microsoft Corporation', author_email='azpycli@microsoft.com', url='https://github.com/Azure/azure-cli-extensions/tree/master/src/databox',