diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e8ac2f2e1d8..708c11fd867 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -48,3 +48,4 @@ /src/azure-cli/azure/cli/command_modules/util/ @jiasli @Juliehzl @zhoxing-ms /src/azure-cli/azure/cli/command_modules/synapse/ @idear1203 @sunsw1994 @aim-for-better /src/azure-cli/azure/cli/command_modules/hdinsight/ @aim-for-better @haroldrandom @Juliehzl +/src/azure-cli/azure/cli/command_modules/databoxedge/ @evelyn-ys @Juliehzl diff --git a/doc/sphinx/azhelpgen/doc_source_map.json b/doc/sphinx/azhelpgen/doc_source_map.json index 57bb61a6eaf..8b713dee799 100644 --- a/doc/sphinx/azhelpgen/doc_source_map.json +++ b/doc/sphinx/azhelpgen/doc_source_map.json @@ -74,5 +74,6 @@ "apim": "src/azure-cli/azure/cli/command_modules/apim/_help.py", "aro": "src/azure-cli/azure/cli/command_modules/aro/_help.py", "util": "src/azure-cli/azure/cli/command_modules/util/_help.py", - "synapse": "src/azure-cli/azure/cli/command_modules/synapse/_help.py" + "synapse": "src/azure-cli/azure/cli/command_modules/synapse/_help.py", + "databoxedge": "src/azure-cli/azure/cli/command_modules/databoxedge/_help.py" } diff --git a/src/azure-cli-core/azure/cli/core/profiles/_shared.py b/src/azure-cli-core/azure/cli/core/profiles/_shared.py index 7739c907e3a..f0e87eb8ea0 100644 --- a/src/azure-cli-core/azure/cli/core/profiles/_shared.py +++ b/src/azure-cli-core/azure/cli/core/profiles/_shared.py @@ -58,6 +58,7 @@ class ResourceType(Enum): # pylint: disable=too-few-public-methods MGMT_APPSERVICE = ('azure.mgmt.web', 'WebSiteManagementClient') MGMT_IOTHUB = ('azure.mgmt.iothub', 'IotHubClient') MGMT_ARO = ('azure.mgmt.redhatopenshift', 'AzureRedHatOpenShiftClient') + MGMT_DATABOXEDGE = ('azure.mgmt.databoxedge', 'DataBoxEdgeManagementClient') # the "None" below will stay till a command module fills in the type so "get_mgmt_service_client" # can be provided with "ResourceType.XXX" to initialize the client object. This usually happens # when related commands start to support Multi-API @@ -208,7 +209,8 @@ def default_api_version(self): }), ResourceType.MGMT_APPSERVICE: '2019-08-01', ResourceType.MGMT_IOTHUB: '2020-03-01', - ResourceType.MGMT_ARO: '2020-04-30' + ResourceType.MGMT_ARO: '2020-04-30', + ResourceType.MGMT_DATABOXEDGE: '2019-08-01' }, '2020-09-01-hybrid': { ResourceType.MGMT_STORAGE: '2019-06-01', @@ -247,7 +249,8 @@ def default_api_version(self): ResourceType.DATA_COSMOS_TABLE: '2017-04-17', ResourceType.MGMT_APPSERVICE: '2018-02-01', ResourceType.MGMT_EVENTHUB: '2018-01-01-preview', - ResourceType.MGMT_IOTHUB: '2019-07-01-preview' + ResourceType.MGMT_IOTHUB: '2019-07-01-preview', + ResourceType.MGMT_DATABOXEDGE: '2019-08-01' }, '2019-03-01-hybrid': { ResourceType.MGMT_STORAGE: '2017-10-01', @@ -282,7 +285,8 @@ def default_api_version(self): # API versions ResourceType.MGMT_APPSERVICE: '2018-02-01', ResourceType.MGMT_EVENTHUB: '2018-01-01-preview', - ResourceType.MGMT_IOTHUB: '2019-03-22' + ResourceType.MGMT_IOTHUB: '2019-03-22', + ResourceType.MGMT_DATABOXEDGE: '2019-08-01' }, '2018-03-01-hybrid': { ResourceType.MGMT_STORAGE: '2016-01-01', diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/__init__.py b/src/azure-cli/azure/cli/command_modules/databoxedge/__init__.py new file mode 100644 index 00000000000..ca4f21fd405 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/__init__.py @@ -0,0 +1,50 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from .generated._help import helps # pylint: disable=unused-import +try: + from .manual._help import helps # pylint: disable=reimported +except ImportError: + pass + + +class DataBoxEdgeManagementClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azure.cli.core.profiles import ResourceType + databoxedge_custom = CliCommandType( + operations_tmpl='azure.cli.command_modules.databoxedge.custom#{}') + parent = super(DataBoxEdgeManagementClientCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=databoxedge_custom, + resource_type=ResourceType.MGMT_DATABOXEDGE) + + def load_command_table(self, args): + from .generated.commands import load_command_table + load_command_table(self, args) + try: + from .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 .generated._params import load_arguments + load_arguments(self, command) + try: + from .manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = DataBoxEdgeManagementClientCommandsLoader diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/_help.py b/src/azure-cli/azure/cli/command_modules/databoxedge/_help.py new file mode 100644 index 00000000000..2fe1a978ab1 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/_help.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------- +# 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 .generated._help import helps # pylint: disable=unused-import +try: + from .manual._help import helps # pylint: disable=reimported +except ImportError: + pass diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/action.py b/src/azure-cli/azure/cli/command_modules/databoxedge/action.py new file mode 100644 index 00000000000..d95d53bf711 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/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/azure-cli/azure/cli/command_modules/databoxedge/custom.py b/src/azure-cli/azure/cli/command_modules/databoxedge/custom.py new file mode 100644 index 00000000000..dbe9d5f9742 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/custom.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.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/gen.zip b/src/azure-cli/azure/cli/command_modules/databoxedge/gen.zip new file mode 100644 index 00000000000..ec20107698a Binary files /dev/null and b/src/azure-cli/azure/cli/command_modules/databoxedge/gen.zip differ diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/generated/__init__.py b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/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/azure-cli/azure/cli/command_modules/databoxedge/generated/_client_factory.py b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/_client_factory.py new file mode 100644 index 00000000000..7756e7fffcd --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/_client_factory.py @@ -0,0 +1,44 @@ +# -------------------------------------------------------------------------- +# 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_databoxedge_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azure.cli.core.profiles import ResourceType + return get_mgmt_service_client(cli_ctx, + ResourceType.MGMT_DATABOXEDGE) + + +def cf_device(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).devices + + +def cf_alert(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).alerts + + +def cf_bandwidth_schedule(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).bandwidth_schedules + + +def cf_job(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).jobs + + +def cf_node(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).nodes + + +def cf_order(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).orders + + +def cf_sku(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).skus diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/generated/_help.py b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/_help.py new file mode 100644 index 00000000000..9979a486e17 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/_help.py @@ -0,0 +1,332 @@ +# -------------------------------------------------------------------------- +# 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['databoxedge device'] = """ + type: group + short-summary: Manage device with databoxedge +""" + +helps['databoxedge device list'] = """ + type: command + short-summary: "Gets all the Data Box Edge/Data Box Gateway devices in a resource group. And Gets all the Data Box \ +Edge/Data Box Gateway devices in a subscription." + examples: + - name: DataBoxEdgeDeviceGetByResourceGroup + text: |- + az databoxedge device list --resource-group "GroupForEdgeAutomation" + - name: DataBoxEdgeDeviceGetBySubscription + text: |- + az databoxedge device list +""" + +helps['databoxedge device show'] = """ + type: command + short-summary: "Gets the properties of the Data Box Edge/Data Box Gateway device." + examples: + - name: DataBoxEdgeDeviceGetByName + text: |- + az databoxedge device show --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device create'] = """ + type: command + short-summary: "Create a Data Box Edge/Data Box Gateway resource." + parameters: + - name: --sku + short-summary: "The SKU type." + long-summary: | + Usage: --sku name=XX tier=XX + + name: SKU name. + tier: The SKU tier. This is based on the SKU name. + examples: + - name: DataBoxEdgeDevicePut + text: |- + az databoxedge device create --location "eastus" --sku name="Edge" tier="Standard" --name \ +"testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device update'] = """ + type: command + short-summary: "Modifies a Data Box Edge/Data Box Gateway resource." + examples: + - name: DataBoxEdgeDevicePatch + text: |- + az databoxedge device update --name "testedgedevice" --tags Key1="value1" Key2="value2" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device delete'] = """ + type: command + short-summary: "Deletes the Data Box Edge/Data Box Gateway device." + examples: + - name: DataBoxEdgeDeviceDelete + text: |- + az databoxedge device delete --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device download-update'] = """ + type: command + short-summary: "Downloads the updates on a Data Box Edge/Data Box Gateway device." + examples: + - name: DownloadUpdatesPost + text: |- + az databoxedge device download-update --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device install-update'] = """ + type: command + short-summary: "Installs the updates on the Data Box Edge/Data Box Gateway device." + examples: + - name: InstallUpdatesPost + text: |- + az databoxedge device install-update --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device scan-for-update'] = """ + type: command + short-summary: "Scans for updates on a Data Box Edge/Data Box Gateway device." + examples: + - name: ScanForUpdatesPost + text: |- + az databoxedge device scan-for-update --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device show-update-summary'] = """ + type: command + short-summary: "Gets information about the availability of updates based on the last scan of the device. It also \ +gets information about any ongoing download or install jobs on the device." + examples: + - name: UpdateSummaryGet + text: |- + az databoxedge device show-update-summary --name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge device wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge device is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge device is successfully created. + text: |- + az databoxedge device wait --name "testedgedevice" --resource-group "GroupForEdgeAutomation" --created + - name: Pause executing next line of CLI script until the databoxedge device is successfully deleted. + text: |- + az databoxedge device wait --name "testedgedevice" --resource-group "GroupForEdgeAutomation" --deleted +""" + +helps['databoxedge alert'] = """ + type: group + short-summary: Manage alert with databoxedge +""" + +helps['databoxedge alert list'] = """ + type: command + short-summary: "Gets all the alerts for a Data Box Edge/Data Box Gateway device." + examples: + - name: AlertGetAllInDevice + text: |- + az databoxedge alert list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge alert show'] = """ + type: command + short-summary: "Gets an alert by name." + examples: + - name: AlertGet + text: |- + az databoxedge alert show --name "159a00c7-8543-4343-9435-263ac87df3bb" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge bandwidth-schedule'] = """ + type: group + short-summary: Manage bandwidth schedule with databoxedge +""" + +helps['databoxedge bandwidth-schedule list'] = """ + type: command + short-summary: "Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device." + examples: + - name: BandwidthScheduleGetAllInDevice + text: |- + az databoxedge bandwidth-schedule list --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge bandwidth-schedule show'] = """ + type: command + short-summary: "Gets the properties of the specified bandwidth schedule." + examples: + - name: BandwidthScheduleGet + text: |- + az databoxedge bandwidth-schedule show --name "bandwidth-1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge bandwidth-schedule create'] = """ + type: command + short-summary: "Create a bandwidth schedule." + examples: + - name: BandwidthSchedulePut + text: |- + az databoxedge bandwidth-schedule create --name "bandwidth-1" --device-name "testedgedevice" --days \ +"Sunday" "Monday" --rate-in-mbps 100 --start "0:0:0" --stop "13:59:0" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge bandwidth-schedule update'] = """ + type: command + short-summary: "Update a bandwidth schedule." +""" + +helps['databoxedge bandwidth-schedule delete'] = """ + type: command + short-summary: "Deletes the specified bandwidth schedule." + examples: + - name: BandwidthScheduleDelete + text: |- + az databoxedge bandwidth-schedule delete --name "bandwidth-1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge bandwidth-schedule wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge bandwidth-schedule is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge bandwidth-schedule is successfully \ +created. + text: |- + az databoxedge bandwidth-schedule wait --name "bandwidth-1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" --created + - name: Pause executing next line of CLI script until the databoxedge bandwidth-schedule is successfully \ +updated. + text: |- + az databoxedge bandwidth-schedule wait --name "bandwidth-1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" --updated + - name: Pause executing next line of CLI script until the databoxedge bandwidth-schedule is successfully \ +deleted. + text: |- + az databoxedge bandwidth-schedule wait --name "bandwidth-1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" --deleted +""" + +helps['databoxedge'] = """ + type: group + short-summary: Manage job with databoxedge +""" + +helps['databoxedge show-job'] = """ + type: command + short-summary: "Gets the details of a specified job on a Data Box Edge/Data Box Gateway device." + examples: + - name: JobsGet + text: |- + az databoxedge show-job --name "159a00c7-8543-4343-9435-263ac87df3bb" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge'] = """ + type: group + short-summary: Manage node with databoxedge +""" + +helps['databoxedge list-node'] = """ + type: command + short-summary: "Gets all the nodes currently configured under this Data Box Edge device." + examples: + - name: NodesGetAllInDevice + text: |- + az databoxedge list-node --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge order'] = """ + type: group + short-summary: Manage order with databoxedge +""" + +helps['databoxedge order list'] = """ + type: command + short-summary: "Lists all the orders related to a Data Box Edge/Data Box Gateway device." + examples: + - name: OrderGetAllInDevice + text: |- + az databoxedge order list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge order show'] = """ + type: command + short-summary: "Gets a specific order by name." + examples: + - name: OrderGet + text: |- + az databoxedge order show --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge order create'] = """ + type: command + short-summary: "Create an order." + examples: + - name: OrderPut + text: |- + az databoxedge order create --device-name "testedgedevice" --company-name "Microsoft" --contact-person \ +"John Mcclane" --email-list "john@microsoft.com" --phone "(800) 426-9400" --address-line1 "Microsoft Corporation" \ +--address-line2 "One Microsoft Way" --address-line3 "Redmond" --city "WA" --country "United States" --postal-code \ +"98052" --state "WA" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge order update'] = """ + type: command + short-summary: "Update an order." +""" + +helps['databoxedge order delete'] = """ + type: command + short-summary: "Deletes the order related to the device." + examples: + - name: OrderDelete + text: |- + az databoxedge order delete --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge order wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge order is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge order is successfully created. + text: |- + az databoxedge order wait --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--created + - name: Pause executing next line of CLI script until the databoxedge order is successfully updated. + text: |- + az databoxedge order wait --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--updated + - name: Pause executing next line of CLI script until the databoxedge order is successfully deleted. + text: |- + az databoxedge order wait --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--deleted +""" + +helps['databoxedge'] = """ + type: group + short-summary: Manage sku with databoxedge +""" + +helps['databoxedge list-sku'] = """ + type: command + short-summary: "List all the available Skus in the region and information related to them." + examples: + - name: ListSkus + text: |- + az databoxedge list-sku +""" diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/generated/_params.py b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/_params.py new file mode 100644 index 00000000000..4569ec79858 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/_params.py @@ -0,0 +1,227 @@ +# -------------------------------------------------------------------------- +# 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=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, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import get_default_location_from_resource_group +from ..action import AddSku + + +def load_arguments(self, _): + + with self.argument_context('databoxedge device list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('expand', type=str, help='Specify $expand=details to populate additional fields related to the ' + 'resource or Specify $skipToken= to populate the next page in the list.') + + with self.argument_context('databoxedge device show') as c: + c.argument('device_name', options_list=['--name', '-n', '--device-name'], type=str, help='The device name.', + id_part='name') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge device create') as c: + c.argument('device_name', options_list=['--name', '-n', '--device-name'], type=str, help='The device name.') + 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('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='The SKU type.') + c.argument('etag', type=str, help='The etag for the devices.') + c.argument('data_box_edge_device_status', options_list=['--status'], arg_type=get_enum_type(['ReadyToSetup', + 'Online', + 'Offline', + 'NeedsAttention', + 'Disconnected', + 'PartiallyDisconnected', + 'Maintenance']), + help='The status of the Data Box Edge/Gateway device.') + c.argument('description', type=str, help='The Description of the Data Box Edge/Gateway device.') + c.argument('model_description', type=str, help='The description of the Data Box Edge/Gateway device model.') + c.argument('friendly_name', type=str, help='The Data Box Edge/Gateway device name.') + + with self.argument_context('databoxedge device update') as c: + c.argument('device_name', options_list=['--name', '-n', '--device-name'], type=str, help='The device name.', + id_part='name') + c.argument('resource_group_name', resource_group_name_type) + c.argument('tags', tags_type) + + with self.argument_context('databoxedge device delete') as c: + c.argument('device_name', options_list=['--name', '-n', '--device-name'], type=str, help='The device name.', + id_part='name') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge device download-update') as c: + c.argument('device_name', options_list=['--name', '-n', '--device-name'], type=str, help='The device name.', + id_part='name') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge device install-update') as c: + c.argument('device_name', options_list=['--name', '-n', '--device-name'], type=str, help='The device name.', + id_part='name') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge device scan-for-update') as c: + c.argument('device_name', options_list=['--name', '-n', '--device-name'], type=str, help='The device name.', + id_part='name') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge device show-update-summary') as c: + c.argument('device_name', options_list=['--name', '-n', '--device-name'], type=str, help='The device name.', + id_part='name') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge device wait') as c: + c.argument('device_name', options_list=['--name', '-n', '--device-name'], type=str, help='The device name.', + id_part='name') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge alert list') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge alert show') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.', + id_part='name') + c.argument('name', options_list=['--name', '-n'], type=str, help='The alert name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge bandwidth-schedule list') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge bandwidth-schedule show') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.', + id_part='name') + c.argument('name', options_list=['--name', '-n'], type=str, help='The bandwidth schedule name.', + id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge bandwidth-schedule create') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.') + c.argument('name', options_list=['--name', '-n'], type=str, help='The bandwidth schedule name which needs to ' + 'be added/updated.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('start', type=str, help='The start time of the schedule in UTC.') + c.argument('stop', type=str, help='The stop time of the schedule in UTC.') + c.argument('rate_in_mbps', type=int, help='The bandwidth rate in Mbps.') + c.argument('days', nargs='+', help='The days of the week when this schedule is applicable.') + + with self.argument_context('databoxedge bandwidth-schedule update') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.', + id_part='name') + c.argument('name', options_list=['--name', '-n'], type=str, help='The bandwidth schedule name which needs to ' + 'be added/updated.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('start', type=str, help='The start time of the schedule in UTC.') + c.argument('stop', type=str, help='The stop time of the schedule in UTC.') + c.argument('rate_in_mbps', type=int, help='The bandwidth rate in Mbps.') + c.argument('days', nargs='+', help='The days of the week when this schedule is applicable.') + c.ignore('parameters') + + with self.argument_context('databoxedge bandwidth-schedule delete') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.', + id_part='name') + c.argument('name', options_list=['--name', '-n'], type=str, help='The bandwidth schedule name.', + id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge bandwidth-schedule wait') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.', + id_part='name') + c.argument('name', options_list=['--name', '-n'], type=str, help='The bandwidth schedule name.', + id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge show-job') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.', + id_part='name') + c.argument('name', options_list=['--name', '-n'], type=str, help='The job name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge list-node') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge order list') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge order show') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.', + id_part='name') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge order create') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, + help='The order details of a device.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('status', arg_type=get_enum_type(['Untracked', 'AwaitingFulfilment', 'AwaitingPreparation', + 'AwaitingShipment', 'Shipped', 'Arriving', 'Delivered', + 'ReplacementRequested', 'LostDevice', 'Declined', + 'ReturnInitiated', 'AwaitingReturnShipment', 'ShippedBack', + 'CollectedAtMicrosoft']), help='Status of the order as per the ' + 'allowed status types.', arg_group='Current Status') + c.argument('comments', type=str, help='Comments related to this status change.', arg_group='Current Status') + c.argument('address_line1', type=str, help='The address line1.', arg_group='Shipping Address') + c.argument('address_line2', type=str, help='The address line2.', arg_group='Shipping Address') + c.argument('address_line3', type=str, help='The address line3.', arg_group='Shipping Address') + c.argument('postal_code', type=str, help='The postal code.', arg_group='Shipping Address') + c.argument('city', type=str, help='The city name.', arg_group='Shipping Address') + c.argument('state', type=str, help='The state name.', arg_group='Shipping Address') + c.argument('country', type=str, help='The country name.', arg_group='Shipping Address') + c.argument('contact_person', type=str, help='The contact person name.', arg_group='Contact Information') + c.argument('company_name', type=str, help='The name of the company.', arg_group='Contact Information') + c.argument('phone', type=str, help='The phone number.', arg_group='Contact Information') + c.argument('email_list', nargs='+', help='The email list.', arg_group='Contact Information') + + with self.argument_context('databoxedge order update') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, + help='The order details of a device.', id_part='name') + c.argument('resource_group_name', resource_group_name_type) + c.argument('status', arg_type=get_enum_type(['Untracked', 'AwaitingFulfilment', 'AwaitingPreparation', + 'AwaitingShipment', 'Shipped', 'Arriving', 'Delivered', + 'ReplacementRequested', 'LostDevice', 'Declined', + 'ReturnInitiated', 'AwaitingReturnShipment', 'ShippedBack', + 'CollectedAtMicrosoft']), help='Status of the order as per the ' + 'allowed status types.', arg_group='Current Status') + c.argument('comments', type=str, help='Comments related to this status change.', arg_group='Current Status') + c.argument('address_line1', type=str, help='The address line1.', arg_group='Shipping Address') + c.argument('address_line2', type=str, help='The address line2.', arg_group='Shipping Address') + c.argument('address_line3', type=str, help='The address line3.', arg_group='Shipping Address') + c.argument('postal_code', type=str, help='The postal code.', arg_group='Shipping Address') + c.argument('city', type=str, help='The city name.', arg_group='Shipping Address') + c.argument('state', type=str, help='The state name.', arg_group='Shipping Address') + c.argument('country', type=str, help='The country name.', arg_group='Shipping Address') + c.argument('contact_person', type=str, help='The contact person name.', arg_group='Contact Information') + c.argument('company_name', type=str, help='The name of the company.', arg_group='Contact Information') + c.argument('phone', type=str, help='The phone number.', arg_group='Contact Information') + c.argument('email_list', nargs='+', help='The email list.', arg_group='Contact Information') + c.ignore('order') + + with self.argument_context('databoxedge order delete') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.', + id_part='name') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge order wait') as c: + c.argument('device_name', options_list=['--device-name', '-d'], type=str, help='The device name.', + id_part='name') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge list-sku') as c: + c.argument('filter_', options_list=['--filter'], type=str, help='Specify $filter=\'location eq \' to ' + 'filter on location.') diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/generated/_validators.py b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/_validators.py new file mode 100644 index 00000000000..b33a44c1ebf --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/_validators.py @@ -0,0 +1,9 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/generated/action.py b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/action.py new file mode 100644 index 00000000000..8d3f1c9dde7 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/action.py @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------- +# 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 == 'tier': + d['tier'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter sku. All possible keys are: name, tier' + .format(k)) + return d diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/generated/commands.py b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/commands.py new file mode 100644 index 00000000000..0897231eb1f --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/commands.py @@ -0,0 +1,95 @@ +# -------------------------------------------------------------------------- +# 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 ..generated._client_factory import cf_device + databoxedge_device = CliCommandType( + operations_tmpl='azure.mgmt.databoxedge.operations._devices_operations#DevicesOperations.{}', + client_factory=cf_device) + with self.command_group('databoxedge device', databoxedge_device, client_factory=cf_device, + min_api='2019-08-01') as g: + g.custom_command('list', 'databoxedge_device_list') + g.custom_show_command('show', 'databoxedge_device_show') + g.custom_command('create', 'databoxedge_device_create', supports_no_wait=True) + g.custom_command('update', 'databoxedge_device_update') + g.custom_command('delete', 'databoxedge_device_delete', supports_no_wait=True, confirmation=True) + g.custom_command('download-update', 'databoxedge_device_download_update', supports_no_wait=True) + g.custom_command('install-update', 'databoxedge_device_install_update', supports_no_wait=True) + g.custom_command('scan-for-update', 'databoxedge_device_scan_for_update', supports_no_wait=True) + g.custom_command('show-update-summary', 'databoxedge_device_show_update_summary') + g.custom_wait_command('wait', 'databoxedge_device_show') + + from ..generated._client_factory import cf_alert + databoxedge_alert = CliCommandType( + operations_tmpl='azure.mgmt.databoxedge.operations._alerts_operations#AlertsOperations.{}', + client_factory=cf_alert) + with self.command_group('databoxedge alert', databoxedge_alert, client_factory=cf_alert, + min_api='2019-08-01') as g: + g.custom_command('list', 'databoxedge_alert_list') + g.custom_show_command('show', 'databoxedge_alert_show') + + from ..generated._client_factory import cf_bandwidth_schedule + databoxedge_bandwidth_schedule = CliCommandType( + operations_tmpl='azure.mgmt.databoxedge.operations._bandwidth_schedules_operations#BandwidthSchedulesOperations' + '.{}', + client_factory=cf_bandwidth_schedule) + with self.command_group('databoxedge bandwidth-schedule', databoxedge_bandwidth_schedule, + client_factory=cf_bandwidth_schedule, min_api='2019-08-01') as g: + g.custom_command('list', 'databoxedge_bandwidth_schedule_list') + g.custom_show_command('show', 'databoxedge_bandwidth_schedule_show') + g.custom_command('create', 'databoxedge_bandwidth_schedule_create', supports_no_wait=True) + g.generic_update_command('update', custom_func_name='databoxedge_bandwidth_schedule_update', + supports_no_wait=True) + g.custom_command('delete', 'databoxedge_bandwidth_schedule_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'databoxedge_bandwidth_schedule_show') + + from ..generated._client_factory import cf_job + databoxedge_job = CliCommandType( + operations_tmpl='azure.mgmt.databoxedge.operations._jobs_operations#JobsOperations.{}', + client_factory=cf_job) + with self.command_group('databoxedge', databoxedge_job, client_factory=cf_job, is_preview=True, + min_api='2019-08-01') as g: + g.custom_command('show-job', 'databoxedge_show_job') + + from ..generated._client_factory import cf_node + databoxedge_node = CliCommandType( + operations_tmpl='azure.mgmt.databoxedge.operations._nodes_operations#NodesOperations.{}', + client_factory=cf_node) + with self.command_group('databoxedge', databoxedge_node, client_factory=cf_node, is_preview=True, + min_api='2019-08-01') as g: + g.custom_command('list-node', 'databoxedge_list_node') + + from ..generated._client_factory import cf_order + databoxedge_order = CliCommandType( + operations_tmpl='azure.mgmt.databoxedge.operations._orders_operations#OrdersOperations.{}', + client_factory=cf_order) + with self.command_group('databoxedge order', databoxedge_order, client_factory=cf_order, + min_api='2019-08-01') as g: + g.custom_command('list', 'databoxedge_order_list') + g.custom_show_command('show', 'databoxedge_order_show') + g.custom_command('create', 'databoxedge_order_create', supports_no_wait=True) + g.generic_update_command('update', setter_arg_name='order', custom_func_name='databoxedge_order_update', + supports_no_wait=True) + g.custom_command('delete', 'databoxedge_order_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'databoxedge_order_show') + + from ..generated._client_factory import cf_sku + databoxedge_sku = CliCommandType( + operations_tmpl='azure.mgmt.databoxedge.operations._skus_operations#SkusOperations.{}', + client_factory=cf_sku) + with self.command_group('databoxedge', databoxedge_sku, client_factory=cf_sku, is_preview=True, + min_api='2019-08-01') as g: + g.custom_command('list-sku', 'databoxedge_list_sku') diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/generated/custom.py b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/custom.py new file mode 100644 index 00000000000..cca81597efe --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/generated/custom.py @@ -0,0 +1,331 @@ +# -------------------------------------------------------------------------- +# 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=unused-argument + +from azure.cli.core.util import sdk_no_wait + + +def databoxedge_device_list(client, + resource_group_name=None, + expand=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name, + expand=expand) + return client.list_by_subscription(expand=expand) + + +def databoxedge_device_show(client, + device_name, + resource_group_name): + return client.get(device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_device_create(client, + device_name, + resource_group_name, + location, + tags=None, + sku=None, + etag=None, + data_box_edge_device_status=None, + description=None, + model_description=None, + friendly_name=None, + no_wait=False): + data_box_edge_device = {} + data_box_edge_device['location'] = location + data_box_edge_device['tags'] = tags + data_box_edge_device['sku'] = sku + data_box_edge_device['etag'] = etag + data_box_edge_device['data_box_edge_device_status'] = data_box_edge_device_status + data_box_edge_device['description'] = description + data_box_edge_device['model_description'] = model_description + data_box_edge_device['friendly_name'] = friendly_name + return sdk_no_wait(no_wait, + client.create_or_update, + device_name=device_name, + resource_group_name=resource_group_name, + data_box_edge_device=data_box_edge_device) + + +def databoxedge_device_update(client, + device_name, + resource_group_name, + tags=None): + return client.update(device_name=device_name, + resource_group_name=resource_group_name, + tags=tags) + + +def databoxedge_device_delete(client, + device_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.delete, + device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_device_download_update(client, + device_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.download_updates, + device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_device_install_update(client, + device_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.install_updates, + device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_device_scan_for_update(client, + device_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.scan_for_updates, + device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_device_show_update_summary(client, + device_name, + resource_group_name): + return client.get_update_summary(device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_alert_list(client, + device_name, + resource_group_name): + return client.list_by_data_box_edge_device(device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_alert_show(client, + device_name, + name, + resource_group_name): + return client.get(device_name=device_name, + name=name, + resource_group_name=resource_group_name) + + +def databoxedge_bandwidth_schedule_list(client, + device_name, + resource_group_name): + return client.list_by_data_box_edge_device(device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_bandwidth_schedule_show(client, + device_name, + name, + resource_group_name): + return client.get(device_name=device_name, + name=name, + resource_group_name=resource_group_name) + + +def databoxedge_bandwidth_schedule_create(client, + device_name, + name, + resource_group_name, + start, + stop, + rate_in_mbps, + days, + no_wait=False): + parameters = {} + parameters['start'] = start + parameters['stop'] = stop + parameters['rate_in_mbps'] = rate_in_mbps + parameters['days'] = days + return sdk_no_wait(no_wait, + client.create_or_update, + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + parameters=parameters) + + +def databoxedge_bandwidth_schedule_update(instance, + device_name, + name, + resource_group_name, + start, + stop, + rate_in_mbps, + days, + no_wait=False): + if start is not None: + instance.start = start + if stop is not None: + instance.stop = stop + if rate_in_mbps is not None: + instance.rate_in_mbps = rate_in_mbps + if days is not None: + instance.days = days + return instance + + +def databoxedge_bandwidth_schedule_delete(client, + device_name, + name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.delete, + device_name=device_name, + name=name, + resource_group_name=resource_group_name) + + +def databoxedge_show_job(client, + device_name, + name, + resource_group_name): + return client.get(device_name=device_name, + name=name, + resource_group_name=resource_group_name) + + +def databoxedge_list_node(client, + device_name, + resource_group_name): + return client.list_by_data_box_edge_device(device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_order_list(client, + device_name, + resource_group_name): + return client.list_by_data_box_edge_device(device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_order_show(client, + device_name, + resource_group_name): + return client.get(device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_order_create(client, + device_name, + resource_group_name, + address_line1, + postal_code, + city, + state, + country, + contact_person, + company_name, + phone, + email_list, + status=None, + comments=None, + address_line2=None, + address_line3=None, + no_wait=False): + order = {} + order['current_status'] = {} + order['current_status']['status'] = status + order['current_status']['comments'] = comments + order['shipping_address'] = {} + order['shipping_address']['address_line1'] = address_line1 + order['shipping_address']['address_line2'] = address_line2 + order['shipping_address']['address_line3'] = address_line3 + order['shipping_address']['postal_code'] = postal_code + order['shipping_address']['city'] = city + order['shipping_address']['state'] = state + order['shipping_address']['country'] = country + order['contact_information'] = {} + order['contact_information']['contact_person'] = contact_person + order['contact_information']['company_name'] = company_name + order['contact_information']['phone'] = phone + order['contact_information']['email_list'] = email_list + return sdk_no_wait(no_wait, + client.create_or_update, + device_name=device_name, + resource_group_name=resource_group_name, + order=order) + + +def databoxedge_order_update(instance, + device_name, + resource_group_name, + status=None, + comments=None, + address_line1=None, + address_line2=None, + address_line3=None, + postal_code=None, + city=None, + state=None, + country=None, + contact_person=None, + company_name=None, + phone=None, + email_list=None, + no_wait=False): + if status is not None: + instance.current_status.status = status + if comments is not None: + instance.current_status.comments = comments + if address_line1 is not None: + instance.shipping_address.address_line1 = address_line1 + if address_line2 is not None: + instance.shipping_address.address_line2 = address_line2 + if address_line3 is not None: + instance.shipping_address.address_line3 = address_line3 + if postal_code is not None: + instance.shipping_address.postal_code = postal_code + if city is not None: + instance.shipping_address.city = city + if state is not None: + instance.shipping_address.state = state + if country is not None: + instance.shipping_address.country = country + if contact_person is not None: + instance.contact_information.contact_person = contact_person + if company_name is not None: + instance.contact_information.company_name = company_name + if phone is not None: + instance.contact_information.phone = phone + if email_list is not None: + instance.contact_information.email_list = email_list + return instance + + +def databoxedge_order_delete(client, + device_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.delete, + device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_list_sku(client, + filter_=None): + return client.list(filter=filter_) diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/manual/__init__.py b/src/azure-cli/azure/cli/command_modules/databoxedge/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/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/azure-cli/azure/cli/command_modules/databoxedge/manual/_help.py b/src/azure-cli/azure/cli/command_modules/databoxedge/manual/_help.py new file mode 100644 index 00000000000..1144b164a69 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/manual/_help.py @@ -0,0 +1,318 @@ +# -------------------------------------------------------------------------- +# 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 knack.help_files import helps + + +helps['databoxedge'] = """ + type: group + short-summary: Support data box edge device and management +""" + +helps['databoxedge device'] = """ + type: group + short-summary: Manage device with databoxedge +""" + +helps['databoxedge device list'] = """ + type: command + short-summary: "Get all the Data Box Edge/Data Box Gateway devices in a resource group or in a subscription." + examples: + - name: Get all the Data Box Edge/Data Box Gateway devices in a resource group. + text: |- + az databoxedge device list --resource-group "GroupForEdgeAutomation" + - name: Get all the Data Box Edge/Data Box Gateway devices in a subscription. + text: |- + az databoxedge device list +""" + +helps['databoxedge device show'] = """ + type: command + short-summary: "Get the properties of the Data Box Edge/Data Box Gateway device." + examples: + - name: Get the properties of the Data Box Edge/Data Box Gateway device. + text: |- + az databoxedge device show --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device create'] = """ + type: command + short-summary: "Create a Data Box Edge/Data Box Gateway resource." + examples: + - name: Create a Data Box Edge resource. + text: |- + az databoxedge device create --location "eastus" --sku "Edge" --name \ +"testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device update'] = """ + type: command + short-summary: "Modify a Data Box Edge/Data Box Gateway resource." + examples: + - name: Modify a Data Box Edge/Data Box Gateway resource. + text: |- + az databoxedge device update --name "testedgedevice" --tags Key1="value1" Key2="value2" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device delete'] = """ + type: command + short-summary: "Delete the Data Box Edge/Data Box Gateway device." + examples: + - name: Delete the Data Box Edge/Data Box Gateway device. + text: |- + az databoxedge device delete --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device download-update'] = """ + type: command + short-summary: "Download the updates on a Data Box Edge/Data Box Gateway device." + examples: + - name: Download the updates on a Data Box Edge/Data Box Gateway device. + text: |- + az databoxedge device download-update --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device install-update'] = """ + type: command + short-summary: "Install the updates on the Data Box Edge/Data Box Gateway device." + examples: + - name: Install the updates on the Data Box Edge/Data Box Gateway device. + text: |- + az databoxedge device install-update --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device scan-for-update'] = """ + type: command + short-summary: "Scan for updates on a Data Box Edge/Data Box Gateway device." + examples: + - name: Scan for updates on a Data Box Edge/Data Box Gateway device. + text: |- + az databoxedge device scan-for-update --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device show-update-summary'] = """ + type: command + short-summary: "Get information about the availability of updates based on the last scan of the device. It also \ +gets information about any ongoing download or install jobs on the device." + examples: + - name: Get update summary of the device. + text: |- + az databoxedge device show-update-summary --name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge device wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge device is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge device is successfully created. + text: |- + az databoxedge device wait --name "testedgedevice" --resource-group "GroupForEdgeAutomation" --created + - name: Pause executing next line of CLI script until the databoxedge device is successfully deleted. + text: |- + az databoxedge device wait --name "testedgedevice" --resource-group "GroupForEdgeAutomation" --deleted +""" + +helps['databoxedge alert'] = """ + type: group + short-summary: Manage alert with databoxedge +""" + +helps['databoxedge alert list'] = """ + type: command + short-summary: "Get all the alerts for a Data Box Edge/Data Box Gateway device." + examples: + - name: Get all the alerts for a Data Box Edge/Data Box Gateway device. + text: |- + az databoxedge alert list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge alert show'] = """ + type: command + short-summary: "Get an alert by name." + examples: + - name: Get an alert by name. + text: |- + az databoxedge alert show --name "159a00c7-8543-4343-9435-263ac87df3bb" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge bandwidth-schedule'] = """ + type: group + short-summary: Manage bandwidth schedule with databoxedge +""" + +helps['databoxedge bandwidth-schedule list'] = """ + type: command + short-summary: "Get all the bandwidth schedules for a Data Box Edge/Data Box Gateway device." + examples: + - name: Get all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + text: |- + az databoxedge bandwidth-schedule list --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge bandwidth-schedule show'] = """ + type: command + short-summary: "Get the properties of the specified bandwidth schedule." + examples: + - name: Get the properties of the specified bandwidth schedule. + text: |- + az databoxedge bandwidth-schedule show --name "bandwidth-1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge bandwidth-schedule create'] = """ + type: command + short-summary: "Create a bandwidth schedule." + examples: + - name: Create a bandwidth schedule. + text: |- + az databoxedge bandwidth-schedule create --name "bandwidth-1" --device-name "testedgedevice" --days \ +"Sunday" "Monday" --rate-in-mbps 100 --start "0:0:0" --stop "13:59:0" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge bandwidth-schedule update'] = """ + type: command + short-summary: "Update a bandwidth schedule." + examples: + - name: Update a bandwidth schedule. + text: az databoxedge bandwidth-schedule update --name "bandwidth-1" --device-name "testedgedevice" --rate-in-mbps 150 --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge bandwidth-schedule delete'] = """ + type: command + short-summary: "Delete the specified bandwidth schedule." + examples: + - name: Delete the specified bandwidth schedule. + text: |- + az databoxedge bandwidth-schedule delete --name "bandwidth-1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge bandwidth-schedule wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge bandwidth-schedule is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge bandwidth-schedule is successfully \ +created. + text: |- + az databoxedge bandwidth-schedule wait --name "bandwidth-1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" --created + - name: Pause executing next line of CLI script until the databoxedge bandwidth-schedule is successfully \ +updated. + text: |- + az databoxedge bandwidth-schedule wait --name "bandwidth-1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" --updated + - name: Pause executing next line of CLI script until the databoxedge bandwidth-schedule is successfully \ +deleted. + text: |- + az databoxedge bandwidth-schedule wait --name "bandwidth-1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" --deleted +""" + +helps['databoxedge show-job'] = """ + type: command + short-summary: "Get the details of a specified job on a Data Box Edge/Data Box Gateway device." + examples: + - name: Get the details of a specified job on a Data Box Edge/Data Box Gateway device. + text: |- + az databoxedge show-job --name "159a00c7-8543-4343-9435-263ac87df3bb" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge list-node'] = """ + type: command + short-summary: "Get all the nodes currently configured under this Data Box Edge device." + examples: + - name: Get all the nodes currently configured under this Data Box Edge device. + text: |- + az databoxedge list-node --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge order'] = """ + type: group + short-summary: Manage order with databoxedge +""" + +helps['databoxedge order list'] = """ + type: command + short-summary: "List all the orders related to a Data Box Edge/Data Box Gateway device." + examples: + - name: List all the orders related to a Data Box Edge/Data Box Gateway device. + text: |- + az databoxedge order list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge order show'] = """ + type: command + short-summary: "Get a specific order by name." + examples: + - name: Get a specific order by name. + text: |- + az databoxedge order show --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge order create'] = """ + type: command + short-summary: "Create an order." + examples: + - name: Create an order. + text: |- + az databoxedge order create --device-name "testedgedevice" --company-name "Microsoft" --contact-person \ +"John Mcclane" --email-list "john@microsoft.com" --phone "(800) 426-9400" --address-line1 "Microsoft Corporation" \ +--address-line2 "One Microsoft Way" --address-line3 "Redmond" --city "WA" --country "United States" --postal-code \ +"98052" --state "WA" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge order update'] = """ + type: command + short-summary: "Update an order." + examples: + - name: Update an order + text: az databoxedge order update --phone "(800) 426-9432" +""" + +helps['databoxedge order delete'] = """ + type: command + short-summary: "Delete the order related to the device." + examples: + - name: Delete the order related to the device. + text: |- + az databoxedge order delete --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge order wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge order is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge order is successfully created. + text: |- + az databoxedge order wait --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--created + - name: Pause executing next line of CLI script until the databoxedge order is successfully updated. + text: |- + az databoxedge order wait --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--updated + - name: Pause executing next line of CLI script until the databoxedge order is successfully deleted. + text: |- + az databoxedge order wait --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--deleted +""" + +helps['databoxedge list-sku'] = """ + type: command + short-summary: "List all the available Skus in the region and information related to them." + examples: + - name: List all the available Skus in the region and information related to them. + text: |- + az databoxedge list-sku +""" diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/manual/_params.py b/src/azure-cli/azure/cli/command_modules/databoxedge/manual/_params.py new file mode 100644 index 00000000000..6073d1602c8 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/manual/_params.py @@ -0,0 +1,19 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.cli.core.commands.parameters import get_enum_type + + +def load_arguments(self, _): + with self.argument_context('databoxedge device create') as c: + t_sku_name, t_device_status = self.get_models('SkuName', 'DataBoxEdgeDeviceStatus') + c.argument('sku', help='The SKU type.', arg_type=get_enum_type(t_sku_name)) + c.argument('data_box_edge_device_status', options_list=['--status'], arg_type=get_enum_type(t_device_status), + help='The status of the Data Box Edge/Gateway device.') diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/manual/custom.py b/src/azure-cli/azure/cli/command_modules/databoxedge/manual/custom.py new file mode 100644 index 00000000000..79079c5b218 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/manual/custom.py @@ -0,0 +1,118 @@ +# -------------------------------------------------------------------------- +# 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=unused-argument + +from azure.cli.core.util import sdk_no_wait + + +def databoxedge_device_create(client, + device_name, + resource_group_name, + location, + tags=None, + sku=None, + etag=None, + data_box_edge_device_status=None, + description=None, + model_description=None, + friendly_name=None, + no_wait=False): + data_box_edge_device = {} + data_box_edge_device['location'] = location + data_box_edge_device['tags'] = tags + data_box_edge_device['etag'] = etag + data_box_edge_device['data_box_edge_device_status'] = data_box_edge_device_status + data_box_edge_device['description'] = description + data_box_edge_device['model_description'] = model_description + data_box_edge_device['friendly_name'] = friendly_name + if sku: + data_box_edge_device['sku'] = {} + data_box_edge_device['sku']['name'] = sku + return sdk_no_wait(no_wait, + client.create_or_update, + device_name=device_name, + resource_group_name=resource_group_name, + data_box_edge_device=data_box_edge_device) + + +def databoxedge_device_update(client, + device_name, + resource_group_name, + tags=None): + if tags is None: + return client.get(device_name=device_name, + resource_group_name=resource_group_name) + parameters = {'tags': tags} + return client.update(device_name=device_name, + resource_group_name=resource_group_name, + parameters=parameters) + + +def databoxedge_bandwidth_schedule_update(instance, + device_name, + name, + resource_group_name, + start=None, + stop=None, + rate_in_mbps=None, + days=None, + no_wait=False): + if start is not None: + instance.start = start + if stop is not None: + instance.stop = stop + if rate_in_mbps is not None: + instance.rate_in_mbps = rate_in_mbps + if days is not None: + instance.days = days + return instance + + +def databoxedge_order_create(client, + device_name, + resource_group_name, + address_line1, + postal_code, + city, + state, + country, + contact_person, + company_name, + phone, + email_list, + status=None, + comments=None, + address_line2=None, + address_line3=None, + no_wait=False): + order = {} + if status: + order['current_status'] = {} + order['current_status']['status'] = status + order['current_status']['comments'] = comments + order['shipping_address'] = {} + order['shipping_address']['address_line1'] = address_line1 + order['shipping_address']['address_line2'] = address_line2 + order['shipping_address']['address_line3'] = address_line3 + order['shipping_address']['postal_code'] = postal_code + order['shipping_address']['city'] = city + order['shipping_address']['state'] = state + order['shipping_address']['country'] = country + order['contact_information'] = {} + order['contact_information']['contact_person'] = contact_person + order['contact_information']['company_name'] = company_name + order['contact_information']['phone'] = phone + order['contact_information']['email_list'] = email_list + return sdk_no_wait(no_wait, + client.create_or_update, + device_name=device_name, + resource_group_name=resource_group_name, + order=order) diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/report.md b/src/azure-cli/azure/cli/command_modules/databoxedge/report.md new file mode 100644 index 00000000000..d0e854f8bb3 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/report.md @@ -0,0 +1,429 @@ +# Azure CLI Module Creation Report + +## EXTENSION +|CLI Extension|Command Groups| +|---------|------------| +|az databoxedge|[groups](#CommandGroups) + +## GROUPS +### Command groups in `az databoxedge` extension +|CLI Command Group|Group Swagger name|Commands| +|---------|------------|--------| +|az databoxedge device|Devices|[commands](#CommandsInDevices)| +|az databoxedge alert|Alerts|[commands](#CommandsInAlerts)| +|az databoxedge bandwidth-schedule|BandwidthSchedules|[commands](#CommandsInBandwidthSchedules)| +|az databoxedge|Jobs|[commands](#CommandsInJobs)| +|az databoxedge|Nodes|[commands](#CommandsInNodes)| +|az databoxedge order|Orders|[commands](#CommandsInOrders)| +|az databoxedge|Skus|[commands](#CommandsInSkus)| + +## COMMANDS +### Commands in `az databoxedge` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge show-job](#JobsGet)|Get|[Parameters](#ParametersJobsGet)|[Example](#ExamplesJobsGet)| + +### Commands in `az databoxedge` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge list-node](#NodesListByDataBoxEdgeDevice)|ListByDataBoxEdgeDevice|[Parameters](#ParametersNodesListByDataBoxEdgeDevice)|[Example](#ExamplesNodesListByDataBoxEdgeDevice)| + +### Commands in `az databoxedge` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge list-sku](#SkusList)|List|[Parameters](#ParametersSkusList)|[Example](#ExamplesSkusList)| + +### Commands in `az databoxedge alert` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge alert list](#AlertsListByDataBoxEdgeDevice)|ListByDataBoxEdgeDevice|[Parameters](#ParametersAlertsListByDataBoxEdgeDevice)|[Example](#ExamplesAlertsListByDataBoxEdgeDevice)| +|[az databoxedge alert show](#AlertsGet)|Get|[Parameters](#ParametersAlertsGet)|[Example](#ExamplesAlertsGet)| + +### Commands in `az databoxedge bandwidth-schedule` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge bandwidth-schedule list](#BandwidthSchedulesListByDataBoxEdgeDevice)|ListByDataBoxEdgeDevice|[Parameters](#ParametersBandwidthSchedulesListByDataBoxEdgeDevice)|[Example](#ExamplesBandwidthSchedulesListByDataBoxEdgeDevice)| +|[az databoxedge bandwidth-schedule show](#BandwidthSchedulesGet)|Get|[Parameters](#ParametersBandwidthSchedulesGet)|[Example](#ExamplesBandwidthSchedulesGet)| +|[az databoxedge bandwidth-schedule create](#BandwidthSchedulesCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersBandwidthSchedulesCreateOrUpdate#Create)|[Example](#ExamplesBandwidthSchedulesCreateOrUpdate#Create)| +|[az databoxedge bandwidth-schedule update](#BandwidthSchedulesCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersBandwidthSchedulesCreateOrUpdate#Update)|Not Found| +|[az databoxedge bandwidth-schedule delete](#BandwidthSchedulesDelete)|Delete|[Parameters](#ParametersBandwidthSchedulesDelete)|[Example](#ExamplesBandwidthSchedulesDelete)| + +### Commands in `az databoxedge device` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge device list](#DevicesListByResourceGroup)|ListByResourceGroup|[Parameters](#ParametersDevicesListByResourceGroup)|[Example](#ExamplesDevicesListByResourceGroup)| +|[az databoxedge device list](#DevicesListBySubscription)|ListBySubscription|[Parameters](#ParametersDevicesListBySubscription)|[Example](#ExamplesDevicesListBySubscription)| +|[az databoxedge device show](#DevicesGet)|Get|[Parameters](#ParametersDevicesGet)|[Example](#ExamplesDevicesGet)| +|[az databoxedge device create](#DevicesCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersDevicesCreateOrUpdate#Create)|[Example](#ExamplesDevicesCreateOrUpdate#Create)| +|[az databoxedge device update](#DevicesUpdate)|Update|[Parameters](#ParametersDevicesUpdate)|[Example](#ExamplesDevicesUpdate)| +|[az databoxedge device delete](#DevicesDelete)|Delete|[Parameters](#ParametersDevicesDelete)|[Example](#ExamplesDevicesDelete)| +|[az databoxedge device download-update](#DevicesDownloadUpdates)|DownloadUpdates|[Parameters](#ParametersDevicesDownloadUpdates)|[Example](#ExamplesDevicesDownloadUpdates)| +|[az databoxedge device install-update](#DevicesInstallUpdates)|InstallUpdates|[Parameters](#ParametersDevicesInstallUpdates)|[Example](#ExamplesDevicesInstallUpdates)| +|[az databoxedge device scan-for-update](#DevicesScanForUpdates)|ScanForUpdates|[Parameters](#ParametersDevicesScanForUpdates)|[Example](#ExamplesDevicesScanForUpdates)| +|[az databoxedge device show-update-summary](#DevicesGetUpdateSummary)|GetUpdateSummary|[Parameters](#ParametersDevicesGetUpdateSummary)|[Example](#ExamplesDevicesGetUpdateSummary)| + +### Commands in `az databoxedge order` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge order list](#OrdersListByDataBoxEdgeDevice)|ListByDataBoxEdgeDevice|[Parameters](#ParametersOrdersListByDataBoxEdgeDevice)|[Example](#ExamplesOrdersListByDataBoxEdgeDevice)| +|[az databoxedge order show](#OrdersGet)|Get|[Parameters](#ParametersOrdersGet)|[Example](#ExamplesOrdersGet)| +|[az databoxedge order create](#OrdersCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersOrdersCreateOrUpdate#Create)|[Example](#ExamplesOrdersCreateOrUpdate#Create)| +|[az databoxedge order update](#OrdersCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersOrdersCreateOrUpdate#Update)|Not Found| +|[az databoxedge order delete](#OrdersDelete)|Delete|[Parameters](#ParametersOrdersDelete)|[Example](#ExamplesOrdersDelete)| + + +## COMMAND DETAILS + +### group `az databoxedge` +#### Command `az databoxedge show-job` + +##### Example +``` +az databoxedge show-job --name "159a00c7-8543-4343-9435-263ac87df3bb" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The job name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### group `az databoxedge` +#### Command `az databoxedge list-node` + +##### Example +``` +az databoxedge list-node --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### group `az databoxedge` +#### Command `az databoxedge list-sku` + +##### Example +``` +az databoxedge list-sku +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--filter**|string|Specify $filter='location eq ' to filter on location.|filter|$filter| + +### group `az databoxedge alert` +#### Command `az databoxedge alert list` + +##### Example +``` +az databoxedge alert list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge alert show` + +##### Example +``` +az databoxedge alert show --name "159a00c7-8543-4343-9435-263ac87df3bb" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The alert name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### group `az databoxedge bandwidth-schedule` +#### Command `az databoxedge bandwidth-schedule list` + +##### Example +``` +az databoxedge bandwidth-schedule list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge bandwidth-schedule show` + +##### Example +``` +az databoxedge bandwidth-schedule show --name "bandwidth-1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The bandwidth schedule name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge bandwidth-schedule create` + +##### Example +``` +az databoxedge bandwidth-schedule create --name "bandwidth-1" --device-name "testedgedevice" --days "Sunday" "Monday" \ +--rate-in-mbps 100 --start "0:0:0" --stop "13:59:0" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The bandwidth schedule name which needs to be added/updated.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--start**|string|The start time of the schedule in UTC.|start|start| +|**--stop**|string|The stop time of the schedule in UTC.|stop|stop| +|**--rate-in-mbps**|integer|The bandwidth rate in Mbps.|rate_in_mbps|rateInMbps| +|**--days**|array|The days of the week when this schedule is applicable.|days|days| + +#### Command `az databoxedge bandwidth-schedule update` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The bandwidth schedule name which needs to be added/updated.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--start**|string|The start time of the schedule in UTC.|start|start| +|**--stop**|string|The stop time of the schedule in UTC.|stop|stop| +|**--rate-in-mbps**|integer|The bandwidth rate in Mbps.|rate_in_mbps|rateInMbps| +|**--days**|array|The days of the week when this schedule is applicable.|days|days| + +#### Command `az databoxedge bandwidth-schedule delete` + +##### Example +``` +az databoxedge bandwidth-schedule delete --name "bandwidth-1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The bandwidth schedule name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### group `az databoxedge device` +#### Command `az databoxedge device list` + +##### Example +``` +az databoxedge device list --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--expand**|string|Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= to populate the next page in the list.|expand|$expand| + +#### Command `az databoxedge device list` + +##### Example +``` +az databoxedge device list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +#### Command `az databoxedge device show` + +##### Example +``` +az databoxedge device show --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge device create` + +##### Example +``` +az databoxedge device create --location "eastus" --sku name="Edge" tier="Standard" --name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--location**|string|The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed.|location|location| +|**--tags**|dictionary|The list of tags that describe the device. These tags can be used to view and group this device (across resource groups).|tags|tags| +|**--sku**|object|The SKU type.|sku|sku| +|**--etag**|string|The etag for the devices.|etag|etag| +|**--data-box-edge-device-status**|choice|The status of the Data Box Edge/Gateway device.|data_box_edge_device_status|dataBoxEdgeDeviceStatus| +|**--description**|string|The Description of the Data Box Edge/Gateway device.|description|description| +|**--model-description**|string|The description of the Data Box Edge/Gateway device model.|model_description|modelDescription| +|**--friendly-name**|string|The Data Box Edge/Gateway device name.|friendly_name|friendlyName| + +#### Command `az databoxedge device update` + +##### Example +``` +az databoxedge device update --name "testedgedevice" --tags Key1="value1" Key2="value2" --resource-group \ +"GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--tags**|dictionary|The tags attached to the Data Box Edge/Gateway resource.|tags|tags| + +#### Command `az databoxedge device delete` + +##### Example +``` +az databoxedge device delete --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge device download-update` + +##### Example +``` +az databoxedge device download-update --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge device install-update` + +##### Example +``` +az databoxedge device install-update --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge device scan-for-update` + +##### Example +``` +az databoxedge device scan-for-update --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge device show-update-summary` + +##### Example +``` +az databoxedge device show-update-summary --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### group `az databoxedge order` +#### Command `az databoxedge order list` + +##### Example +``` +az databoxedge order list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge order show` + +##### Example +``` +az databoxedge order show --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge order create` + +##### Example +``` +az databoxedge order create --device-name "testedgedevice" --company-name "Microsoft" --contact-person "John Mcclane" \ +--email-list "john@microsoft.com" --phone "(800) 426-9400" --address-line1 "Microsoft Corporation" --address-line2 \ +"One Microsoft Way" --address-line3 "Redmond" --city "WA" --country "United States" --postal-code "98052" --state "WA" \ +--resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The order details of a device.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--status**|choice|Status of the order as per the allowed status types.|status|status| +|**--comments**|string|Comments related to this status change.|comments|comments| +|**--address-line1**|string|The address line1.|address_line1|addressLine1| +|**--address-line2**|string|The address line2.|address_line2|addressLine2| +|**--address-line3**|string|The address line3.|address_line3|addressLine3| +|**--postal-code**|string|The postal code.|postal_code|postalCode| +|**--city**|string|The city name.|city|city| +|**--state**|string|The state name.|state|state| +|**--country**|string|The country name.|country|country| +|**--contact-person**|string|The contact person name.|contact_person|contactPerson| +|**--company-name**|string|The name of the company.|company_name|companyName| +|**--phone**|string|The phone number.|phone|phone| +|**--email-list**|array|The email list.|email_list|emailList| + +#### Command `az databoxedge order update` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The order details of a device.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--status**|choice|Status of the order as per the allowed status types.|status|status| +|**--comments**|string|Comments related to this status change.|comments|comments| +|**--address-line1**|string|The address line1.|address_line1|addressLine1| +|**--address-line2**|string|The address line2.|address_line2|addressLine2| +|**--address-line3**|string|The address line3.|address_line3|addressLine3| +|**--postal-code**|string|The postal code.|postal_code|postalCode| +|**--city**|string|The city name.|city|city| +|**--state**|string|The state name.|state|state| +|**--country**|string|The country name.|country|country| +|**--contact-person**|string|The contact person name.|contact_person|contactPerson| +|**--company-name**|string|The name of the company.|company_name|companyName| +|**--phone**|string|The phone number.|phone|phone| +|**--email-list**|array|The email list.|email_list|emailList| + +#### Command `az databoxedge order delete` + +##### Example +``` +az databoxedge order delete --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/__init__.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/__init__.py new file mode 100644 index 00000000000..70488e93851 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/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/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/__init__.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/__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/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/example_steps.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/example_steps.py new file mode 100644 index 00000000000..cc5613e9873 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/example_steps.py @@ -0,0 +1,284 @@ +# -------------------------------------------------------------------------- +# 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=unused-argument + +from .. import try_manual + + +# EXAMPLE: /Devices/put/DataBoxEdgeDevicePut +@try_manual +def step_device_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device create ' + '--location "eastus" ' + '--sku "Edge" ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/get/DataBoxEdgeDeviceGetByName +@try_manual +def step_device_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device show ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/get/DataBoxEdgeDeviceGetByResourceGroup +@try_manual +def step_device_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/get/DataBoxEdgeDeviceGetBySubscription +@try_manual +def step_device_list2(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device list ' + '-g ""', + checks=checks) + + +# EXAMPLE: /Devices/get/UpdateSummaryGet +@try_manual +def step_device_show_update_summary(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device show-update-summary ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/patch/DataBoxEdgeDevicePatch +@try_manual +def step_device_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device update ' + '--name "{myDevice}" ' + '--tags Key1="value1" Key2="value2" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/post/DownloadUpdatesPost +@try_manual +def step_device_download_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device download-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/post/InstallUpdatesPost +@try_manual +def step_device_install_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device install-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/post/ScanForUpdatesPost +@try_manual +def step_device_scan_for_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device scan-for-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Alerts/get/AlertGet +@try_manual +def step_alert_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge alert show ' + '--name "159a00c7-8543-4343-9435-263ac87df3bb" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Alerts/get/AlertGetAllInDevice +@try_manual +def step_alert_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge alert list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /BandwidthSchedules/put/BandwidthSchedulePut +@try_manual +def step_bandwidth_schedule_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge bandwidth-schedule create ' + '--name "bandwidth-1" ' + '--device-name "{myDevice}" ' + '--days "Sunday" "Monday" ' + '--rate-in-mbps 100 ' + '--start "0:0:0" ' + '--stop "13:59:0" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /BandwidthSchedules/get/BandwidthScheduleGet +@try_manual +def step_bandwidth_schedule_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge bandwidth-schedule show ' + '--name "bandwidth-1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /BandwidthSchedules/get/BandwidthScheduleGetAllInDevice +@try_manual +def step_bandwidth_schedule_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge bandwidth-schedule list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /BandwidthSchedules/delete/BandwidthScheduleDelete +@try_manual +def step_bandwidth_schedule_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge bandwidth-schedule delete -y ' + '--name "bandwidth-1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Jobs/get/JobsGet +@try_manual +def step_show_job(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge show-job ' + '--name "159a00c7-8543-4343-9435-263ac87df3bb" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Nodes/get/NodesGetAllInDevice +@try_manual +def step_list_node(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge list-node ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Orders/put/OrderPut +@try_manual +def step_order_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order create ' + '--device-name "{myDevice}" ' + '--company-name "Microsoft" ' + '--contact-person "John Mcclane" ' + '--email-list "john@microsoft.com" ' + '--phone "(800) 426-9400" ' + '--address-line1 "Microsoft Corporation" ' + '--address-line2 "One Microsoft Way" ' + '--address-line3 "Redmond" ' + '--city "WA" ' + '--country "United States" ' + '--postal-code "98052" ' + '--state "WA" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Orders/get/OrderGet +@try_manual +def step_order_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order show ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Orders/get/OrderGetAllInDevice +@try_manual +def step_order_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Orders/delete/OrderDelete +@try_manual +def step_order_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order delete -y ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/delete/DataBoxEdgeDeviceDelete +@try_manual +def step_device_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device delete -y ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Skus/get/ListSkus +@try_manual +def step_list_sku(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge list-sku', + checks=checks) diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/recordings/test_device_general.yaml b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/recordings/test_device_general.yaml new file mode 100644 index 00000000000..02b1a2292eb --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/recordings/test_device_general.yaml @@ -0,0 +1,448 @@ +interactions: +- request: + body: '{"location": "eastus", "sku": {"name": "Edge", "tier": "Standard"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device create + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --location --sku --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n + \ \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": + \"W/\\\"datetime'2020-12-08T08%3A53%3A14.4640664Z'\\\"_W/\\\"datetime'2020-12-08T08%3A53%3A14.4720717Z'\\\"\",\r\n + \ \"identity\": {\r\n \"type\": \"None\"\r\n },\r\n \"properties\": {\r\n + \ \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": + \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": + 0,\r\n \"resourceMoveDetails\": {\r\n \"operationInProgress\": \"None\"\r\n + \ }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '805' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:53:15 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device show + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n + \ \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": + \"W/\\\"datetime'2020-12-08T08%3A53%3A14.4640664Z'\\\"_W/\\\"datetime'2020-12-08T08%3A53%3A14.4720717Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '687' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:53:17 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01 + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n + \ \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A53%3A14.4640664Z'\\\"_W/\\\"datetime'2020-12-08T08%3A53%3A14.4720717Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '784' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:53:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01 + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n + \ \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A53%3A14.4640664Z'\\\"_W/\\\"datetime'2020-12-08T08%3A53%3A14.4720717Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n + \ \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n + \ },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A53%3A12.8687569Z'\\\"_W/\\\"datetime'2020-12-08T08%3A53%3A12.8747611Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest6dioyesf4l4gpngh3ltw5fm2jwsut4dchb7jwpbd5f4hacf24ne6axxl5bdxkd36csm5/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n + \ \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n + \ },\r\n \"etag\": \"W/\\\"datetime'2020-12-07T09%3A57%3A46.069116Z'\\\"_W/\\\"datetime'2020-12-07T09%3A57%3A46.0751198Z'\\\"\",\r\n + \ \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": + \"c9fd4631-c426-427e-bfda-13038fdcc74f\",\r\n \"tenantId\": \"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a\"\r\n + \ },\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": + \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 1\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yishitest/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testdevice\",\r\n + \ \"name\": \"testdevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n + \ \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n + \ },\r\n \"etag\": \"W/\\\"datetime'2020-11-26T07%3A55%3A22.0431885Z'\\\"_W/\\\"datetime'2020-11-26T07%3A55%3A22.0511943Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yishitest/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3122' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:53:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"tags": {"Key1": "value1", "Key2": "value2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device update + Connection: + - keep-alive + Content-Length: + - '46' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --name --tags --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"Key1\": + \"value1\",\r\n \"Key2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": + \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A53%3A21.6038818Z'\\\"_W/\\\"datetime'2020-12-08T08%3A53%3A21.609886Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0,\r\n \"resourceMoveDetails\": {\r\n \"operationInProgress\": + \"None\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '810' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:53:24 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device show + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"Key1\": + \"value1\",\r\n \"Key2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": + \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A53%3A21.6038818Z'\\\"_W/\\\"datetime'2020-12-08T08%3A53%3A21.609886Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '735' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:53:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Tue, 08 Dec 2020 08:53:34 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:53:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/recordings/test_general_Scenario.yaml b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/recordings/test_general_Scenario.yaml new file mode 100644 index 00000000000..61f2eb2c519 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/recordings/test_general_Scenario.yaml @@ -0,0 +1,45 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge list-sku + Connection: + - keep-alive + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DataBoxEdge/skus?api-version=2019-08-01 + response: + body: + string: '{"value":[{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["eastus2euap"],"locationInfo":[{"location":"eastus2euap","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["eastus2euap"],"locationInfo":[{"location":"eastus2euap","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["centraluseuap"],"locationInfo":[{"location":"centraluseuap","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["centraluseuap"],"locationInfo":[{"location":"centraluseuap","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":[],"zoneDetails":[]}],"restrictions":[]}]}' + headers: + cache-control: + - no-cache + content-length: + - '2396' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:53:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/recordings/test_order_Scenario.yaml b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/recordings/test_order_Scenario.yaml new file mode 100644 index 00000000000..bd76eb35e52 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/recordings/test_order_Scenario.yaml @@ -0,0 +1,520 @@ +interactions: +- request: + body: '{"location": "eastus", "sku": {"name": "Edge", "tier": "Standard"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device create + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --location --sku --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n + \ \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": + \"W/\\\"datetime'2020-12-08T08%3A53%3A12.8687569Z'\\\"_W/\\\"datetime'2020-12-08T08%3A53%3A12.8747611Z'\\\"\",\r\n + \ \"identity\": {\r\n \"type\": \"None\"\r\n },\r\n \"properties\": {\r\n + \ \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": + \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": + 0,\r\n \"resourceMoveDetails\": {\r\n \"operationInProgress\": \"None\"\r\n + \ }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '805' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:53:14 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"contactInformation": {"contactPerson": "John Mcclane", + "companyName": "Microsoft", "phone": "(800) 426-9400", "emailList": ["john@microsoft.com"]}, + "shippingAddress": {"addressLine1": "Microsoft Corporation", "addressLine2": + "One Microsoft Way", "addressLine3": "Redmond", "postalCode": "98052", "city": + "WA", "state": "WA", "country": "United States"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order create + Connection: + - keep-alive + Content-Length: + - '371' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --device-name --company-name --contact-person --email-list --phone --address-line1 + --address-line2 --address-line3 --city --country --postal-code --state --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 08 Dec 2020 08:53:15 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default/operationResults/d035e8aa-5f94-4679-af67-2eadc51c7fcb?api-version=2019-08-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order create + Connection: + - keep-alive + ParameterSetName: + - --device-name --company-name --contact-person --email-list --phone --address-line1 + --address-line2 --address-line3 --city --country --postal-code --state --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default/operationResults/d035e8aa-5f94-4679-af67-2eadc51c7fcb?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 08 Dec 2020 08:53:46 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order create + Connection: + - keep-alive + ParameterSetName: + - --device-name --company-name --contact-person --email-list --phone --address-line1 + --address-line2 --address-line3 --city --country --postal-code --state --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"contactInformation\": {\r\n \"contactPerson\": + \"John Mcclane\",\r\n \"companyName\": \"Microsoft\",\r\n \"phone\": + \"(800) 426-9400\",\r\n \"emailList\": [\r\n \"john@microsoft.com\"\r\n + \ ]\r\n },\r\n \"shippingAddress\": {\r\n \"addressLine1\": + \"Microsoft Corporation\",\r\n \"addressLine2\": \"One Microsoft Way\",\r\n + \ \"addressLine3\": \"Redmond\",\r\n \"postalCode\": \"98052\",\r\n + \ \"city\": \"WA\",\r\n \"state\": \"WA\",\r\n \"country\": + \"United States\"\r\n },\r\n \"currentStatus\": {\r\n \"status\": + \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n + \ \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n },\r\n \"orderHistory\": [\r\n {\r\n \"status\": + \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n + \ \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n }\r\n ],\r\n \"deliveryTrackingInfo\": [],\r\n \"returnTrackingInfo\": + []\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default\",\r\n + \ \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/orders\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1330' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:54:16 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order show + Connection: + - keep-alive + ParameterSetName: + - --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"contactInformation\": {\r\n \"contactPerson\": + \"John Mcclane\",\r\n \"companyName\": \"Microsoft\",\r\n \"phone\": + \"(800) 426-9400\",\r\n \"emailList\": [\r\n \"john@microsoft.com\"\r\n + \ ]\r\n },\r\n \"shippingAddress\": {\r\n \"addressLine1\": + \"Microsoft Corporation\",\r\n \"addressLine2\": \"One Microsoft Way\",\r\n + \ \"addressLine3\": \"Redmond\",\r\n \"postalCode\": \"98052\",\r\n + \ \"city\": \"WA\",\r\n \"state\": \"WA\",\r\n \"country\": + \"United States\"\r\n },\r\n \"currentStatus\": {\r\n \"status\": + \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n + \ \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n },\r\n \"orderHistory\": [\r\n {\r\n \"status\": + \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n + \ \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n }\r\n ],\r\n \"deliveryTrackingInfo\": [],\r\n \"returnTrackingInfo\": + []\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default\",\r\n + \ \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/orders\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1330' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:54:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order list + Connection: + - keep-alive + ParameterSetName: + - --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders?api-version=2019-08-01 + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"contactInformation\": + {\r\n \"contactPerson\": \"John Mcclane\",\r\n \"companyName\": + \"Microsoft\",\r\n \"phone\": \"(800) 426-9400\",\r\n \"emailList\": + [\r\n \"john@microsoft.com\"\r\n ]\r\n },\r\n \"shippingAddress\": + {\r\n \"addressLine1\": \"Microsoft Corporation\",\r\n \"addressLine2\": + \"One Microsoft Way\",\r\n \"addressLine3\": \"Redmond\",\r\n \"postalCode\": + \"98052\",\r\n \"city\": \"WA\",\r\n \"state\": \"WA\",\r\n + \ \"country\": \"United States\"\r\n },\r\n \"currentStatus\": + {\r\n \"status\": \"Untracked\",\r\n \"updateDateTime\": + \"0001-01-01T00:00:00Z\",\r\n \"comments\": \"Initialising Order + with Untracked status\",\r\n \"additionalOrderDetails\": {}\r\n },\r\n + \ \"orderHistory\": [\r\n {\r\n \"status\": \"Untracked\",\r\n + \ \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n \"comments\": + \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n }\r\n ],\r\n \"deliveryTrackingInfo\": [],\r\n + \ \"returnTrackingInfo\": []\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default\",\r\n + \ \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/orders\"\r\n + \ }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1515' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:54:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 08 Dec 2020 08:54:22 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default/operationResults/f148c4f0-6521-4039-803a-9f847a6f79e6?api-version=2019-08-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order delete + Connection: + - keep-alive + ParameterSetName: + - -y --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default/operationResults/f148c4f0-6521-4039-803a-9f847a6f79e6?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Tue, 08 Dec 2020 08:54:53 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order list + Connection: + - keep-alive + ParameterSetName: + - --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders?api-version=2019-08-01 + response: + body: + string: "{\r\n \"value\": []\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '19' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:54:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Tue, 08 Dec 2020 08:55:03 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 204 + message: No Content +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_device_scenario.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_device_scenario.py new file mode 100644 index 00000000000..fb1c43b9922 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_device_scenario.py @@ -0,0 +1,99 @@ +# -------------------------------------------------------------------------- +# 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 os +from azure.cli.testsdk.checkers import JMESPathCheckGreaterThan +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_device_create +from .example_steps import step_device_list +from .example_steps import step_device_list2 +from .example_steps import step_device_update +from .example_steps import step_device_show +from .example_steps import step_device_delete +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_general +@try_manual +def setup_general(test, rg): + pass + + +# Env cleanup_general +@try_manual +def cleanup_general(test, rg): + pass + + +# Testcase: general +@try_manual +def call_general(test, rg): + setup_general(test, rg) + step_device_create(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_device_show(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_device_list(test, rg, checks=[ + test.check('length(@)', 1), + ]) + step_device_list2(test, rg, checks=[ + JMESPathCheckGreaterThan('length(@)', 0), + ]) + step_device_update(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + test.check("tags.Key1", "value1", case_sensitive=False), + test.check("tags.Key2", "value2", case_sensitive=False), + ]) + step_device_show(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_device_delete(test, rg, checks=[]) + step_device_list(test, rg, checks=[ + test.check('length(@)', 0), + ]) + cleanup_general(test, rg) + + +# Test class for general +@try_manual +class DevicegeneralTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_GroupForEdgeAutomation'[:7], key='rg', parameter_name='rg') + def test_device_general(self, rg): + + self.kwargs.update({ + 'myDevice': 'testedgedevice', + }) + + call_general(self, rg) + calc_coverage(__file__) + raise_if() diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_device_scenario_coverage.md b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_device_scenario_coverage.md new file mode 100644 index 00000000000..a689ff717da --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_device_scenario_coverage.md @@ -0,0 +1,8 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +|step_device_create|successed||||2020-12-08 08:53:08.187377|2020-12-08 08:53:15.694106| +|step_device_show|successed||||2020-12-08 08:53:24.625022|2020-12-08 08:53:27.072164| +|step_device_list|successed||||2020-12-08 08:53:35.316539|2020-12-08 08:53:35.803951| +|step_device_list2|successed||||2020-12-08 08:53:18.661886|2020-12-08 08:53:19.430990| +|step_device_update|successed||||2020-12-08 08:53:19.430990|2020-12-08 08:53:24.624053| +|step_device_delete|successed||||2020-12-08 08:53:27.072164|2020-12-08 08:53:35.316539| +Coverage: 6/6 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_general_scenario.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_general_scenario.py new file mode 100644 index 00000000000..acc1b26d3ba --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_general_scenario.py @@ -0,0 +1,59 @@ +# -------------------------------------------------------------------------- +# 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 os +from azure.cli.testsdk.checkers import JMESPathCheckGreaterThan +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_list_sku +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_scenario +@try_manual +def setup_scenario(test, rg): + pass + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test, rg): + pass + + +# Testcase: Scenario +@try_manual +def call_scenario(test, rg): + setup_scenario(test, rg) + step_list_sku(test, rg, checks=[JMESPathCheckGreaterThan('length(@)', 0)]) + cleanup_scenario(test, rg) + + +# Test class for Scenario +@try_manual +class GeneralScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_GroupForEdgeAutomation'[:7], key='rg', parameter_name='rg') + def test_general_Scenario(self, rg): + + self.kwargs.update({ + 'myDevice': 'testedgedevice', + }) + + call_scenario(self, rg) + calc_coverage(__file__) + raise_if() diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_general_scenario_coverage.md b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_general_scenario_coverage.md new file mode 100644 index 00000000000..6a091593ade --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_general_scenario_coverage.md @@ -0,0 +1,3 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +|step_list_sku|successed||||2020-12-08 08:53:08.229344|2020-12-08 08:53:08.585716| +Coverage: 1/1 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_order_scenario.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_order_scenario.py new file mode 100644 index 00000000000..d5261fa1d2c --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_order_scenario.py @@ -0,0 +1,79 @@ +# -------------------------------------------------------------------------- +# 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 os +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_device_create +from .example_steps import step_device_delete +from .example_steps import step_order_create +from .example_steps import step_order_show +from .example_steps import step_order_list +from .example_steps import step_order_delete +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_scenario +@try_manual +def setup_scenario(test, rg): + step_device_create(test, rg) + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test, rg): + step_device_delete(test, rg) + + +# Testcase: Scenario +@try_manual +def call_scenario(test, rg): + setup_scenario(test, rg) + step_order_create(test, rg, checks=[ + test.check("contactInformation.companyName", "Microsoft", case_sensitive=False), + test.check("contactInformation.contactPerson", "John Mcclane", case_sensitive=False), + test.check("shippingAddress.country", "United States", case_sensitive=False), + ]) + step_order_show(test, rg, checks=[ + test.check("contactInformation.companyName", "Microsoft", case_sensitive=False), + test.check("contactInformation.contactPerson", "John Mcclane", case_sensitive=False), + test.check("shippingAddress.country", "United States", case_sensitive=False), + ]) + step_order_list(test, rg, checks=[ + test.check('length(@)', 1), + ]) + step_order_delete(test, rg, checks=[]) + step_order_list(test, rg, checks=[ + test.check('length(@)', 0), + ]) + cleanup_scenario(test, rg) + + +# Test class for Scenario +@try_manual +class OrderScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_GroupForEdgeAutomation'[:7], key='rg', parameter_name='rg') + def test_order_Scenario(self, rg): + + self.kwargs.update({ + 'myDevice': 'testedgedevice', + }) + + call_scenario(self, rg) + calc_coverage(__file__) + raise_if() diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_order_scenario_coverage.md b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_order_scenario_coverage.md new file mode 100644 index 00000000000..7b67e377525 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2019_03_01/test_order_scenario_coverage.md @@ -0,0 +1,8 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +|step_device_create|successed||||2020-12-08 08:53:08.185376|2020-12-08 08:53:14.434966| +|step_order_create|successed||||2020-12-08 08:53:14.443005|2020-12-08 08:54:18.003579| +|step_order_show|successed||||2020-12-08 08:54:18.004577|2020-12-08 08:54:19.514589| +|step_order_list|successed||||2020-12-08 08:54:55.166716|2020-12-08 08:54:56.677546| +|step_order_delete|successed||||2020-12-08 08:54:20.993150|2020-12-08 08:54:55.165713| +|step_device_delete|successed||||2020-12-08 08:54:56.677546|2020-12-08 08:55:03.651581| +Coverage: 6/6 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/__init__.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/__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/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/example_steps.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/example_steps.py new file mode 100644 index 00000000000..cc5613e9873 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/example_steps.py @@ -0,0 +1,284 @@ +# -------------------------------------------------------------------------- +# 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=unused-argument + +from .. import try_manual + + +# EXAMPLE: /Devices/put/DataBoxEdgeDevicePut +@try_manual +def step_device_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device create ' + '--location "eastus" ' + '--sku "Edge" ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/get/DataBoxEdgeDeviceGetByName +@try_manual +def step_device_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device show ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/get/DataBoxEdgeDeviceGetByResourceGroup +@try_manual +def step_device_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/get/DataBoxEdgeDeviceGetBySubscription +@try_manual +def step_device_list2(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device list ' + '-g ""', + checks=checks) + + +# EXAMPLE: /Devices/get/UpdateSummaryGet +@try_manual +def step_device_show_update_summary(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device show-update-summary ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/patch/DataBoxEdgeDevicePatch +@try_manual +def step_device_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device update ' + '--name "{myDevice}" ' + '--tags Key1="value1" Key2="value2" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/post/DownloadUpdatesPost +@try_manual +def step_device_download_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device download-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/post/InstallUpdatesPost +@try_manual +def step_device_install_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device install-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/post/ScanForUpdatesPost +@try_manual +def step_device_scan_for_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device scan-for-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Alerts/get/AlertGet +@try_manual +def step_alert_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge alert show ' + '--name "159a00c7-8543-4343-9435-263ac87df3bb" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Alerts/get/AlertGetAllInDevice +@try_manual +def step_alert_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge alert list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /BandwidthSchedules/put/BandwidthSchedulePut +@try_manual +def step_bandwidth_schedule_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge bandwidth-schedule create ' + '--name "bandwidth-1" ' + '--device-name "{myDevice}" ' + '--days "Sunday" "Monday" ' + '--rate-in-mbps 100 ' + '--start "0:0:0" ' + '--stop "13:59:0" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /BandwidthSchedules/get/BandwidthScheduleGet +@try_manual +def step_bandwidth_schedule_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge bandwidth-schedule show ' + '--name "bandwidth-1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /BandwidthSchedules/get/BandwidthScheduleGetAllInDevice +@try_manual +def step_bandwidth_schedule_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge bandwidth-schedule list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /BandwidthSchedules/delete/BandwidthScheduleDelete +@try_manual +def step_bandwidth_schedule_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge bandwidth-schedule delete -y ' + '--name "bandwidth-1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Jobs/get/JobsGet +@try_manual +def step_show_job(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge show-job ' + '--name "159a00c7-8543-4343-9435-263ac87df3bb" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Nodes/get/NodesGetAllInDevice +@try_manual +def step_list_node(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge list-node ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Orders/put/OrderPut +@try_manual +def step_order_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order create ' + '--device-name "{myDevice}" ' + '--company-name "Microsoft" ' + '--contact-person "John Mcclane" ' + '--email-list "john@microsoft.com" ' + '--phone "(800) 426-9400" ' + '--address-line1 "Microsoft Corporation" ' + '--address-line2 "One Microsoft Way" ' + '--address-line3 "Redmond" ' + '--city "WA" ' + '--country "United States" ' + '--postal-code "98052" ' + '--state "WA" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Orders/get/OrderGet +@try_manual +def step_order_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order show ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Orders/get/OrderGetAllInDevice +@try_manual +def step_order_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Orders/delete/OrderDelete +@try_manual +def step_order_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order delete -y ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/delete/DataBoxEdgeDeviceDelete +@try_manual +def step_device_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device delete -y ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Skus/get/ListSkus +@try_manual +def step_list_sku(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge list-sku', + checks=checks) diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/recordings/test_device_general.yaml b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/recordings/test_device_general.yaml new file mode 100644 index 00000000000..5a38d8292cf --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/recordings/test_device_general.yaml @@ -0,0 +1,448 @@ +interactions: +- request: + body: '{"location": "eastus", "sku": {"name": "Edge", "tier": "Standard"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device create + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --location --sku --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n + \ \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": + \"W/\\\"datetime'2020-12-08T08%3A49%3A48.0627442Z'\\\"_W/\\\"datetime'2020-12-08T08%3A49%3A48.0697495Z'\\\"\",\r\n + \ \"identity\": {\r\n \"type\": \"None\"\r\n },\r\n \"properties\": {\r\n + \ \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": + \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": + 0,\r\n \"resourceMoveDetails\": {\r\n \"operationInProgress\": \"None\"\r\n + \ }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '805' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:49:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device show + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n + \ \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": + \"W/\\\"datetime'2020-12-08T08%3A49%3A48.0627442Z'\\\"_W/\\\"datetime'2020-12-08T08%3A49%3A48.0697495Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '687' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:49:50 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01 + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n + \ \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A49%3A48.0627442Z'\\\"_W/\\\"datetime'2020-12-08T08%3A49%3A48.0697495Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '784' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:49:52 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01 + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n + \ \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A49%3A48.0627442Z'\\\"_W/\\\"datetime'2020-12-08T08%3A49%3A48.0697495Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n + \ \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n + \ },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A49%3A48.2747073Z'\\\"_W/\\\"datetime'2020-12-08T08%3A49%3A48.2817118Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitesthjrbg5bss6skhe7l3d67hgvebvmmsbm34q7oxnv4fjkj2anc3kvotitm7njjzxjfek5r/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n + \ \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n + \ },\r\n \"etag\": \"W/\\\"datetime'2020-12-07T09%3A57%3A46.069116Z'\\\"_W/\\\"datetime'2020-12-07T09%3A57%3A46.0751198Z'\\\"\",\r\n + \ \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": + \"c9fd4631-c426-427e-bfda-13038fdcc74f\",\r\n \"tenantId\": \"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a\"\r\n + \ },\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": + \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 1\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yishitest/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testdevice\",\r\n + \ \"name\": \"testdevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n + \ \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n + \ },\r\n \"etag\": \"W/\\\"datetime'2020-11-26T07%3A55%3A22.0431885Z'\\\"_W/\\\"datetime'2020-11-26T07%3A55%3A22.0511943Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yishitest/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3122' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:49:54 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"tags": {"Key1": "value1", "Key2": "value2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device update + Connection: + - keep-alive + Content-Length: + - '46' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --name --tags --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"Key1\": + \"value1\",\r\n \"Key2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": + \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A49%3A56.5183185Z'\\\"_W/\\\"datetime'2020-12-08T08%3A49%3A56.5253239Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0,\r\n \"resourceMoveDetails\": {\r\n \"operationInProgress\": + \"None\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '811' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:49:59 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device show + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"Key1\": + \"value1\",\r\n \"Key2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": + \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A49%3A56.5183185Z'\\\"_W/\\\"datetime'2020-12-08T08%3A49%3A56.5253239Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '736' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:50:01 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Tue, 08 Dec 2020 08:50:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:50:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/recordings/test_general_Scenario.yaml b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/recordings/test_general_Scenario.yaml new file mode 100644 index 00000000000..d8b57217289 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/recordings/test_general_Scenario.yaml @@ -0,0 +1,45 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge list-sku + Connection: + - keep-alive + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DataBoxEdge/skus?api-version=2019-08-01 + response: + body: + string: '{"value":[{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["eastus2euap"],"locationInfo":[{"location":"eastus2euap","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["eastus2euap"],"locationInfo":[{"location":"eastus2euap","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["centraluseuap"],"locationInfo":[{"location":"centraluseuap","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["centraluseuap"],"locationInfo":[{"location":"centraluseuap","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":[],"zoneDetails":[]}],"restrictions":[]}]}' + headers: + cache-control: + - no-cache + content-length: + - '2396' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:49:42 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/recordings/test_order_Scenario.yaml b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/recordings/test_order_Scenario.yaml new file mode 100644 index 00000000000..df18a80be9f --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/recordings/test_order_Scenario.yaml @@ -0,0 +1,520 @@ +interactions: +- request: + body: '{"location": "eastus", "sku": {"name": "Edge", "tier": "Standard"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device create + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --location --sku --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n + \ \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": + \"W/\\\"datetime'2020-12-08T08%3A49%3A48.2747073Z'\\\"_W/\\\"datetime'2020-12-08T08%3A49%3A48.2817118Z'\\\"\",\r\n + \ \"identity\": {\r\n \"type\": \"None\"\r\n },\r\n \"properties\": {\r\n + \ \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": + \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": + 0,\r\n \"resourceMoveDetails\": {\r\n \"operationInProgress\": \"None\"\r\n + \ }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '805' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:49:50 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"contactInformation": {"contactPerson": "John Mcclane", + "companyName": "Microsoft", "phone": "(800) 426-9400", "emailList": ["john@microsoft.com"]}, + "shippingAddress": {"addressLine1": "Microsoft Corporation", "addressLine2": + "One Microsoft Way", "addressLine3": "Redmond", "postalCode": "98052", "city": + "WA", "state": "WA", "country": "United States"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order create + Connection: + - keep-alive + Content-Length: + - '371' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --device-name --company-name --contact-person --email-list --phone --address-line1 + --address-line2 --address-line3 --city --country --postal-code --state --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 08 Dec 2020 08:49:52 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default/operationResults/c9462237-2f09-4200-b558-64505e5e75a8?api-version=2019-08-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order create + Connection: + - keep-alive + ParameterSetName: + - --device-name --company-name --contact-person --email-list --phone --address-line1 + --address-line2 --address-line3 --city --country --postal-code --state --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default/operationResults/c9462237-2f09-4200-b558-64505e5e75a8?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 08 Dec 2020 08:50:23 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order create + Connection: + - keep-alive + ParameterSetName: + - --device-name --company-name --contact-person --email-list --phone --address-line1 + --address-line2 --address-line3 --city --country --postal-code --state --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"contactInformation\": {\r\n \"contactPerson\": + \"John Mcclane\",\r\n \"companyName\": \"Microsoft\",\r\n \"phone\": + \"(800) 426-9400\",\r\n \"emailList\": [\r\n \"john@microsoft.com\"\r\n + \ ]\r\n },\r\n \"shippingAddress\": {\r\n \"addressLine1\": + \"Microsoft Corporation\",\r\n \"addressLine2\": \"One Microsoft Way\",\r\n + \ \"addressLine3\": \"Redmond\",\r\n \"postalCode\": \"98052\",\r\n + \ \"city\": \"WA\",\r\n \"state\": \"WA\",\r\n \"country\": + \"United States\"\r\n },\r\n \"currentStatus\": {\r\n \"status\": + \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n + \ \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n },\r\n \"orderHistory\": [\r\n {\r\n \"status\": + \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n + \ \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n }\r\n ],\r\n \"deliveryTrackingInfo\": [],\r\n \"returnTrackingInfo\": + []\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default\",\r\n + \ \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/orders\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1330' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:50:54 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order show + Connection: + - keep-alive + ParameterSetName: + - --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"contactInformation\": {\r\n \"contactPerson\": + \"John Mcclane\",\r\n \"companyName\": \"Microsoft\",\r\n \"phone\": + \"(800) 426-9400\",\r\n \"emailList\": [\r\n \"john@microsoft.com\"\r\n + \ ]\r\n },\r\n \"shippingAddress\": {\r\n \"addressLine1\": + \"Microsoft Corporation\",\r\n \"addressLine2\": \"One Microsoft Way\",\r\n + \ \"addressLine3\": \"Redmond\",\r\n \"postalCode\": \"98052\",\r\n + \ \"city\": \"WA\",\r\n \"state\": \"WA\",\r\n \"country\": + \"United States\"\r\n },\r\n \"currentStatus\": {\r\n \"status\": + \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n + \ \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n },\r\n \"orderHistory\": [\r\n {\r\n \"status\": + \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n + \ \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n }\r\n ],\r\n \"deliveryTrackingInfo\": [],\r\n \"returnTrackingInfo\": + []\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default\",\r\n + \ \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/orders\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1330' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:50:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order list + Connection: + - keep-alive + ParameterSetName: + - --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders?api-version=2019-08-01 + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"contactInformation\": + {\r\n \"contactPerson\": \"John Mcclane\",\r\n \"companyName\": + \"Microsoft\",\r\n \"phone\": \"(800) 426-9400\",\r\n \"emailList\": + [\r\n \"john@microsoft.com\"\r\n ]\r\n },\r\n \"shippingAddress\": + {\r\n \"addressLine1\": \"Microsoft Corporation\",\r\n \"addressLine2\": + \"One Microsoft Way\",\r\n \"addressLine3\": \"Redmond\",\r\n \"postalCode\": + \"98052\",\r\n \"city\": \"WA\",\r\n \"state\": \"WA\",\r\n + \ \"country\": \"United States\"\r\n },\r\n \"currentStatus\": + {\r\n \"status\": \"Untracked\",\r\n \"updateDateTime\": + \"0001-01-01T00:00:00Z\",\r\n \"comments\": \"Initialising Order + with Untracked status\",\r\n \"additionalOrderDetails\": {}\r\n },\r\n + \ \"orderHistory\": [\r\n {\r\n \"status\": \"Untracked\",\r\n + \ \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n \"comments\": + \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n }\r\n ],\r\n \"deliveryTrackingInfo\": [],\r\n + \ \"returnTrackingInfo\": []\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default\",\r\n + \ \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/orders\"\r\n + \ }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1515' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:50:57 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 08 Dec 2020 08:50:59 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default/operationResults/7b490365-71f6-4a80-ac89-c84b39095f9e?api-version=2019-08-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order delete + Connection: + - keep-alive + ParameterSetName: + - -y --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default/operationResults/7b490365-71f6-4a80-ac89-c84b39095f9e?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Tue, 08 Dec 2020 08:51:30 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order list + Connection: + - keep-alive + ParameterSetName: + - --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders?api-version=2019-08-01 + response: + body: + string: "{\r\n \"value\": []\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '19' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:51:32 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Tue, 08 Dec 2020 08:51:38 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 204 + message: No Content +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_device_scenario.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_device_scenario.py new file mode 100644 index 00000000000..fb1c43b9922 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_device_scenario.py @@ -0,0 +1,99 @@ +# -------------------------------------------------------------------------- +# 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 os +from azure.cli.testsdk.checkers import JMESPathCheckGreaterThan +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_device_create +from .example_steps import step_device_list +from .example_steps import step_device_list2 +from .example_steps import step_device_update +from .example_steps import step_device_show +from .example_steps import step_device_delete +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_general +@try_manual +def setup_general(test, rg): + pass + + +# Env cleanup_general +@try_manual +def cleanup_general(test, rg): + pass + + +# Testcase: general +@try_manual +def call_general(test, rg): + setup_general(test, rg) + step_device_create(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_device_show(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_device_list(test, rg, checks=[ + test.check('length(@)', 1), + ]) + step_device_list2(test, rg, checks=[ + JMESPathCheckGreaterThan('length(@)', 0), + ]) + step_device_update(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + test.check("tags.Key1", "value1", case_sensitive=False), + test.check("tags.Key2", "value2", case_sensitive=False), + ]) + step_device_show(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_device_delete(test, rg, checks=[]) + step_device_list(test, rg, checks=[ + test.check('length(@)', 0), + ]) + cleanup_general(test, rg) + + +# Test class for general +@try_manual +class DevicegeneralTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_GroupForEdgeAutomation'[:7], key='rg', parameter_name='rg') + def test_device_general(self, rg): + + self.kwargs.update({ + 'myDevice': 'testedgedevice', + }) + + call_general(self, rg) + calc_coverage(__file__) + raise_if() diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_device_scenario_coverage.md b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_device_scenario_coverage.md new file mode 100644 index 00000000000..b2c93a175a7 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_device_scenario_coverage.md @@ -0,0 +1,8 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +|step_device_create|successed||||2020-12-08 08:49:42.685211|2020-12-08 08:49:49.262133| +|step_device_show|successed||||2020-12-08 08:49:59.408084|2020-12-08 08:50:01.741912| +|step_device_list|successed||||2020-12-08 08:50:08.274547|2020-12-08 08:50:08.641110| +|step_device_list2|successed||||2020-12-08 08:49:52.776521|2020-12-08 08:49:54.445200| +|step_device_update|successed||||2020-12-08 08:49:54.445200|2020-12-08 08:49:59.408084| +|step_device_delete|successed||||2020-12-08 08:50:01.741912|2020-12-08 08:50:08.272584| +Coverage: 6/6 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_general_scenario.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_general_scenario.py new file mode 100644 index 00000000000..acc1b26d3ba --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_general_scenario.py @@ -0,0 +1,59 @@ +# -------------------------------------------------------------------------- +# 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 os +from azure.cli.testsdk.checkers import JMESPathCheckGreaterThan +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_list_sku +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_scenario +@try_manual +def setup_scenario(test, rg): + pass + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test, rg): + pass + + +# Testcase: Scenario +@try_manual +def call_scenario(test, rg): + setup_scenario(test, rg) + step_list_sku(test, rg, checks=[JMESPathCheckGreaterThan('length(@)', 0)]) + cleanup_scenario(test, rg) + + +# Test class for Scenario +@try_manual +class GeneralScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_GroupForEdgeAutomation'[:7], key='rg', parameter_name='rg') + def test_general_Scenario(self, rg): + + self.kwargs.update({ + 'myDevice': 'testedgedevice', + }) + + call_scenario(self, rg) + calc_coverage(__file__) + raise_if() diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_general_scenario_coverage.md b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_general_scenario_coverage.md new file mode 100644 index 00000000000..20d8ecff83c --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_general_scenario_coverage.md @@ -0,0 +1,3 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +|step_list_sku|successed||||2020-12-08 08:49:42.732042|2020-12-08 08:49:43.107750| +Coverage: 1/1 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_order_scenario.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_order_scenario.py new file mode 100644 index 00000000000..d5261fa1d2c --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_order_scenario.py @@ -0,0 +1,79 @@ +# -------------------------------------------------------------------------- +# 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 os +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_device_create +from .example_steps import step_device_delete +from .example_steps import step_order_create +from .example_steps import step_order_show +from .example_steps import step_order_list +from .example_steps import step_order_delete +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_scenario +@try_manual +def setup_scenario(test, rg): + step_device_create(test, rg) + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test, rg): + step_device_delete(test, rg) + + +# Testcase: Scenario +@try_manual +def call_scenario(test, rg): + setup_scenario(test, rg) + step_order_create(test, rg, checks=[ + test.check("contactInformation.companyName", "Microsoft", case_sensitive=False), + test.check("contactInformation.contactPerson", "John Mcclane", case_sensitive=False), + test.check("shippingAddress.country", "United States", case_sensitive=False), + ]) + step_order_show(test, rg, checks=[ + test.check("contactInformation.companyName", "Microsoft", case_sensitive=False), + test.check("contactInformation.contactPerson", "John Mcclane", case_sensitive=False), + test.check("shippingAddress.country", "United States", case_sensitive=False), + ]) + step_order_list(test, rg, checks=[ + test.check('length(@)', 1), + ]) + step_order_delete(test, rg, checks=[]) + step_order_list(test, rg, checks=[ + test.check('length(@)', 0), + ]) + cleanup_scenario(test, rg) + + +# Test class for Scenario +@try_manual +class OrderScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_GroupForEdgeAutomation'[:7], key='rg', parameter_name='rg') + def test_order_Scenario(self, rg): + + self.kwargs.update({ + 'myDevice': 'testedgedevice', + }) + + call_scenario(self, rg) + calc_coverage(__file__) + raise_if() diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_order_scenario_coverage.md b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_order_scenario_coverage.md new file mode 100644 index 00000000000..be2ab08e95f --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/hybrid_2020_09_01/test_order_scenario_coverage.md @@ -0,0 +1,8 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +|step_device_create|successed||||2020-12-08 08:49:42.685211|2020-12-08 08:49:50.440975| +|step_order_create|successed||||2020-12-08 08:49:50.449171|2020-12-08 08:50:55.204097| +|step_order_show|successed||||2020-12-08 08:50:55.204097|2020-12-08 08:50:56.636199| +|step_order_list|successed||||2020-12-08 08:51:31.499002|2020-12-08 08:51:32.689373| +|step_order_delete|successed||||2020-12-08 08:50:58.172456|2020-12-08 08:51:31.497994| +|step_device_delete|successed||||2020-12-08 08:51:32.689373|2020-12-08 08:51:39.444126| +Coverage: 6/6 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/__init__.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/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/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/example_steps.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/example_steps.py new file mode 100644 index 00000000000..d3ad5950c05 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/example_steps.py @@ -0,0 +1,415 @@ +# -------------------------------------------------------------------------- +# 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=unused-argument + +from .. import try_manual + + +# EXAMPLE: /Devices/put/DataBoxEdgeDevicePut +@try_manual +def step_device_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device create ' + '--location "eastus" ' + '--sku "Edge" ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_device_create_min(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device create ' + '--location "eastus" ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/get/DataBoxEdgeDeviceGetByName +@try_manual +def step_device_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device show ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_device_show_min(test, rg, checks=None): + return step_device_show(test, rg, checks) + + +# EXAMPLE: /Devices/get/DataBoxEdgeDeviceGetByResourceGroup +@try_manual +def step_device_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device list ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_device_list_min(test, rg, checks=None): + return step_device_list(test, rg, checks) + + +# EXAMPLE: /Devices/get/DataBoxEdgeDeviceGetBySubscription +@try_manual +def step_device_list2(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device list ' + '-g ""', + checks=checks) + + +@try_manual +def step_device_list2_min(test, rg, checks=None): + return step_device_list2(test, rg, checks) + + +# EXAMPLE: /Devices/get/UpdateSummaryGet +@try_manual +def step_device_show_update_summary(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device show-update-summary ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_device_show_update_summary_min(test, rg, checks=None): + return step_device_show_update_summary(test, rg, checks) + + +# EXAMPLE: /Devices/patch/DataBoxEdgeDevicePatch +@try_manual +def step_device_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device update ' + '--name "{myDevice}" ' + '--tags Key1="value1" Key2="value2" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_device_update_min(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/post/DownloadUpdatesPost +@try_manual +def step_device_download_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device download-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_device_download_update_min(test, rg, checks=None): + return step_device_download_update(test, rg, checks) + + +# EXAMPLE: /Devices/post/InstallUpdatesPost +@try_manual +def step_device_install_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device install-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_device_install_update_min(test, rg, checks=None): + return step_device_install_update(test, rg, checks) + + +# EXAMPLE: /Devices/post/ScanForUpdatesPost +@try_manual +def step_device_scan_for_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device scan-for-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_device_scan_for_update_min(test, rg, checks=None): + return step_device_scan_for_update(test, rg, checks) + + +# EXAMPLE: /Alerts/get/AlertGet +@try_manual +def step_alert_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge alert show ' + '--name "159a00c7-8543-4343-9435-263ac87df3bb" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_alert_show_min(test, rg, checks=None): + return step_alert_show(test, rg, checks) + + +# EXAMPLE: /Alerts/get/AlertGetAllInDevice +@try_manual +def step_alert_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge alert list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_alert_list_min(test, rg, checks=None): + return step_alert_list(test, rg, checks) + + +# EXAMPLE: /BandwidthSchedules/put/BandwidthSchedulePut +@try_manual +def step_bandwidth_schedule_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge bandwidth-schedule create ' + '--name "bandwidth-1" ' + '--device-name "{myDevice}" ' + '--days "Sunday" "Monday" ' + '--rate-in-mbps 100 ' + '--start "0:0:0" ' + '--stop "13:59:0" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_bandwidth_schedule_create_min(test, rg, checks=None): + return step_bandwidth_schedule_create(test, rg, checks) + + +# EXAMPLE: /BandwidthSchedules/get/BandwidthScheduleGet +@try_manual +def step_bandwidth_schedule_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge bandwidth-schedule show ' + '--name "bandwidth-1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_bandwidth_schedule_show_min(test, rg, checks=None): + return step_bandwidth_schedule_show(test, rg, checks) + + +# EXAMPLE: /BandwidthSchedules/get/BandwidthScheduleGetAllInDevice +@try_manual +def step_bandwidth_schedule_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge bandwidth-schedule list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_bandwidth_schedule_list_min(test, rg, checks=None): + return step_bandwidth_schedule_list(test, rg, checks) + + +# EXAMPLE: /BandwidthSchedules/delete/BandwidthScheduleDelete +@try_manual +def step_bandwidth_schedule_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge bandwidth-schedule delete -y ' + '--name "bandwidth-1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_bandwidth_schedule_delete_min(test, rg, checks=None): + return step_bandwidth_schedule_delete(test, rg, checks) + + +# EXAMPLE: /Jobs/get/JobsGet +@try_manual +def step_show_job(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge show-job ' + '--name "159a00c7-8543-4343-9435-263ac87df3bb" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_show_job_min(test, rg, checks=None): + return step_show_job(test, rg, checks) + + +# EXAMPLE: /Nodes/get/NodesGetAllInDevice +@try_manual +def step_list_node(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge list-node ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_list_node_min(test, rg, checks=None): + return step_list_node(test, rg, checks) + + +# EXAMPLE: /Orders/put/OrderPut +@try_manual +def step_order_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order create ' + '--device-name "{myDevice}" ' + '--company-name "Microsoft" ' + '--contact-person "John Mcclane" ' + '--email-list "john@microsoft.com" ' + '--phone "(800) 426-9400" ' + '--address-line1 "Microsoft Corporation" ' + '--address-line2 "One Microsoft Way" ' + '--address-line3 "Redmond" ' + '--city "WA" ' + '--country "United States" ' + '--postal-code "98052" ' + '--state "WA" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_order_create_min(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order create ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Orders/get/OrderGet +@try_manual +def step_order_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order show ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_order_show_min(test, rg, checks=None): + return step_order_show(test, rg, checks) + + +# EXAMPLE: /Orders/get/OrderGetAllInDevice +@try_manual +def step_order_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_order_list_min(test, rg, checks=None): + return step_order_list(test, rg, checks) + + +# EXAMPLE: /Orders/delete/OrderDelete +@try_manual +def step_order_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order delete -y ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_order_delete_min(test, rg, checks=None): + return step_order_delete(test, rg, checks) + + +# EXAMPLE: /Devices/delete/DataBoxEdgeDeviceDelete +@try_manual +def step_device_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device delete -y ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_device_delete_min(test, rg, checks=None): + return step_device_delete(test, rg, checks) + + +# EXAMPLE: /Skus/get/ListSkus +@try_manual +def step_list_sku(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge list-sku', + checks=checks) + + +@try_manual +def step_list_sku_min(test, rg, checks=None): + return step_list_sku(test, rg, checks) diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/recordings/test_device_general.yaml b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/recordings/test_device_general.yaml new file mode 100644 index 00000000000..5ff6ff83343 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/recordings/test_device_general.yaml @@ -0,0 +1,441 @@ +interactions: +- request: + body: '{"location": "eastus", "sku": {"name": "Edge", "tier": "Standard"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device create + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --location --sku --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n + \ \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": + \"W/\\\"datetime'2020-12-08T08%3A26%3A12.4210999Z'\\\"_W/\\\"datetime'2020-12-08T08%3A26%3A12.4281054Z'\\\"\",\r\n + \ \"identity\": {\r\n \"type\": \"None\"\r\n },\r\n \"properties\": {\r\n + \ \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": + \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": + 0,\r\n \"resourceMoveDetails\": {\r\n \"operationInProgress\": \"None\"\r\n + \ }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '805' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:26:13 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device show + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n + \ \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": + \"W/\\\"datetime'2020-12-08T08%3A26%3A12.4210999Z'\\\"_W/\\\"datetime'2020-12-08T08%3A26%3A12.4281054Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '687' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:26:15 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01 + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n + \ \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A26%3A12.4210999Z'\\\"_W/\\\"datetime'2020-12-08T08%3A26%3A12.4281054Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '784' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:26:16 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01 + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"location\": \"eastus\",\r\n + \ \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n + \ \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A26%3A12.4210999Z'\\\"_W/\\\"datetime'2020-12-08T08%3A26%3A12.4281054Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n + \ \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n + \ },\r\n \"etag\": \"W/\\\"datetime'2020-12-07T09%3A57%3A46.069116Z'\\\"_W/\\\"datetime'2020-12-07T09%3A57%3A46.0751198Z'\\\"\",\r\n + \ \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": + \"c9fd4631-c426-427e-bfda-13038fdcc74f\",\r\n \"tenantId\": \"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a\"\r\n + \ },\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": + \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 1\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yishitest/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testdevice\",\r\n + \ \"name\": \"testdevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ },\r\n {\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n + \ \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n + \ },\r\n \"etag\": \"W/\\\"datetime'2020-11-26T07%3A55%3A22.0431885Z'\\\"_W/\\\"datetime'2020-11-26T07%3A55%3A22.0511943Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yishitest/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n + \ }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2360' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:26:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"tags": {"Key1": "value1", "Key2": "value2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device update + Connection: + - keep-alive + Content-Length: + - '46' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --name --tags --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"Key1\": + \"value1\",\r\n \"Key2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": + \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A26%3A21.4350804Z'\\\"_W/\\\"datetime'2020-12-08T08%3A26%3A21.4400839Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0,\r\n \"resourceMoveDetails\": {\r\n \"operationInProgress\": + \"None\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '811' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:26:24 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device show + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"Key1\": + \"value1\",\r\n \"Key2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": + \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2020-12-08T08%3A26%3A21.4350804Z'\\\"_W/\\\"datetime'2020-12-08T08%3A26%3A21.4400839Z'\\\"\",\r\n + \ \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n + \ \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": + 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '736' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:26:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Tue, 08 Dec 2020 08:26:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:26:36 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/recordings/test_general_Scenario.yaml b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/recordings/test_general_Scenario.yaml new file mode 100644 index 00000000000..28b645b4ffc --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/recordings/test_general_Scenario.yaml @@ -0,0 +1,45 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge list-sku + Connection: + - keep-alive + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DataBoxEdge/skus?api-version=2019-08-01 + response: + body: + string: '{"value":[{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["eastus2euap"],"locationInfo":[{"location":"eastus2euap","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["eastus2euap"],"locationInfo":[{"location":"eastus2euap","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["centraluseuap"],"locationInfo":[{"location":"centraluseuap","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["centraluseuap"],"locationInfo":[{"location":"centraluseuap","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Edge","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"dataBoxEdgeDevices","name":"Gateway","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":[],"zoneDetails":[]}],"restrictions":[]}]}' + headers: + cache-control: + - no-cache + content-length: + - '2396' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:09:52 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/recordings/test_order_Scenario.yaml b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/recordings/test_order_Scenario.yaml new file mode 100644 index 00000000000..9b17374cbf0 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/recordings/test_order_Scenario.yaml @@ -0,0 +1,520 @@ +interactions: +- request: + body: '{"location": "eastus", "sku": {"name": "Edge", "tier": "Standard"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device create + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --location --sku --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n + \ \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": + \"W/\\\"datetime'2020-12-08T08%3A37%3A18.405173Z'\\\"_W/\\\"datetime'2020-12-08T08%3A37%3A18.4131786Z'\\\"\",\r\n + \ \"identity\": {\r\n \"type\": \"None\"\r\n },\r\n \"properties\": {\r\n + \ \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": + \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": + 0,\r\n \"resourceMoveDetails\": {\r\n \"operationInProgress\": \"None\"\r\n + \ }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice\",\r\n + \ \"name\": \"testedgedevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '804' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:37:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"contactInformation": {"contactPerson": "John Mcclane", + "companyName": "Microsoft", "phone": "(800) 426-9400", "emailList": ["john@microsoft.com"]}, + "shippingAddress": {"addressLine1": "Microsoft Corporation", "addressLine2": + "One Microsoft Way", "addressLine3": "Redmond", "postalCode": "98052", "city": + "WA", "state": "WA", "country": "United States"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order create + Connection: + - keep-alive + Content-Length: + - '371' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --device-name --company-name --contact-person --email-list --phone --address-line1 + --address-line2 --address-line3 --city --country --postal-code --state --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 08 Dec 2020 08:37:21 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default/operationResults/c73368a8-0609-4098-b3f9-335f3d444ab3?api-version=2019-08-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order create + Connection: + - keep-alive + ParameterSetName: + - --device-name --company-name --contact-person --email-list --phone --address-line1 + --address-line2 --address-line3 --city --country --postal-code --state --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default/operationResults/c73368a8-0609-4098-b3f9-335f3d444ab3?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 08 Dec 2020 08:37:52 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order create + Connection: + - keep-alive + ParameterSetName: + - --device-name --company-name --contact-person --email-list --phone --address-line1 + --address-line2 --address-line3 --city --country --postal-code --state --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"contactInformation\": {\r\n \"contactPerson\": + \"John Mcclane\",\r\n \"companyName\": \"Microsoft\",\r\n \"phone\": + \"(800) 426-9400\",\r\n \"emailList\": [\r\n \"john@microsoft.com\"\r\n + \ ]\r\n },\r\n \"shippingAddress\": {\r\n \"addressLine1\": + \"Microsoft Corporation\",\r\n \"addressLine2\": \"One Microsoft Way\",\r\n + \ \"addressLine3\": \"Redmond\",\r\n \"postalCode\": \"98052\",\r\n + \ \"city\": \"WA\",\r\n \"state\": \"WA\",\r\n \"country\": + \"United States\"\r\n },\r\n \"currentStatus\": {\r\n \"status\": + \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n + \ \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n },\r\n \"orderHistory\": [\r\n {\r\n \"status\": + \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n + \ \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n }\r\n ],\r\n \"deliveryTrackingInfo\": [],\r\n \"returnTrackingInfo\": + []\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default\",\r\n + \ \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/orders\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1330' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:38:22 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order show + Connection: + - keep-alive + ParameterSetName: + - --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"contactInformation\": {\r\n \"contactPerson\": + \"John Mcclane\",\r\n \"companyName\": \"Microsoft\",\r\n \"phone\": + \"(800) 426-9400\",\r\n \"emailList\": [\r\n \"john@microsoft.com\"\r\n + \ ]\r\n },\r\n \"shippingAddress\": {\r\n \"addressLine1\": + \"Microsoft Corporation\",\r\n \"addressLine2\": \"One Microsoft Way\",\r\n + \ \"addressLine3\": \"Redmond\",\r\n \"postalCode\": \"98052\",\r\n + \ \"city\": \"WA\",\r\n \"state\": \"WA\",\r\n \"country\": + \"United States\"\r\n },\r\n \"currentStatus\": {\r\n \"status\": + \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n + \ \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n },\r\n \"orderHistory\": [\r\n {\r\n \"status\": + \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n + \ \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n }\r\n ],\r\n \"deliveryTrackingInfo\": [],\r\n \"returnTrackingInfo\": + []\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default\",\r\n + \ \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/orders\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1330' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:38:24 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order list + Connection: + - keep-alive + ParameterSetName: + - --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders?api-version=2019-08-01 + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"contactInformation\": + {\r\n \"contactPerson\": \"John Mcclane\",\r\n \"companyName\": + \"Microsoft\",\r\n \"phone\": \"(800) 426-9400\",\r\n \"emailList\": + [\r\n \"john@microsoft.com\"\r\n ]\r\n },\r\n \"shippingAddress\": + {\r\n \"addressLine1\": \"Microsoft Corporation\",\r\n \"addressLine2\": + \"One Microsoft Way\",\r\n \"addressLine3\": \"Redmond\",\r\n \"postalCode\": + \"98052\",\r\n \"city\": \"WA\",\r\n \"state\": \"WA\",\r\n + \ \"country\": \"United States\"\r\n },\r\n \"currentStatus\": + {\r\n \"status\": \"Untracked\",\r\n \"updateDateTime\": + \"0001-01-01T00:00:00Z\",\r\n \"comments\": \"Initialising Order + with Untracked status\",\r\n \"additionalOrderDetails\": {}\r\n },\r\n + \ \"orderHistory\": [\r\n {\r\n \"status\": \"Untracked\",\r\n + \ \"updateDateTime\": \"0001-01-01T00:00:00Z\",\r\n \"comments\": + \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": + {}\r\n }\r\n ],\r\n \"deliveryTrackingInfo\": [],\r\n + \ \"returnTrackingInfo\": []\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default\",\r\n + \ \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/orders\"\r\n + \ }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1515' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:38:25 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 08 Dec 2020 08:38:28 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default/operationResults/970d27ea-ea91-43f2-b75f-245191cfa08b?api-version=2019-08-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order delete + Connection: + - keep-alive + ParameterSetName: + - -y --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders/default/operationResults/970d27ea-ea91-43f2-b75f-245191cfa08b?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Tue, 08 Dec 2020 08:38:59 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge order list + Connection: + - keep-alive + ParameterSetName: + - --device-name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/orders?api-version=2019-08-01 + response: + body: + string: "{\r\n \"value\": []\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '19' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 08 Dec 2020 08:39:01 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - databoxedge device delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group + User-Agent: + - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-databoxedge/0.2.0 Azure-SDK-For-Python AZURECLI/2.16.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice?api-version=2019-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Tue, 08 Dec 2020 08:39:09 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14997' + status: + code: 204 + message: No Content +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_device_scenario.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_device_scenario.py new file mode 100644 index 00000000000..47ebcffebe3 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_device_scenario.py @@ -0,0 +1,134 @@ +# -------------------------------------------------------------------------- +# 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 os +from azure.cli.testsdk.checkers import JMESPathCheckGreaterThan +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_device_create +from .example_steps import step_device_show +from .example_steps import step_device_list +from .example_steps import step_device_list2 +from .example_steps import step_device_update +from .example_steps import step_device_delete +from .example_steps import step_device_create_min +from .example_steps import step_device_show_min +from .example_steps import step_device_list_min +from .example_steps import step_device_list2_min +from .example_steps import step_device_update_min +from .example_steps import step_device_delete_min +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_general +@try_manual +def setup_general(test, rg): + pass + + +# Env cleanup_general +@try_manual +def cleanup_general(test, rg): + pass + + +# Testcase: general +@try_manual +def call_general(test, rg): + setup_general(test, rg) + step_device_create(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_device_show(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_device_list(test, rg, checks=[ + test.check('length(@)', 1), + ]) + step_device_list2(test, rg, checks=[ + JMESPathCheckGreaterThan('length(@)', 0), + ]) + step_device_update(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + test.check("tags.Key1", "value1", case_sensitive=False), + test.check("tags.Key2", "value2", case_sensitive=False), + ]) + step_device_show(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_device_delete(test, rg, checks=[]) + step_device_list(test, rg, checks=[ + test.check('length(@)', 0), + ]) + cleanup_general(test, rg) + + +@try_manual +def call_general_min(test, rg): + setup_general(test, rg) + step_device_create_min(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_device_show_min(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_device_list_min(test, rg, checks=[ + test.check('length(@)', 1), + ]) + step_device_list2_min(test, rg, checks=[ + test.check('length(@)', 1), + ]) + step_device_update_min(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_device_show_min(test, rg, checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_device_delete_min(test, rg, checks=[]) + cleanup_general(test, rg) + + +# Test class for general +@try_manual +class DevicegeneralTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_GroupForEdgeAutomation'[:7], key='rg', parameter_name='rg') + def test_device_general(self, rg): + + self.kwargs.update({ + 'myDevice': 'testedgedevice', + }) + + call_general(self, rg) + calc_coverage(__file__) + raise_if() diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_device_scenario_coverage.md b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_device_scenario_coverage.md new file mode 100644 index 00000000000..a492925e922 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_device_scenario_coverage.md @@ -0,0 +1,8 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +|step_device_create|successed||||2020-12-22 05:51:21.548213|2020-12-22 05:51:21.739031| +|step_device_show|successed||||2020-12-22 05:51:21.931000|2020-12-22 05:51:22.011748| +|step_device_list|successed||||2020-12-22 05:51:22.049533|2020-12-22 05:51:22.096941| +|step_device_list2|successed||||2020-12-22 05:51:21.845737|2020-12-22 05:51:21.880256| +|step_device_update|successed||||2020-12-22 05:51:21.880256|2020-12-22 05:51:21.931000| +|step_device_delete|successed||||2020-12-22 05:51:22.011748|2020-12-22 05:51:22.049533| +Coverage: 6/6 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_general_scenario.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_general_scenario.py new file mode 100644 index 00000000000..ccad26e2bed --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_general_scenario.py @@ -0,0 +1,67 @@ +# -------------------------------------------------------------------------- +# 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 os +from azure.cli.testsdk.checkers import JMESPathCheckGreaterThan +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_list_sku +from .example_steps import step_list_sku_min +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_scenario +@try_manual +def setup_scenario(test, rg): + pass + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test, rg): + pass + + +# Testcase: Scenario +@try_manual +def call_scenario(test, rg): + setup_scenario(test, rg) + step_list_sku(test, rg, checks=[JMESPathCheckGreaterThan('length(@)', 0)]) + cleanup_scenario(test, rg) + + +@try_manual +def call_scenario_min(test, rg): + setup_scenario(test, rg) + step_list_sku_min(test, rg, checks=[]) + cleanup_scenario(test, rg) + + +# Test class for Scenario +@try_manual +class GeneralScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_GroupForEdgeAutomation'[:7], key='rg', parameter_name='rg') + def test_general_Scenario(self, rg): + + self.kwargs.update({ + 'myDevice': 'testedgedevice', + }) + + call_scenario(self, rg) + calc_coverage(__file__) + raise_if() diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_general_scenario_coverage.md b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_general_scenario_coverage.md new file mode 100644 index 00000000000..fc404bf2760 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_general_scenario_coverage.md @@ -0,0 +1,3 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +|step_list_sku|successed||||2020-12-18 07:01:59.621791|2020-12-18 07:01:59.717812| +Coverage: 1/1 diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_order_scenario.py b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_order_scenario.py new file mode 100644 index 00000000000..70977139ff9 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_order_scenario.py @@ -0,0 +1,93 @@ +# -------------------------------------------------------------------------- +# 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 os +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_device_create +from .example_steps import step_device_delete +from .example_steps import step_order_create +from .example_steps import step_order_show +from .example_steps import step_order_list +from .example_steps import step_order_delete +from .example_steps import step_order_create_min +from .example_steps import step_order_show_min +from .example_steps import step_order_list_min +from .example_steps import step_order_delete_min +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_scenario +@try_manual +def setup_scenario(test, rg): + step_device_create(test, rg) + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test, rg): + step_device_delete(test, rg) + + +# Testcase: Scenario +@try_manual +def call_scenario(test, rg): + setup_scenario(test, rg) + step_order_create(test, rg, checks=[ + test.check("contactInformation.companyName", "Microsoft", case_sensitive=False), + test.check("contactInformation.contactPerson", "John Mcclane", case_sensitive=False), + test.check("shippingAddress.country", "United States", case_sensitive=False), + ]) + step_order_show(test, rg, checks=[ + test.check("contactInformation.companyName", "Microsoft", case_sensitive=False), + test.check("contactInformation.contactPerson", "John Mcclane", case_sensitive=False), + test.check("shippingAddress.country", "United States", case_sensitive=False), + ]) + step_order_list(test, rg, checks=[ + test.check('length(@)', 1), + ]) + step_order_delete(test, rg, checks=[]) + step_order_list(test, rg, checks=[ + test.check('length(@)', 0), + ]) + cleanup_scenario(test, rg) + + +@try_manual +def call_scenario_min(test, rg): + setup_scenario(test, rg) + step_order_create_min(test, rg, checks=[]) + step_order_show_min(test, rg, checks=[]) + step_order_list_min(test, rg, checks=[]) + step_order_delete_min(test, rg, checks=[]) + cleanup_scenario(test, rg) + + +# Test class for Scenario +@try_manual +class OrderScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_GroupForEdgeAutomation'[:7], key='rg', parameter_name='rg') + def test_order_Scenario(self, rg): + + self.kwargs.update({ + 'myDevice': 'testedgedevice', + }) + + call_scenario(self, rg) + calc_coverage(__file__) + raise_if() diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_order_scenario_coverage.md b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_order_scenario_coverage.md new file mode 100644 index 00000000000..ada36db1a0c --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/tests/latest/test_order_scenario_coverage.md @@ -0,0 +1,8 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +|step_device_create|successed||||2020-12-18 07:01:59.623792|2020-12-18 07:01:59.719814| +|step_order_create|successed||||2020-12-18 07:01:59.720814|2020-12-18 07:02:01.463902| +|step_order_show|successed||||2020-12-18 07:02:01.464914|2020-12-18 07:02:01.515960| +|step_order_list|successed||||2020-12-18 07:02:02.895995|2020-12-18 07:02:02.924028| +|step_order_delete|successed||||2020-12-18 07:02:01.545989|2020-12-18 07:02:02.895995| +|step_device_delete|successed||||2020-12-18 07:02:02.924997|2020-12-18 07:02:02.952027| +Coverage: 6/6 diff --git a/src/azure-cli/requirements.py3.Darwin.txt b/src/azure-cli/requirements.py3.Darwin.txt index d62f4ccb6bb..2a94509784c 100644 --- a/src/azure-cli/requirements.py3.Darwin.txt +++ b/src/azure-cli/requirements.py3.Darwin.txt @@ -34,6 +34,7 @@ azure-mgmt-containerservice==9.4.0 azure-mgmt-core==1.2.1 azure-core==1.8.2 azure-mgmt-cosmosdb==1.0.0 +azure-mgmt-databoxedge==0.2.0 azure-mgmt-datalake-analytics==0.2.1 azure-mgmt-datalake-nspkg==3.0.1 azure-mgmt-datalake-store==0.5.0 diff --git a/src/azure-cli/requirements.py3.Linux.txt b/src/azure-cli/requirements.py3.Linux.txt index d62f4ccb6bb..2a94509784c 100644 --- a/src/azure-cli/requirements.py3.Linux.txt +++ b/src/azure-cli/requirements.py3.Linux.txt @@ -34,6 +34,7 @@ azure-mgmt-containerservice==9.4.0 azure-mgmt-core==1.2.1 azure-core==1.8.2 azure-mgmt-cosmosdb==1.0.0 +azure-mgmt-databoxedge==0.2.0 azure-mgmt-datalake-analytics==0.2.1 azure-mgmt-datalake-nspkg==3.0.1 azure-mgmt-datalake-store==0.5.0 diff --git a/src/azure-cli/requirements.py3.windows.txt b/src/azure-cli/requirements.py3.windows.txt index 761999c3e44..152d6ae263d 100644 --- a/src/azure-cli/requirements.py3.windows.txt +++ b/src/azure-cli/requirements.py3.windows.txt @@ -34,6 +34,7 @@ azure-mgmt-containerservice==9.4.0 azure-mgmt-core==1.2.1 azure-core==1.8.2 azure-mgmt-cosmosdb==1.0.0 +azure-mgmt-databoxedge==0.2.0 azure-mgmt-datalake-analytics==0.2.1 azure-mgmt-datalake-nspkg==3.0.1 azure-mgmt-datalake-store==0.5.0 diff --git a/src/azure-cli/setup.py b/src/azure-cli/setup.py index ccabf3f61c9..f63c3b450d7 100644 --- a/src/azure-cli/setup.py +++ b/src/azure-cli/setup.py @@ -77,6 +77,7 @@ 'azure-mgmt-containerregistry==3.0.0rc15', 'azure-mgmt-cosmosdb~=1.0.0', 'azure-mgmt-containerservice~=9.4.0', + 'azure-mgmt-databoxedge~=0.2.0', 'azure-mgmt-datalake-analytics~=0.2.1', 'azure-mgmt-datalake-store~=0.5.0', 'azure-mgmt-datamigration~=0.1.0',